@nutanix-scratch/aiops-js-client 4.0.2-alpha.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +202 -49
- package/README.md +59 -40
- package/dist/Ntnx-Aiops-js-client-prod.js +1 -11
- package/dist/Ntnx-Aiops-js-client.js +1114 -771
- package/dist/es/ApiClient.d.ts +20 -6
- package/dist/es/ApiClient.js +496 -214
- package/dist/es/Paginable.d.ts +1 -1
- package/dist/es/Paginable.js +23 -14
- package/dist/es/apis/scenarios-endpoints.d.ts +181 -0
- package/dist/es/apis/scenarios-endpoints.js +641 -0
- package/dist/es/apis/stats-endpoints.d.ts +93 -0
- package/dist/es/apis/stats-endpoints.js +264 -0
- package/dist/es/index.d.ts +191 -25
- package/dist/es/index.js +719 -56
- package/dist/es/models/aiops/v4/capacityplanning/CapacityDetails.d.ts +109 -0
- package/dist/es/models/aiops/v4/capacityplanning/CapacityDetails.js +459 -0
- package/dist/{lib/models/aiops/v4/blackout/ClusterEntity.d.ts → es/models/aiops/v4/capacityplanning/CapacityUnit.d.ts} +6 -6
- package/dist/es/models/aiops/v4/capacityplanning/CapacityUnit.js +85 -0
- package/dist/es/models/aiops/v4/capacityplanning/Runway.d.ts +86 -0
- package/dist/es/models/aiops/v4/capacityplanning/Runway.js +340 -0
- package/dist/es/models/aiops/v4/capacityplanning/RunwayDuration.d.ts +19 -0
- package/dist/es/models/aiops/v4/capacityplanning/RunwayDuration.js +91 -0
- package/dist/es/models/aiops/v4/clusterMetrics/Cluster.d.ts +90 -87
- package/dist/es/models/aiops/v4/clusterMetrics/Cluster.js +115 -43
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterMetrics.d.ts +171 -152
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterMetrics.js +168 -87
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterProjection.d.ts +49 -29
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterProjection.js +181 -40
- package/dist/es/models/aiops/v4/clusterMetrics/Node.d.ts +48 -45
- package/dist/es/models/aiops/v4/clusterMetrics/Node.js +101 -29
- package/dist/es/models/aiops/v4/clusterMetrics/NodeProjection.d.ts +2 -1
- package/dist/es/models/aiops/v4/clusterMetrics/NodeProjection.js +59 -30
- package/dist/es/models/aiops/v4/clusterMetrics/Vm.d.ts +48 -45
- package/dist/es/models/aiops/v4/clusterMetrics/Vm.js +101 -29
- package/dist/es/models/aiops/v4/clusterMetrics/VmProjection.d.ts +2 -1
- package/dist/es/models/aiops/v4/clusterMetrics/VmProjection.js +59 -30
- package/dist/es/models/aiops/v4/{blackout/ClusterEntity.d.ts → common/ClusterType.d.ts} +6 -6
- package/dist/es/models/aiops/v4/common/ClusterType.js +79 -0
- package/dist/es/models/aiops/v4/config/CapacityUnit.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/CapacityUnit.js +85 -0
- package/dist/es/models/aiops/v4/config/CapacityUpdateConfig.d.ts +77 -0
- package/dist/es/models/aiops/v4/config/CapacityUpdateConfig.js +322 -0
- package/dist/es/models/aiops/v4/config/CapacityUpdateType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/CapacityUpdateType.js +85 -0
- package/dist/es/models/aiops/v4/config/CategoryDetail.d.ts +60 -0
- package/dist/es/models/aiops/v4/config/CategoryDetail.js +315 -0
- package/dist/es/models/aiops/v4/config/CitrixXenProvisionType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/CitrixXenProvisionType.js +85 -0
- package/dist/es/models/aiops/v4/config/CitrixXenWorkload.d.ts +83 -0
- package/dist/es/models/aiops/v4/config/CitrixXenWorkload.js +371 -0
- package/dist/es/models/aiops/v4/config/CitrixXenWorkloadVendor.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/CitrixXenWorkloadVendor.js +79 -0
- package/dist/es/models/aiops/v4/config/ClusterConfig.d.ts +107 -0
- package/dist/es/models/aiops/v4/config/ClusterConfig.js +329 -0
- package/dist/es/models/aiops/v4/config/CreateScenarioApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/CreateScenarioApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/CreateSimulationApiResponse.d.ts +102 -0
- package/dist/es/models/aiops/v4/config/CreateSimulationApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/DataStoreConfig.d.ts +205 -0
- package/dist/es/models/aiops/v4/config/DataStoreConfig.js +673 -0
- package/dist/es/models/aiops/v4/config/DeleteScenarioApiResponse.d.ts +98 -0
- package/dist/es/models/aiops/v4/config/DeleteScenarioApiResponse.js +345 -0
- package/dist/es/models/aiops/v4/config/DeleteSimulationApiResponse.d.ts +98 -0
- package/dist/es/models/aiops/v4/config/DeleteSimulationApiResponse.js +345 -0
- package/dist/es/models/aiops/v4/config/EntityDescriptor.d.ts +68 -0
- package/dist/es/models/aiops/v4/config/EntityDescriptor.js +454 -0
- package/dist/es/models/aiops/v4/config/EntityDescriptorListApiResponse.d.ts +101 -0
- package/dist/es/models/aiops/v4/config/EntityDescriptorListApiResponse.js +365 -0
- package/dist/es/models/aiops/v4/config/EntityType.d.ts +37 -0
- package/dist/es/models/aiops/v4/config/EntityType.js +275 -0
- package/dist/es/models/aiops/v4/config/EntityTypeListApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/EntityTypeListApiResponse.js +365 -0
- package/dist/es/models/aiops/v4/config/GenerateRecommendationApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/GenerateRecommendationApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/GenerateReportApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/GenerateReportApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/GenerateRunwayApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/GenerateRunwayApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/GetScenarioApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/GetScenarioApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/GetScenarioReportApiResponse.d.ts +98 -0
- package/dist/es/models/aiops/v4/config/GetScenarioReportApiResponse.js +342 -0
- package/dist/es/models/aiops/v4/config/GetSimulationApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/GetSimulationApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/HardwareModel.d.ts +144 -0
- package/dist/es/models/aiops/v4/config/HardwareModel.js +550 -0
- package/dist/es/models/aiops/v4/config/HardwarePart.d.ts +92 -0
- package/dist/es/models/aiops/v4/config/HardwarePart.js +363 -0
- package/dist/es/models/aiops/v4/config/IgnoreWindow.d.ts +111 -0
- package/dist/es/models/aiops/v4/config/IgnoreWindow.js +458 -0
- package/dist/es/models/aiops/v4/config/IgnoreWindowProjection.d.ts +20 -0
- package/dist/es/models/aiops/v4/config/IgnoreWindowProjection.js +173 -0
- package/dist/es/models/aiops/v4/config/ListScenariosApiResponse.d.ts +100 -0
- package/dist/es/models/aiops/v4/config/ListScenariosApiResponse.js +370 -0
- package/dist/es/models/aiops/v4/config/ListSimulationsApiResponse.d.ts +100 -0
- package/dist/es/models/aiops/v4/config/ListSimulationsApiResponse.js +370 -0
- package/dist/es/models/aiops/v4/config/MetricDescriptor.d.ts +182 -0
- package/dist/es/models/aiops/v4/config/MetricDescriptor.js +667 -0
- package/dist/es/models/aiops/v4/config/MicrosoftXenProvisionType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/MicrosoftXenProvisionType.js +79 -0
- package/dist/es/models/aiops/v4/config/MicrosoftXenWorkload.d.ts +83 -0
- package/dist/es/models/aiops/v4/config/MicrosoftXenWorkload.js +371 -0
- package/dist/es/models/aiops/v4/config/MicrosoftXenWorkloadVendor.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/MicrosoftXenWorkloadVendor.js +79 -0
- package/dist/es/models/aiops/v4/config/NodeConfig.d.ts +143 -0
- package/dist/es/models/aiops/v4/config/NodeConfig.js +490 -0
- package/dist/es/models/aiops/v4/config/NodeSource.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/NodeSource.js +91 -0
- package/dist/es/models/aiops/v4/config/PolicyType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/PolicyType.js +85 -0
- package/dist/es/models/aiops/v4/config/ReplicationFactor.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/ReplicationFactor.js +85 -0
- package/dist/es/models/aiops/v4/config/ResourceCapacity.d.ts +126 -0
- package/dist/es/models/aiops/v4/config/ResourceCapacity.js +451 -0
- package/dist/es/models/aiops/v4/config/Runway.d.ts +134 -0
- package/dist/es/models/aiops/v4/config/Runway.js +484 -0
- package/dist/es/models/aiops/v4/config/RunwayParams.d.ts +77 -0
- package/dist/es/models/aiops/v4/config/RunwayParams.js +323 -0
- package/dist/es/models/aiops/v4/config/RunwayParamsProjection.d.ts +14 -0
- package/dist/es/models/aiops/v4/config/RunwayParamsProjection.js +159 -0
- package/dist/es/models/aiops/v4/config/Scenario.d.ts +178 -0
- package/dist/es/models/aiops/v4/config/Scenario.js +579 -0
- package/dist/es/models/aiops/v4/config/ScenarioProjection.d.ts +10 -0
- package/dist/es/models/aiops/v4/config/ScenarioProjection.js +156 -0
- package/dist/es/models/aiops/v4/config/SimulatedVmResourceSpec.d.ts +106 -0
- package/dist/es/models/aiops/v4/config/SimulatedVmResourceSpec.js +403 -0
- package/dist/es/models/aiops/v4/config/SimulatedVmResourceSpecProjection.d.ts +16 -0
- package/dist/es/models/aiops/v4/config/SimulatedVmResourceSpecProjection.js +162 -0
- package/dist/es/models/aiops/v4/config/Simulation.d.ts +56 -0
- package/dist/es/models/aiops/v4/config/Simulation.js +317 -0
- package/dist/es/models/aiops/v4/config/SimulationProjection.d.ts +10 -0
- package/dist/es/models/aiops/v4/config/SimulationProjection.js +153 -0
- package/dist/es/models/aiops/v4/config/Source.d.ts +37 -0
- package/dist/es/models/aiops/v4/config/Source.js +275 -0
- package/dist/es/models/aiops/v4/config/SourceListApiResponse.d.ts +106 -0
- package/dist/es/models/aiops/v4/config/SourceListApiResponse.js +365 -0
- package/dist/es/models/aiops/v4/config/SplunkWorkload.d.ts +118 -0
- package/dist/es/models/aiops/v4/config/SplunkWorkload.js +446 -0
- package/dist/es/models/aiops/v4/config/SqlProfileType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/SqlProfileType.js +91 -0
- package/dist/es/models/aiops/v4/config/SqlTransactionType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/SqlTransactionType.js +85 -0
- package/dist/es/models/aiops/v4/config/SqlWorkload.d.ts +110 -0
- package/dist/es/models/aiops/v4/config/SqlWorkload.js +415 -0
- package/dist/es/models/aiops/v4/config/UpdateScenarioApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/UpdateScenarioApiResponse.js +343 -0
- package/dist/es/models/aiops/v4/config/UpdateSimulationApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/config/UpdateSimulationApiResponse.js +365 -0
- package/dist/es/models/aiops/v4/config/ValueRange.d.ts +64 -0
- package/dist/es/models/aiops/v4/config/ValueRange.js +312 -0
- package/dist/{lib/models/aiops/v4/blackout/Operation.d.ts → es/models/aiops/v4/config/ValueType.d.ts} +6 -6
- package/dist/es/models/aiops/v4/config/ValueType.js +121 -0
- package/dist/es/models/aiops/v4/config/VdiProvisionType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/VdiProvisionType.js +103 -0
- package/dist/es/models/aiops/v4/config/VdiUserType.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/VdiUserType.js +97 -0
- package/dist/es/models/aiops/v4/{blackout/Operation.d.ts → config/VdiVendor.d.ts} +6 -6
- package/dist/es/models/aiops/v4/config/VdiVendor.js +85 -0
- package/dist/es/models/aiops/v4/config/VdiWorkload.d.ts +109 -0
- package/dist/es/models/aiops/v4/config/VdiWorkload.js +412 -0
- package/dist/es/models/aiops/v4/config/Vendor.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/Vendor.js +127 -0
- package/dist/es/models/aiops/v4/config/VmCategoryWorkload.d.ts +94 -0
- package/dist/es/models/aiops/v4/config/VmCategoryWorkload.js +370 -0
- package/dist/es/models/aiops/v4/config/VmWorkload.d.ts +80 -0
- package/dist/es/models/aiops/v4/config/VmWorkload.js +335 -0
- package/dist/es/models/aiops/v4/config/Workload.d.ts +122 -0
- package/dist/es/models/aiops/v4/config/Workload.js +447 -0
- package/dist/es/models/aiops/v4/config/XenOperatingSystem.d.ts +19 -0
- package/dist/es/models/aiops/v4/config/XenOperatingSystem.js +85 -0
- package/dist/es/models/aiops/v4/config/XenWorkload.d.ts +151 -0
- package/dist/es/models/aiops/v4/config/XenWorkload.js +532 -0
- package/dist/es/models/aiops/v4/config/XfitPolicy.d.ts +161 -0
- package/dist/es/models/aiops/v4/config/XfitPolicy.js +589 -0
- package/dist/es/models/aiops/v4/config/XfitPolicyProjection.d.ts +16 -0
- package/dist/es/models/aiops/v4/config/XfitPolicyProjection.js +167 -0
- package/dist/es/models/aiops/v4/error/AppMessage.d.ts +69 -51
- package/dist/es/models/aiops/v4/error/AppMessage.js +122 -37
- package/dist/es/models/aiops/v4/error/ErrorResponse.d.ts +25 -22
- package/dist/es/models/aiops/v4/error/ErrorResponse.js +149 -63
- package/dist/es/models/aiops/v4/error/SchemaValidationError.d.ts +65 -44
- package/dist/es/models/aiops/v4/error/SchemaValidationError.js +120 -32
- package/dist/es/models/aiops/v4/error/SchemaValidationErrorMessage.d.ts +42 -33
- package/dist/es/models/aiops/v4/error/SchemaValidationErrorMessage.js +106 -25
- package/dist/es/models/aiops/v4/stats/BoolList.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/BoolList.js +288 -0
- package/dist/es/models/aiops/v4/stats/BoolVal.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/BoolVal.js +280 -0
- package/dist/es/models/aiops/v4/stats/DoubleList.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/DoubleList.js +288 -0
- package/dist/es/models/aiops/v4/stats/DoubleVal.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/DoubleVal.js +280 -0
- package/dist/es/models/aiops/v4/stats/Entity.d.ts +57 -0
- package/dist/es/models/aiops/v4/stats/Entity.js +413 -0
- package/dist/es/models/aiops/v4/stats/EntityListApiResponse.d.ts +99 -0
- package/dist/es/models/aiops/v4/stats/EntityListApiResponse.js +365 -0
- package/dist/es/models/aiops/v4/stats/IntList.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/IntList.js +288 -0
- package/dist/es/models/aiops/v4/stats/IntVal.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/IntVal.js +280 -0
- package/dist/es/models/aiops/v4/stats/Metric.d.ts +75 -0
- package/dist/es/models/aiops/v4/stats/Metric.js +312 -0
- package/dist/es/models/aiops/v4/stats/Point.d.ts +72 -0
- package/dist/es/models/aiops/v4/stats/Point.js +356 -0
- package/dist/es/models/aiops/v4/stats/ScenarioStats.d.ts +79 -0
- package/dist/es/models/aiops/v4/stats/ScenarioStats.js +323 -0
- package/dist/es/models/aiops/v4/stats/ScenarioStatsProjection.d.ts +10 -0
- package/dist/es/models/aiops/v4/stats/ScenarioStatsProjection.js +151 -0
- package/dist/es/models/aiops/v4/stats/ScenarioStatsTuple.d.ts +160 -0
- package/dist/es/models/aiops/v4/stats/ScenarioStatsTuple.js +617 -0
- package/dist/es/models/aiops/v4/stats/StrList.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/StrList.js +288 -0
- package/dist/es/models/aiops/v4/stats/StrVal.d.ts +61 -0
- package/dist/es/models/aiops/v4/stats/StrVal.js +280 -0
- package/dist/es/models/aiops/v4/stats/TimeSeries.d.ts +71 -0
- package/dist/es/models/aiops/v4/stats/TimeSeries.js +326 -0
- package/dist/es/models/common/v1/config/Flag.d.ts +34 -27
- package/dist/es/models/common/v1/config/Flag.js +107 -23
- package/dist/es/models/common/v1/config/IPv4Address.d.ts +42 -27
- package/dist/es/models/common/v1/config/IPv4Address.js +106 -25
- package/dist/es/models/common/v1/config/KVPair.d.ts +37 -29
- package/dist/es/models/common/v1/config/KVPair.js +161 -54
- package/dist/es/models/common/v1/config/KVStringPair.d.ts +64 -0
- package/dist/es/models/common/v1/config/KVStringPair.js +318 -0
- package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +58 -0
- package/dist/es/models/common/v1/config/MapOfStringWrapper.js +275 -0
- package/dist/es/models/common/v1/config/Message.d.ts +45 -39
- package/dist/es/models/common/v1/config/Message.js +102 -27
- package/dist/es/models/common/v1/config/MessageSeverity.js +15 -16
- package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +26 -23
- package/dist/es/models/common/v1/config/TenantAwareModel.js +96 -24
- package/dist/es/models/common/v1/response/ApiLink.d.ts +34 -31
- package/dist/es/models/common/v1/response/ApiLink.js +102 -30
- package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +89 -45
- package/dist/es/models/common/v1/response/ApiResponseMetadata.js +130 -34
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +27 -20
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +121 -46
- package/dist/es/models/common/v1/stats/DownSamplingOperator.d.ts +19 -0
- package/dist/es/models/common/v1/stats/DownSamplingOperator.js +109 -0
- package/dist/es/models/prism/v4/config/TaskReference.d.ts +26 -23
- package/dist/es/models/prism/v4/config/TaskReference.js +102 -26
- package/dist/es/models/validation/ValidationError.js +12 -14
- package/dist/es/models/validation/ValidationScopes.js +1 -2
- package/dist/es/utils/ValidationUtils.js +12 -14
- package/dist/lib/ApiClient.d.ts +20 -6
- package/dist/lib/ApiClient.js +496 -214
- package/dist/lib/Paginable.d.ts +1 -1
- package/dist/lib/Paginable.js +23 -14
- package/dist/lib/apis/scenarios-endpoints.d.ts +181 -0
- package/dist/lib/apis/scenarios-endpoints.js +641 -0
- package/dist/lib/apis/stats-endpoints.d.ts +93 -0
- package/dist/lib/apis/stats-endpoints.js +264 -0
- package/dist/lib/index.d.ts +191 -25
- package/dist/lib/index.js +719 -56
- package/dist/lib/models/aiops/v4/capacityplanning/CapacityDetails.d.ts +109 -0
- package/dist/lib/models/aiops/v4/capacityplanning/CapacityDetails.js +459 -0
- package/dist/lib/models/aiops/v4/capacityplanning/CapacityUnit.d.ts +19 -0
- package/dist/lib/models/aiops/v4/capacityplanning/CapacityUnit.js +85 -0
- package/dist/lib/models/aiops/v4/capacityplanning/Runway.d.ts +86 -0
- package/dist/lib/models/aiops/v4/capacityplanning/Runway.js +340 -0
- package/dist/lib/models/aiops/v4/capacityplanning/RunwayDuration.d.ts +19 -0
- package/dist/lib/models/aiops/v4/capacityplanning/RunwayDuration.js +91 -0
- package/dist/lib/models/aiops/v4/clusterMetrics/Cluster.d.ts +90 -87
- package/dist/lib/models/aiops/v4/clusterMetrics/Cluster.js +115 -43
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterMetrics.d.ts +171 -152
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterMetrics.js +168 -87
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterProjection.d.ts +49 -29
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterProjection.js +181 -40
- package/dist/lib/models/aiops/v4/clusterMetrics/Node.d.ts +48 -45
- package/dist/lib/models/aiops/v4/clusterMetrics/Node.js +101 -29
- package/dist/lib/models/aiops/v4/clusterMetrics/NodeProjection.d.ts +2 -1
- package/dist/lib/models/aiops/v4/clusterMetrics/NodeProjection.js +59 -30
- package/dist/lib/models/aiops/v4/clusterMetrics/Vm.d.ts +48 -45
- package/dist/lib/models/aiops/v4/clusterMetrics/Vm.js +101 -29
- package/dist/lib/models/aiops/v4/clusterMetrics/VmProjection.d.ts +2 -1
- package/dist/lib/models/aiops/v4/clusterMetrics/VmProjection.js +59 -30
- package/dist/lib/models/aiops/v4/common/ClusterType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/common/ClusterType.js +79 -0
- package/dist/lib/models/aiops/v4/config/CapacityUnit.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/CapacityUnit.js +85 -0
- package/dist/lib/models/aiops/v4/config/CapacityUpdateConfig.d.ts +77 -0
- package/dist/lib/models/aiops/v4/config/CapacityUpdateConfig.js +322 -0
- package/dist/lib/models/aiops/v4/config/CapacityUpdateType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/CapacityUpdateType.js +85 -0
- package/dist/lib/models/aiops/v4/config/CategoryDetail.d.ts +60 -0
- package/dist/lib/models/aiops/v4/config/CategoryDetail.js +315 -0
- package/dist/lib/models/aiops/v4/config/CitrixXenProvisionType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/CitrixXenProvisionType.js +85 -0
- package/dist/lib/models/aiops/v4/config/CitrixXenWorkload.d.ts +83 -0
- package/dist/lib/models/aiops/v4/config/CitrixXenWorkload.js +371 -0
- package/dist/lib/models/aiops/v4/config/CitrixXenWorkloadVendor.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/CitrixXenWorkloadVendor.js +79 -0
- package/dist/lib/models/aiops/v4/config/ClusterConfig.d.ts +107 -0
- package/dist/lib/models/aiops/v4/config/ClusterConfig.js +329 -0
- package/dist/lib/models/aiops/v4/config/CreateScenarioApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/CreateScenarioApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/CreateSimulationApiResponse.d.ts +102 -0
- package/dist/lib/models/aiops/v4/config/CreateSimulationApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/DataStoreConfig.d.ts +205 -0
- package/dist/lib/models/aiops/v4/config/DataStoreConfig.js +673 -0
- package/dist/lib/models/aiops/v4/config/DeleteScenarioApiResponse.d.ts +98 -0
- package/dist/lib/models/aiops/v4/config/DeleteScenarioApiResponse.js +345 -0
- package/dist/lib/models/aiops/v4/config/DeleteSimulationApiResponse.d.ts +98 -0
- package/dist/lib/models/aiops/v4/config/DeleteSimulationApiResponse.js +345 -0
- package/dist/lib/models/aiops/v4/config/EntityDescriptor.d.ts +68 -0
- package/dist/lib/models/aiops/v4/config/EntityDescriptor.js +454 -0
- package/dist/lib/models/aiops/v4/config/EntityDescriptorListApiResponse.d.ts +101 -0
- package/dist/lib/models/aiops/v4/config/EntityDescriptorListApiResponse.js +365 -0
- package/dist/lib/models/aiops/v4/config/EntityType.d.ts +37 -0
- package/dist/lib/models/aiops/v4/config/EntityType.js +275 -0
- package/dist/lib/models/aiops/v4/config/EntityTypeListApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/EntityTypeListApiResponse.js +365 -0
- package/dist/lib/models/aiops/v4/config/GenerateRecommendationApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/GenerateRecommendationApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/GenerateReportApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/GenerateReportApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/GenerateRunwayApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/GenerateRunwayApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/GetScenarioApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/GetScenarioApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/GetScenarioReportApiResponse.d.ts +98 -0
- package/dist/lib/models/aiops/v4/config/GetScenarioReportApiResponse.js +342 -0
- package/dist/lib/models/aiops/v4/config/GetSimulationApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/GetSimulationApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/HardwareModel.d.ts +144 -0
- package/dist/lib/models/aiops/v4/config/HardwareModel.js +550 -0
- package/dist/lib/models/aiops/v4/config/HardwarePart.d.ts +92 -0
- package/dist/lib/models/aiops/v4/config/HardwarePart.js +363 -0
- package/dist/lib/models/aiops/v4/config/IgnoreWindow.d.ts +111 -0
- package/dist/lib/models/aiops/v4/config/IgnoreWindow.js +458 -0
- package/dist/lib/models/aiops/v4/config/IgnoreWindowProjection.d.ts +20 -0
- package/dist/lib/models/aiops/v4/config/IgnoreWindowProjection.js +173 -0
- package/dist/lib/models/aiops/v4/config/ListScenariosApiResponse.d.ts +100 -0
- package/dist/lib/models/aiops/v4/config/ListScenariosApiResponse.js +370 -0
- package/dist/lib/models/aiops/v4/config/ListSimulationsApiResponse.d.ts +100 -0
- package/dist/lib/models/aiops/v4/config/ListSimulationsApiResponse.js +370 -0
- package/dist/lib/models/aiops/v4/config/MetricDescriptor.d.ts +182 -0
- package/dist/lib/models/aiops/v4/config/MetricDescriptor.js +667 -0
- package/dist/lib/models/aiops/v4/config/MicrosoftXenProvisionType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/MicrosoftXenProvisionType.js +79 -0
- package/dist/lib/models/aiops/v4/config/MicrosoftXenWorkload.d.ts +83 -0
- package/dist/lib/models/aiops/v4/config/MicrosoftXenWorkload.js +371 -0
- package/dist/lib/models/aiops/v4/config/MicrosoftXenWorkloadVendor.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/MicrosoftXenWorkloadVendor.js +79 -0
- package/dist/lib/models/aiops/v4/config/NodeConfig.d.ts +143 -0
- package/dist/lib/models/aiops/v4/config/NodeConfig.js +490 -0
- package/dist/lib/models/aiops/v4/config/NodeSource.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/NodeSource.js +91 -0
- package/dist/lib/models/aiops/v4/config/PolicyType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/PolicyType.js +85 -0
- package/dist/lib/models/aiops/v4/config/ReplicationFactor.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/ReplicationFactor.js +85 -0
- package/dist/lib/models/aiops/v4/config/ResourceCapacity.d.ts +126 -0
- package/dist/lib/models/aiops/v4/config/ResourceCapacity.js +451 -0
- package/dist/lib/models/aiops/v4/config/Runway.d.ts +134 -0
- package/dist/lib/models/aiops/v4/config/Runway.js +484 -0
- package/dist/lib/models/aiops/v4/config/RunwayParams.d.ts +77 -0
- package/dist/lib/models/aiops/v4/config/RunwayParams.js +323 -0
- package/dist/lib/models/aiops/v4/config/RunwayParamsProjection.d.ts +14 -0
- package/dist/lib/models/aiops/v4/config/RunwayParamsProjection.js +159 -0
- package/dist/lib/models/aiops/v4/config/Scenario.d.ts +178 -0
- package/dist/lib/models/aiops/v4/config/Scenario.js +579 -0
- package/dist/lib/models/aiops/v4/config/ScenarioProjection.d.ts +10 -0
- package/dist/lib/models/aiops/v4/config/ScenarioProjection.js +156 -0
- package/dist/lib/models/aiops/v4/config/SimulatedVmResourceSpec.d.ts +106 -0
- package/dist/lib/models/aiops/v4/config/SimulatedVmResourceSpec.js +403 -0
- package/dist/lib/models/aiops/v4/config/SimulatedVmResourceSpecProjection.d.ts +16 -0
- package/dist/lib/models/aiops/v4/config/SimulatedVmResourceSpecProjection.js +162 -0
- package/dist/lib/models/aiops/v4/config/Simulation.d.ts +56 -0
- package/dist/lib/models/aiops/v4/config/Simulation.js +317 -0
- package/dist/lib/models/aiops/v4/config/SimulationProjection.d.ts +10 -0
- package/dist/lib/models/aiops/v4/config/SimulationProjection.js +153 -0
- package/dist/lib/models/aiops/v4/config/Source.d.ts +37 -0
- package/dist/lib/models/aiops/v4/config/Source.js +275 -0
- package/dist/lib/models/aiops/v4/config/SourceListApiResponse.d.ts +106 -0
- package/dist/lib/models/aiops/v4/config/SourceListApiResponse.js +365 -0
- package/dist/lib/models/aiops/v4/config/SplunkWorkload.d.ts +118 -0
- package/dist/lib/models/aiops/v4/config/SplunkWorkload.js +446 -0
- package/dist/lib/models/aiops/v4/config/SqlProfileType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/SqlProfileType.js +91 -0
- package/dist/lib/models/aiops/v4/config/SqlTransactionType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/SqlTransactionType.js +85 -0
- package/dist/lib/models/aiops/v4/config/SqlWorkload.d.ts +110 -0
- package/dist/lib/models/aiops/v4/config/SqlWorkload.js +415 -0
- package/dist/lib/models/aiops/v4/config/UpdateScenarioApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/UpdateScenarioApiResponse.js +343 -0
- package/dist/lib/models/aiops/v4/config/UpdateSimulationApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/config/UpdateSimulationApiResponse.js +365 -0
- package/dist/lib/models/aiops/v4/config/ValueRange.d.ts +64 -0
- package/dist/lib/models/aiops/v4/config/ValueRange.js +312 -0
- package/dist/lib/models/aiops/v4/config/ValueType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/ValueType.js +121 -0
- package/dist/lib/models/aiops/v4/config/VdiProvisionType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/VdiProvisionType.js +103 -0
- package/dist/lib/models/aiops/v4/config/VdiUserType.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/VdiUserType.js +97 -0
- package/dist/lib/models/aiops/v4/config/VdiVendor.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/VdiVendor.js +85 -0
- package/dist/lib/models/aiops/v4/config/VdiWorkload.d.ts +109 -0
- package/dist/lib/models/aiops/v4/config/VdiWorkload.js +412 -0
- package/dist/lib/models/aiops/v4/config/Vendor.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/Vendor.js +127 -0
- package/dist/lib/models/aiops/v4/config/VmCategoryWorkload.d.ts +94 -0
- package/dist/lib/models/aiops/v4/config/VmCategoryWorkload.js +370 -0
- package/dist/lib/models/aiops/v4/config/VmWorkload.d.ts +80 -0
- package/dist/lib/models/aiops/v4/config/VmWorkload.js +335 -0
- package/dist/lib/models/aiops/v4/config/Workload.d.ts +122 -0
- package/dist/lib/models/aiops/v4/config/Workload.js +447 -0
- package/dist/lib/models/aiops/v4/config/XenOperatingSystem.d.ts +19 -0
- package/dist/lib/models/aiops/v4/config/XenOperatingSystem.js +85 -0
- package/dist/lib/models/aiops/v4/config/XenWorkload.d.ts +151 -0
- package/dist/lib/models/aiops/v4/config/XenWorkload.js +532 -0
- package/dist/lib/models/aiops/v4/config/XfitPolicy.d.ts +161 -0
- package/dist/lib/models/aiops/v4/config/XfitPolicy.js +589 -0
- package/dist/lib/models/aiops/v4/config/XfitPolicyProjection.d.ts +16 -0
- package/dist/lib/models/aiops/v4/config/XfitPolicyProjection.js +167 -0
- package/dist/lib/models/aiops/v4/error/AppMessage.d.ts +69 -51
- package/dist/lib/models/aiops/v4/error/AppMessage.js +122 -37
- package/dist/lib/models/aiops/v4/error/ErrorResponse.d.ts +25 -22
- package/dist/lib/models/aiops/v4/error/ErrorResponse.js +149 -63
- package/dist/lib/models/aiops/v4/error/SchemaValidationError.d.ts +65 -44
- package/dist/lib/models/aiops/v4/error/SchemaValidationError.js +120 -32
- package/dist/lib/models/aiops/v4/error/SchemaValidationErrorMessage.d.ts +42 -33
- package/dist/lib/models/aiops/v4/error/SchemaValidationErrorMessage.js +106 -25
- package/dist/lib/models/aiops/v4/stats/BoolList.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/BoolList.js +288 -0
- package/dist/lib/models/aiops/v4/stats/BoolVal.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/BoolVal.js +280 -0
- package/dist/lib/models/aiops/v4/stats/DoubleList.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/DoubleList.js +288 -0
- package/dist/lib/models/aiops/v4/stats/DoubleVal.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/DoubleVal.js +280 -0
- package/dist/lib/models/aiops/v4/stats/Entity.d.ts +57 -0
- package/dist/lib/models/aiops/v4/stats/Entity.js +413 -0
- package/dist/lib/models/aiops/v4/stats/EntityListApiResponse.d.ts +99 -0
- package/dist/lib/models/aiops/v4/stats/EntityListApiResponse.js +365 -0
- package/dist/lib/models/aiops/v4/stats/IntList.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/IntList.js +288 -0
- package/dist/lib/models/aiops/v4/stats/IntVal.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/IntVal.js +280 -0
- package/dist/lib/models/aiops/v4/stats/Metric.d.ts +75 -0
- package/dist/lib/models/aiops/v4/stats/Metric.js +312 -0
- package/dist/lib/models/aiops/v4/stats/Point.d.ts +72 -0
- package/dist/lib/models/aiops/v4/stats/Point.js +356 -0
- package/dist/lib/models/aiops/v4/stats/ScenarioStats.d.ts +79 -0
- package/dist/lib/models/aiops/v4/stats/ScenarioStats.js +323 -0
- package/dist/lib/models/aiops/v4/stats/ScenarioStatsProjection.d.ts +10 -0
- package/dist/lib/models/aiops/v4/stats/ScenarioStatsProjection.js +151 -0
- package/dist/lib/models/aiops/v4/stats/ScenarioStatsTuple.d.ts +160 -0
- package/dist/lib/models/aiops/v4/stats/ScenarioStatsTuple.js +617 -0
- package/dist/lib/models/aiops/v4/stats/StrList.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/StrList.js +288 -0
- package/dist/lib/models/aiops/v4/stats/StrVal.d.ts +61 -0
- package/dist/lib/models/aiops/v4/stats/StrVal.js +280 -0
- package/dist/lib/models/aiops/v4/stats/TimeSeries.d.ts +71 -0
- package/dist/lib/models/aiops/v4/stats/TimeSeries.js +326 -0
- package/dist/lib/models/common/v1/config/Flag.d.ts +34 -27
- package/dist/lib/models/common/v1/config/Flag.js +107 -23
- package/dist/lib/models/common/v1/config/IPv4Address.d.ts +42 -27
- package/dist/lib/models/common/v1/config/IPv4Address.js +106 -25
- package/dist/lib/models/common/v1/config/KVPair.d.ts +37 -29
- package/dist/lib/models/common/v1/config/KVPair.js +161 -54
- package/dist/lib/models/common/v1/config/KVStringPair.d.ts +64 -0
- package/dist/lib/models/common/v1/config/KVStringPair.js +318 -0
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +58 -0
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +275 -0
- package/dist/lib/models/common/v1/config/Message.d.ts +45 -39
- package/dist/lib/models/common/v1/config/Message.js +102 -27
- package/dist/lib/models/common/v1/config/MessageSeverity.js +15 -16
- package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +26 -23
- package/dist/lib/models/common/v1/config/TenantAwareModel.js +96 -24
- package/dist/lib/models/common/v1/response/ApiLink.d.ts +34 -31
- package/dist/lib/models/common/v1/response/ApiLink.js +102 -30
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +89 -45
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +130 -34
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +27 -20
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +121 -46
- package/dist/lib/models/common/v1/stats/DownSamplingOperator.d.ts +19 -0
- package/dist/lib/models/common/v1/stats/DownSamplingOperator.js +109 -0
- package/dist/lib/models/prism/v4/config/TaskReference.d.ts +26 -23
- package/dist/lib/models/prism/v4/config/TaskReference.js +102 -26
- package/dist/lib/models/validation/ValidationError.js +12 -14
- package/dist/lib/models/validation/ValidationScopes.js +1 -2
- package/dist/lib/utils/ValidationUtils.js +12 -14
- package/package.json +6 -5
- package/dist/es/apis/cluster-endpoints.d.ts +0 -48
- package/dist/es/apis/cluster-endpoints.js +0 -127
- package/dist/es/models/aiops/v4/blackout/BlackoutOperation.d.ts +0 -39
- package/dist/es/models/aiops/v4/blackout/BlackoutOperation.js +0 -223
- package/dist/es/models/aiops/v4/blackout/BlackoutOperationsApiResponse.d.ts +0 -60
- package/dist/es/models/aiops/v4/blackout/BlackoutOperationsApiResponse.js +0 -292
- package/dist/es/models/aiops/v4/blackout/BlackoutPeriod.d.ts +0 -117
- package/dist/es/models/aiops/v4/blackout/BlackoutPeriod.js +0 -438
- package/dist/es/models/aiops/v4/blackout/BulkBlackoutPeriodDeleteApiResponse.d.ts +0 -60
- package/dist/es/models/aiops/v4/blackout/BulkBlackoutPeriodDeleteApiResponse.js +0 -283
- package/dist/es/models/aiops/v4/blackout/CalculateRunway.d.ts +0 -41
- package/dist/es/models/aiops/v4/blackout/CalculateRunway.js +0 -225
- package/dist/es/models/aiops/v4/blackout/CalculateRunwayResponse.d.ts +0 -60
- package/dist/es/models/aiops/v4/blackout/CalculateRunwayResponse.js +0 -284
- package/dist/es/models/aiops/v4/blackout/ClusterEntity.js +0 -86
- package/dist/es/models/aiops/v4/blackout/Operation.js +0 -86
- package/dist/es/models/aiops/v4/blackout/TasksListResponse.d.ts +0 -60
- package/dist/es/models/aiops/v4/blackout/TasksListResponse.js +0 -290
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterApiResponse.d.ts +0 -60
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterApiResponse.js +0 -284
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterListApiResponse.d.ts +0 -60
- package/dist/es/models/aiops/v4/clusterMetrics/ClusterListApiResponse.js +0 -292
- package/dist/lib/apis/cluster-endpoints.d.ts +0 -48
- package/dist/lib/apis/cluster-endpoints.js +0 -127
- package/dist/lib/models/aiops/v4/blackout/BlackoutOperation.d.ts +0 -39
- package/dist/lib/models/aiops/v4/blackout/BlackoutOperation.js +0 -223
- package/dist/lib/models/aiops/v4/blackout/BlackoutOperationsApiResponse.d.ts +0 -60
- package/dist/lib/models/aiops/v4/blackout/BlackoutOperationsApiResponse.js +0 -292
- package/dist/lib/models/aiops/v4/blackout/BlackoutPeriod.d.ts +0 -117
- package/dist/lib/models/aiops/v4/blackout/BlackoutPeriod.js +0 -438
- package/dist/lib/models/aiops/v4/blackout/BulkBlackoutPeriodDeleteApiResponse.d.ts +0 -60
- package/dist/lib/models/aiops/v4/blackout/BulkBlackoutPeriodDeleteApiResponse.js +0 -283
- package/dist/lib/models/aiops/v4/blackout/CalculateRunway.d.ts +0 -41
- package/dist/lib/models/aiops/v4/blackout/CalculateRunway.js +0 -225
- package/dist/lib/models/aiops/v4/blackout/CalculateRunwayResponse.d.ts +0 -60
- package/dist/lib/models/aiops/v4/blackout/CalculateRunwayResponse.js +0 -284
- package/dist/lib/models/aiops/v4/blackout/ClusterEntity.js +0 -86
- package/dist/lib/models/aiops/v4/blackout/Operation.js +0 -86
- package/dist/lib/models/aiops/v4/blackout/TasksListResponse.d.ts +0 -60
- package/dist/lib/models/aiops/v4/blackout/TasksListResponse.js +0 -290
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterApiResponse.d.ts +0 -60
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterApiResponse.js +0 -284
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterListApiResponse.d.ts +0 -60
- package/dist/lib/models/aiops/v4/clusterMetrics/ClusterListApiResponse.js +0 -292
package/dist/es/ApiClient.js
CHANGED
|
@@ -10,26 +10,52 @@ var _uuid = require("uuid");
|
|
|
10
10
|
var _superagentRetryDelay = _interopRequireDefault(require("superagent-retry-delay"));
|
|
11
11
|
var _https = _interopRequireDefault(require("https"));
|
|
12
12
|
var _fs2 = _interopRequireDefault(require("fs"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
function
|
|
23
|
-
function
|
|
24
|
-
function
|
|
25
|
-
function
|
|
26
|
-
function
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
function
|
|
13
|
+
var _path = _interopRequireDefault(require("path"));
|
|
14
|
+
var _buffer = require("buffer");
|
|
15
|
+
var _ApiResponseMetadata = _interopRequireDefault(require("./models/common/v1/response/ApiResponseMetadata"));
|
|
16
|
+
var _Flag = _interopRequireDefault(require("./models/common/v1/config/Flag"));
|
|
17
|
+
var _ApiClient;
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) { if ("" === t) return e; var p = o[r]; return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : ""; })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
20
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
21
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
26
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
27
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
28
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
29
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
30
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
31
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
32
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
33
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
34
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
35
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
36
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
37
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
38
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
39
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
|
|
40
|
+
* Nutanix AIOps APIs
|
|
41
|
+
*
|
|
42
|
+
* OpenAPI spec version: 4.0.2
|
|
43
|
+
*
|
|
44
|
+
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
45
|
+
*
|
|
46
|
+
* Open API Dev Platform Codegen version: 17.4.0.8851-RELEASE
|
|
47
|
+
*
|
|
48
|
+
* Do not edit the class manually.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
32
51
|
(0, _superagentRetryDelay["default"])(_superagent["default"]);
|
|
52
|
+
/**
|
|
53
|
+
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
|
|
54
|
+
* application to use this class directly - the *Api and model classes provide the public API for the service. The
|
|
55
|
+
* contents of this file should be regarded as internal but are documented for completeness.
|
|
56
|
+
* @module ApiClient
|
|
57
|
+
* @version 4.0.2
|
|
58
|
+
*/
|
|
33
59
|
var _protocol = /*#__PURE__*/new WeakMap();
|
|
34
60
|
var _cookie = /*#__PURE__*/new WeakMap();
|
|
35
61
|
var _logger = /*#__PURE__*/new WeakMap();
|
|
@@ -38,83 +64,36 @@ var _defaultConnectTimeout = /*#__PURE__*/new WeakMap();
|
|
|
38
64
|
var _defaultReadTimeout = /*#__PURE__*/new WeakMap();
|
|
39
65
|
var _defaultMaxTimeout = /*#__PURE__*/new WeakMap();
|
|
40
66
|
var _LOG_LEVEL = /*#__PURE__*/new WeakMap();
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var _isFileParam = /*#__PURE__*/new WeakSet();
|
|
44
|
-
var _normalizeParams = /*#__PURE__*/new WeakSet();
|
|
45
|
-
var _applyAuthToRequest = /*#__PURE__*/new WeakSet();
|
|
46
|
-
var _deserialize = /*#__PURE__*/new WeakSet();
|
|
47
|
-
var _paginateIfNeeded = /*#__PURE__*/new WeakSet();
|
|
48
|
-
var _getValidTimeout = /*#__PURE__*/new WeakSet();
|
|
49
|
-
var _updateCookies = /*#__PURE__*/new WeakSet();
|
|
50
|
-
var _attachCookies = /*#__PURE__*/new WeakSet();
|
|
51
|
-
var _log = /*#__PURE__*/new WeakSet();
|
|
52
|
-
var _skipLogging = /*#__PURE__*/new WeakSet();
|
|
53
|
-
var _getLocalDateTime = /*#__PURE__*/new WeakSet();
|
|
54
|
-
var _flatten = /*#__PURE__*/new WeakSet();
|
|
55
|
-
/**
|
|
56
|
-
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
|
|
57
|
-
* application to use this class directly - the *Api and model classes provide the public API for the service. The
|
|
58
|
-
* contents of this file should be regarded as internal but are documented for completeness.
|
|
59
|
-
* @module ApiClient
|
|
60
|
-
* @version 4.0.2-alpha-1
|
|
61
|
-
*/
|
|
62
|
-
var ApiClient = /*#__PURE__*/function () {
|
|
63
|
-
// PRIVATE VARIABLES
|
|
64
|
-
|
|
67
|
+
var _ApiClient_brand = /*#__PURE__*/new WeakSet();
|
|
68
|
+
var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
|
|
65
69
|
/**
|
|
66
70
|
* @alias module:ApiClient
|
|
67
71
|
* @class
|
|
68
72
|
*/
|
|
69
73
|
function ApiClient() {
|
|
70
74
|
_classCallCheck(this, ApiClient);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
_classPrivateMethodInitSpec(this,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
_classPrivateFieldInitSpec(this,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
_classPrivateFieldInitSpec(this,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_classPrivateFieldInitSpec(this, _logger, {
|
|
94
|
-
writable: true,
|
|
95
|
-
value: void 0
|
|
96
|
-
});
|
|
97
|
-
_classPrivateFieldInitSpec(this, _verifySslFlag, {
|
|
98
|
-
writable: true,
|
|
99
|
-
value: void 0
|
|
100
|
-
});
|
|
101
|
-
_classPrivateFieldInitSpec(this, _defaultConnectTimeout, {
|
|
102
|
-
writable: true,
|
|
103
|
-
value: void 0
|
|
104
|
-
});
|
|
105
|
-
_classPrivateFieldInitSpec(this, _defaultReadTimeout, {
|
|
106
|
-
writable: true,
|
|
107
|
-
value: void 0
|
|
108
|
-
});
|
|
109
|
-
_classPrivateFieldInitSpec(this, _defaultMaxTimeout, {
|
|
110
|
-
writable: true,
|
|
111
|
-
value: void 0
|
|
112
|
-
});
|
|
113
|
-
_classPrivateFieldInitSpec(this, _LOG_LEVEL, {
|
|
114
|
-
writable: true,
|
|
115
|
-
value: void 0
|
|
116
|
-
});
|
|
117
|
-
_classPrivateFieldSet(this, _LOG_LEVEL, Object.freeze({
|
|
75
|
+
/*
|
|
76
|
+
* Checks whether the given content type represents JSON.<br>
|
|
77
|
+
* JSON content type examples:<br>
|
|
78
|
+
* <ul>
|
|
79
|
+
* <li>application/json</li>
|
|
80
|
+
* <li>application/json; charset=UTF8</li>
|
|
81
|
+
* <li>APPLICATION/JSON</li>
|
|
82
|
+
* </ul>
|
|
83
|
+
* @param {String} contentType The MIME content type to check.
|
|
84
|
+
* @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
|
|
85
|
+
*/
|
|
86
|
+
_classPrivateMethodInitSpec(this, _ApiClient_brand);
|
|
87
|
+
// PRIVATE VARIABLES
|
|
88
|
+
_classPrivateFieldInitSpec(this, _protocol, void 0);
|
|
89
|
+
_classPrivateFieldInitSpec(this, _cookie, void 0);
|
|
90
|
+
_classPrivateFieldInitSpec(this, _logger, void 0);
|
|
91
|
+
_classPrivateFieldInitSpec(this, _verifySslFlag, void 0);
|
|
92
|
+
_classPrivateFieldInitSpec(this, _defaultConnectTimeout, void 0);
|
|
93
|
+
_classPrivateFieldInitSpec(this, _defaultReadTimeout, void 0);
|
|
94
|
+
_classPrivateFieldInitSpec(this, _defaultMaxTimeout, void 0);
|
|
95
|
+
_classPrivateFieldInitSpec(this, _LOG_LEVEL, void 0);
|
|
96
|
+
_classPrivateFieldSet(_LOG_LEVEL, this, Object.freeze({
|
|
118
97
|
DEBUG: {
|
|
119
98
|
key: "DEBUG",
|
|
120
99
|
value: Symbol(0)
|
|
@@ -159,6 +138,11 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
159
138
|
* @type {Array.<String>}
|
|
160
139
|
*/
|
|
161
140
|
this.authentications = {
|
|
141
|
+
'apiKeyAuthScheme': {
|
|
142
|
+
type: 'apiKey',
|
|
143
|
+
'in': 'header',
|
|
144
|
+
name: 'X-ntnx-api-key'
|
|
145
|
+
},
|
|
162
146
|
'basicAuthScheme': {
|
|
163
147
|
type: 'basic'
|
|
164
148
|
}
|
|
@@ -170,23 +154,23 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
170
154
|
* @default {}
|
|
171
155
|
*/
|
|
172
156
|
this.defaultHeaders = {};
|
|
173
|
-
_classPrivateFieldSet(
|
|
174
|
-
_classPrivateFieldSet(
|
|
175
|
-
_classPrivateFieldSet(
|
|
157
|
+
_classPrivateFieldSet(_defaultConnectTimeout, this, 30000);
|
|
158
|
+
_classPrivateFieldSet(_defaultReadTimeout, this, 30000);
|
|
159
|
+
_classPrivateFieldSet(_defaultMaxTimeout, this, 10800000);
|
|
176
160
|
|
|
177
161
|
/**
|
|
178
162
|
* The default HTTP read timeout in milliseconds for all API calls.
|
|
179
163
|
* @type {Number}
|
|
180
164
|
* @default 30000
|
|
181
165
|
*/
|
|
182
|
-
this.readTimeout = _classPrivateFieldGet(
|
|
166
|
+
this.readTimeout = _classPrivateFieldGet(_defaultReadTimeout, this);
|
|
183
167
|
|
|
184
168
|
/**
|
|
185
169
|
* The default HTTP connection timeout in milliseconds for all API calls.
|
|
186
170
|
* @type {Number}
|
|
187
171
|
* @default 30000
|
|
188
172
|
*/
|
|
189
|
-
this.connectTimeout = _classPrivateFieldGet(
|
|
173
|
+
this.connectTimeout = _classPrivateFieldGet(_defaultConnectTimeout, this);
|
|
190
174
|
|
|
191
175
|
/**
|
|
192
176
|
* If set to false an additional timestamp parameter is added to all API GET calls to
|
|
@@ -200,7 +184,14 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
200
184
|
* Saved Cookies
|
|
201
185
|
* @default null
|
|
202
186
|
*/
|
|
203
|
-
_classPrivateFieldSet(
|
|
187
|
+
_classPrivateFieldSet(_cookie, this, null);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The maximum number of redirects to be followed for all API calls.
|
|
191
|
+
* @type {Number}
|
|
192
|
+
* @default 1
|
|
193
|
+
*/
|
|
194
|
+
this.maxRedirects = 1;
|
|
204
195
|
|
|
205
196
|
/**
|
|
206
197
|
* The maximum number of retry attempts to be made by the client
|
|
@@ -216,6 +207,13 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
216
207
|
* @default 3000
|
|
217
208
|
*/
|
|
218
209
|
this.retryInterval = 3000;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* A boolean value that indicates whether cross-site Access-Control requests should be made using auth credentials.
|
|
213
|
+
* @type {Boolean}
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
this.withCredentials = false;
|
|
219
217
|
if (typeof self === 'undefined') {
|
|
220
218
|
this.agent = new _superagent["default"].agent();
|
|
221
219
|
}
|
|
@@ -229,7 +227,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
229
227
|
* Allow SDK to print debug logs
|
|
230
228
|
*/
|
|
231
229
|
this.debug = false;
|
|
232
|
-
_classPrivateFieldSet(
|
|
230
|
+
_classPrivateFieldSet(_logger, this, null);
|
|
233
231
|
|
|
234
232
|
/**
|
|
235
233
|
* Username for basic auth
|
|
@@ -240,7 +238,13 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
240
238
|
* Password for basic auth
|
|
241
239
|
*/
|
|
242
240
|
this.password = null;
|
|
243
|
-
_classPrivateFieldSet(
|
|
241
|
+
_classPrivateFieldSet(_verifySslFlag, this, true);
|
|
242
|
+
|
|
243
|
+
/*
|
|
244
|
+
* Non Browser Environment : path to directory where downloaded files will be stored
|
|
245
|
+
* Browser Environment : WritableStream to pipe downloaded file to
|
|
246
|
+
*/
|
|
247
|
+
this.downloadDestination = null;
|
|
244
248
|
|
|
245
249
|
/*
|
|
246
250
|
* Log file to write activity logs
|
|
@@ -252,10 +256,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
252
256
|
* Enable/Disable SSL Verification
|
|
253
257
|
* @param verifySsl (boolean)
|
|
254
258
|
*/
|
|
255
|
-
_createClass(ApiClient, [{
|
|
259
|
+
return _createClass(ApiClient, [{
|
|
256
260
|
key: "verifySsl",
|
|
257
261
|
get: function get() {
|
|
258
|
-
return _classPrivateFieldGet(
|
|
262
|
+
return _classPrivateFieldGet(_verifySslFlag, this);
|
|
259
263
|
}
|
|
260
264
|
|
|
261
265
|
/**
|
|
@@ -270,7 +274,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
270
274
|
rejectUnauthorized: false
|
|
271
275
|
});
|
|
272
276
|
}
|
|
273
|
-
_classPrivateFieldSet(
|
|
277
|
+
_classPrivateFieldSet(_verifySslFlag, this, verifySsl);
|
|
274
278
|
}
|
|
275
279
|
}, {
|
|
276
280
|
key: "loggerFile",
|
|
@@ -281,7 +285,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
281
285
|
flags: 'a'
|
|
282
286
|
});
|
|
283
287
|
}
|
|
284
|
-
_classPrivateFieldSet(
|
|
288
|
+
_classPrivateFieldSet(_logger, this, new console.Console({
|
|
285
289
|
stdout: logfile,
|
|
286
290
|
stderr: logfile
|
|
287
291
|
}));
|
|
@@ -290,14 +294,14 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
290
294
|
|
|
291
295
|
/**
|
|
292
296
|
* Adds key value pair to default headers map, (to be added to every API call request)
|
|
293
|
-
* @param key The key
|
|
294
|
-
* @param value The corresponding value
|
|
297
|
+
* @param {String} key The key
|
|
298
|
+
* @param {String} value The corresponding value
|
|
295
299
|
*/
|
|
296
300
|
}, {
|
|
297
301
|
key: "addDefaultHeader",
|
|
298
302
|
value: function addDefaultHeader(key, value) {
|
|
299
303
|
if (key === "Authorization") {
|
|
300
|
-
_classPrivateFieldSet(
|
|
304
|
+
_classPrivateFieldSet(_cookie, this, null);
|
|
301
305
|
}
|
|
302
306
|
this.defaultHeaders[key] = value;
|
|
303
307
|
}
|
|
@@ -327,10 +331,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
327
331
|
}
|
|
328
332
|
|
|
329
333
|
// The protocol of the base URL, including the colon (:).
|
|
330
|
-
_classPrivateFieldSet(
|
|
334
|
+
_classPrivateFieldSet(_protocol, this, typeof self === 'undefined' ? this.scheme + ':' : self.location.protocol);
|
|
331
335
|
var basePath = ''; //default
|
|
332
|
-
if (_classPrivateFieldGet(
|
|
333
|
-
basePath = _classPrivateFieldGet(
|
|
336
|
+
if (_classPrivateFieldGet(_protocol, this) !== '' && this.host !== '' && this.port !== '') {
|
|
337
|
+
basePath = _classPrivateFieldGet(_protocol, this) + '\/\/' + this.host + ':' + this.port;
|
|
334
338
|
} else if (typeof self !== "undefined") {
|
|
335
339
|
basePath = self.origin;
|
|
336
340
|
}
|
|
@@ -346,18 +350,6 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
346
350
|
});
|
|
347
351
|
return url;
|
|
348
352
|
}
|
|
349
|
-
|
|
350
|
-
/*
|
|
351
|
-
* Checks whether the given content type represents JSON.<br>
|
|
352
|
-
* JSON content type examples:<br>
|
|
353
|
-
* <ul>
|
|
354
|
-
* <li>application/json</li>
|
|
355
|
-
* <li>application/json; charset=UTF8</li>
|
|
356
|
-
* <li>APPLICATION/JSON</li>
|
|
357
|
-
* </ul>
|
|
358
|
-
* @param {String} contentType The MIME content type to check.
|
|
359
|
-
* @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
|
|
360
|
-
*/
|
|
361
353
|
}, {
|
|
362
354
|
key: "buildCollectionParam",
|
|
363
355
|
value:
|
|
@@ -389,6 +381,21 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
389
381
|
}
|
|
390
382
|
}
|
|
391
383
|
|
|
384
|
+
/*
|
|
385
|
+
* Sets API key for authentication
|
|
386
|
+
*
|
|
387
|
+
* @param {String} key The API key for authentication
|
|
388
|
+
*/
|
|
389
|
+
}, {
|
|
390
|
+
key: "setApiKey",
|
|
391
|
+
value: function setApiKey(key) {
|
|
392
|
+
if (key == undefined || typeof key === 'string' || key instanceof String) {
|
|
393
|
+
this.authentications['apiKeyAuthScheme']['apiKey'] = key;
|
|
394
|
+
} else {
|
|
395
|
+
this.authentications['apiKeyAuthScheme']['apiKey'] = undefined;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
392
399
|
/*
|
|
393
400
|
* Applies authentication headers to the request.
|
|
394
401
|
* @param {Object} request The request object created by a <code>superagent()</code> call.
|
|
@@ -429,7 +436,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
429
436
|
* which can further be used in other HTTP operations.
|
|
430
437
|
*
|
|
431
438
|
* @param object Object from which ETag needs to be retrieved
|
|
432
|
-
* @returns returns ETag header in the object if it's an API response object, otherwise null
|
|
439
|
+
* @returns {(String|null)} returns ETag header in the object if it's an API response object, otherwise null
|
|
433
440
|
*/
|
|
434
441
|
}, {
|
|
435
442
|
key: "callApi",
|
|
@@ -460,31 +467,38 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
460
467
|
request.callback = function (err, res) {
|
|
461
468
|
if (res && res.status) {
|
|
462
469
|
var status = res.status;
|
|
463
|
-
if (status >= 400 && !(status === 401 || status === 408 || status === 503 || status === 504)) {
|
|
470
|
+
if (status >= 400 && !(status === 401 || status === 408 || status === 429 || status === 503 || status === 504)) {
|
|
464
471
|
this._maxRetries = 0;
|
|
465
472
|
}
|
|
466
473
|
if (res.status === 401) {
|
|
467
474
|
this.unset("Cookie");
|
|
468
475
|
this._maxRetries = 1;
|
|
469
476
|
}
|
|
477
|
+
if (status === 429) {
|
|
478
|
+
var retryAfter = res.headers['retry-after'];
|
|
479
|
+
if (retryAfter) {
|
|
480
|
+
var delay = parseInt(retryAfter, 10) * 1000;
|
|
481
|
+
this._retryDelays[this._retries] = delay;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
470
484
|
}
|
|
471
485
|
this.oldCallback(err, res);
|
|
472
486
|
};
|
|
473
487
|
|
|
474
488
|
// apply authentications
|
|
475
|
-
|
|
489
|
+
_assertClassBrand(_ApiClient_brand, this, _applyAuthToRequest).call(this, request, authNames);
|
|
476
490
|
|
|
477
491
|
// set query parameters
|
|
478
492
|
if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
|
|
479
493
|
queryParams['_'] = new Date().getTime();
|
|
480
494
|
}
|
|
481
|
-
request.query(
|
|
495
|
+
request.query(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, queryParams));
|
|
482
496
|
|
|
483
497
|
// set header parameters
|
|
484
|
-
request.set(this.defaultHeaders).set(
|
|
498
|
+
request.set(this.defaultHeaders).set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, headerParams));
|
|
485
499
|
if ((this.defaultHeaders['NTNX-Request-Id'] === null || this.defaultHeaders['NTNX-Request-Id'] === undefined) && (headerParams['NTNX-Request-Id'] === null || headerParams['NTNX-Request-Id'] === undefined)) {
|
|
486
500
|
var requestId = (0, _uuid.v4)();
|
|
487
|
-
request.set(
|
|
501
|
+
request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
|
|
488
502
|
'NTNX-Request-Id': requestId
|
|
489
503
|
}));
|
|
490
504
|
}
|
|
@@ -492,8 +506,9 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
492
506
|
// Set User-Agent header only if it is not a browser environment
|
|
493
507
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
494
508
|
if (!isBrowser) {
|
|
495
|
-
|
|
496
|
-
|
|
509
|
+
this.downloadDestination = '.';
|
|
510
|
+
request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
|
|
511
|
+
'User-Agent': 'Nutanix-aiops-js-client/4.0.2'
|
|
497
512
|
}));
|
|
498
513
|
}
|
|
499
514
|
|
|
@@ -504,10 +519,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
504
519
|
|
|
505
520
|
// set request timeouts
|
|
506
521
|
var timeoutOptions = {};
|
|
507
|
-
timeoutOptions["response"] =
|
|
508
|
-
timeoutOptions["deadline"] =
|
|
522
|
+
timeoutOptions["response"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.connectTimeout, _classPrivateFieldGet(_defaultConnectTimeout, this));
|
|
523
|
+
timeoutOptions["deadline"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.readTimeout, _classPrivateFieldGet(_defaultReadTimeout, this));
|
|
509
524
|
request.timeout(timeoutOptions);
|
|
510
|
-
var contentType =
|
|
525
|
+
var contentType = headerParams.hasOwnProperty("Content-Type") ? headerParams["Content-Type"] : _assertClassBrand(_ApiClient_brand, this, _jsonPreferredMime).call(this, contentTypes);
|
|
511
526
|
if (contentType) {
|
|
512
527
|
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
|
|
513
528
|
if (contentType != 'multipart/form-data') {
|
|
@@ -516,13 +531,15 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
516
531
|
} else if (!request.header['Content-Type']) {
|
|
517
532
|
request.type('application/json');
|
|
518
533
|
}
|
|
534
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Request URL :", httpMethod, url);
|
|
535
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Request Headers :", typeof request.header === "undefined" ? "" : request.header);
|
|
519
536
|
if (contentType === 'application/x-www-form-urlencoded') {
|
|
520
|
-
request.send(
|
|
537
|
+
request.send(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams));
|
|
521
538
|
} else if (contentType == 'multipart/form-data') {
|
|
522
|
-
var _formParams =
|
|
539
|
+
var _formParams = _assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams);
|
|
523
540
|
for (var key in _formParams) {
|
|
524
541
|
if (_formParams.hasOwnProperty(key)) {
|
|
525
|
-
if (
|
|
542
|
+
if (_assertClassBrand(_ApiClient_brand, this, _isFileParam).call(this, _formParams[key])) {
|
|
526
543
|
// file field
|
|
527
544
|
request.attach(key, _formParams[key]);
|
|
528
545
|
} else {
|
|
@@ -530,47 +547,173 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
530
547
|
}
|
|
531
548
|
}
|
|
532
549
|
}
|
|
550
|
+
} else if (contentType === 'application/octet-stream' && bodyParam !== null && typeof bodyParam !== 'undefined' && typeof bodyParam.pipe === 'function') {
|
|
551
|
+
// FILE UPLOAD SUPPORT
|
|
552
|
+
|
|
553
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Piping octet-stream request");
|
|
554
|
+
if (typeof bodyParam.pipe === 'function') {
|
|
555
|
+
bodyParam.pipe(request);
|
|
556
|
+
} else if (typeof require === 'function') {
|
|
557
|
+
var webstream;
|
|
558
|
+
try {
|
|
559
|
+
webstream = require('stream/web');
|
|
560
|
+
} catch (err) {
|
|
561
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Error fetching steam/web");
|
|
562
|
+
}
|
|
563
|
+
if (bodyParam instanceof webstream.ReadableStream) {
|
|
564
|
+
bodyParam.pipeTo(new webstream.WritableStream({
|
|
565
|
+
write: function write(chunk) {
|
|
566
|
+
request.write(chunk);
|
|
567
|
+
},
|
|
568
|
+
close: function close() {
|
|
569
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "READABLE STREAM CLOSED");
|
|
570
|
+
},
|
|
571
|
+
abort: function abort(err) {
|
|
572
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "READABLE STREAM ABORTED");
|
|
573
|
+
}
|
|
574
|
+
}));
|
|
575
|
+
} else {
|
|
576
|
+
request.send(bodyParam);
|
|
577
|
+
}
|
|
578
|
+
} else {
|
|
579
|
+
request.send(bodyParam);
|
|
580
|
+
}
|
|
581
|
+
return new Promise(function (resolve, reject) {
|
|
582
|
+
request.on('error', function (err) {
|
|
583
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught the following error :", err);
|
|
584
|
+
reject(err);
|
|
585
|
+
}).on('response', function (response) {
|
|
586
|
+
_assertClassBrand(_ApiClient_brand, _this2, _handleApiResponseForPromise).call(_this2, response, path, queryParams, returnType, resolve, reject);
|
|
587
|
+
});
|
|
588
|
+
});
|
|
533
589
|
} else if (bodyParam) {
|
|
534
590
|
request.send(bodyParam);
|
|
535
591
|
}
|
|
536
|
-
|
|
537
|
-
if (accept) {
|
|
538
|
-
request.accept(accept);
|
|
539
|
-
}
|
|
540
|
-
if (returnType === 'Blob') {
|
|
592
|
+
if (typeof returnType === 'Blob') {
|
|
541
593
|
request.responseType('blob');
|
|
542
594
|
} else if (returnType === 'String') {
|
|
543
595
|
request.responseType('string');
|
|
544
596
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
597
|
+
_assertClassBrand(_ApiClient_brand, this, _attachCookies).call(this, request);
|
|
598
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Request Body :", typeof request._data === "undefined" ? "" : request._data);
|
|
599
|
+
var accept = headerParams.hasOwnProperty("Accept") && headerParams["Accept"] != undefined ? headerParams["Accept"] : accepts.join(', ');
|
|
600
|
+
var binaryMediaTypes = ['application/octet-stream', 'application/pdf', 'application/zip'];
|
|
601
|
+
if (accept) {
|
|
602
|
+
request.accept(accept);
|
|
603
|
+
}
|
|
549
604
|
return new Promise(function (resolve, reject) {
|
|
550
|
-
request.retry(_this2.maxRetryAttempts, _this2.retryInterval, []).
|
|
551
|
-
|
|
605
|
+
request.buffer(false).redirects(0).retry(_this2.maxRetryAttempts, _this2.retryInterval, []).withCredentials(_this2.withCredentials).on('error', function (err) {
|
|
606
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught the following error :", err);
|
|
607
|
+
}).end(function (error, response) {
|
|
552
608
|
if (error) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
609
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught error during the request!");
|
|
610
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, error);
|
|
611
|
+
if (error.response !== null && typeof error.response !== 'undefined') {
|
|
612
|
+
error.data = _assertClassBrand(_ApiClient_brand, _this2, _deserialize).call(_this2, error.response, returnType);
|
|
613
|
+
} else {
|
|
614
|
+
error.data = _assertClassBrand(_ApiClient_brand, _this2, _wrapErrorInResponse).call(_this2, error);
|
|
556
615
|
}
|
|
557
|
-
_classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).ERROR, null, "Error :", error.data);
|
|
558
616
|
reject(error);
|
|
559
617
|
} else {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
618
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Response Status :", response.status);
|
|
619
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, _assertClassBrand(_ApiClient_brand, _this2, _flatten), "Response Headers :", response.headers);
|
|
620
|
+
var _contentType = '';
|
|
621
|
+
if (response.headers.hasOwnProperty('content-type')) {
|
|
622
|
+
_contentType = response.headers["content-type"];
|
|
623
|
+
}
|
|
624
|
+
var fetchStream = binaryMediaTypes.includes(_contentType);
|
|
625
|
+
if (fetchStream) {
|
|
626
|
+
/*
|
|
627
|
+
* Browser environment :
|
|
628
|
+
* uses Web Streams, downloadDestination expected to be a WritableStream (i.e. sink for response to be streamed to)
|
|
629
|
+
* Node.js environment :
|
|
630
|
+
* uses File System, downloadDestination expected to be a directory path, file is downloaded to this directory
|
|
631
|
+
*/
|
|
632
|
+
if (isBrowser) {
|
|
633
|
+
/*
|
|
634
|
+
* Browser environment :
|
|
635
|
+
* - fetch webstream module
|
|
636
|
+
* - write file to WritableStream downloadDestination
|
|
637
|
+
* - if webstream if not available or downloadDestination is not instance of WritableStream
|
|
638
|
+
* code flow goes to main request.then execution
|
|
639
|
+
*/
|
|
640
|
+
if (typeof require === 'function') {
|
|
641
|
+
var _webstream;
|
|
642
|
+
try {
|
|
643
|
+
_webstream = require('stream/web');
|
|
644
|
+
} catch (err) {
|
|
645
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Error fetching steam/web");
|
|
646
|
+
}
|
|
647
|
+
if (_this2.downloadDestination instanceof _webstream.WritableStream) {
|
|
648
|
+
// Piping Data
|
|
649
|
+
var writer = _this2.downloadDestination.getWriter();
|
|
650
|
+
try {
|
|
651
|
+
response.on('data', function (chunk) {
|
|
652
|
+
writer.write(chunk);
|
|
653
|
+
});
|
|
654
|
+
} catch (err) {
|
|
655
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Issue while downloading file", err);
|
|
656
|
+
}
|
|
657
|
+
response.on('end', function () {
|
|
658
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Finished streaming response");
|
|
659
|
+
writer.close();
|
|
660
|
+
var data = _assertClassBrand(_ApiClient_brand, _this2, _deserialize).call(_this2, response, returnType);
|
|
661
|
+
resolve({
|
|
662
|
+
data: data,
|
|
663
|
+
response: response
|
|
664
|
+
});
|
|
665
|
+
}).on('error', function (err) {
|
|
666
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Caught the following error :", err);
|
|
667
|
+
err.data = _assertClassBrand(_ApiClient_brand, _this2, _wrapErrorInResponse).call(_this2, err);
|
|
668
|
+
reject(err);
|
|
669
|
+
});
|
|
670
|
+
} else {
|
|
671
|
+
var errMsg = "Incompatible downloadDestination for Browser Environment, must be WritableStream";
|
|
672
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, errMsg);
|
|
673
|
+
reject(errMsg);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
} else {
|
|
677
|
+
/*
|
|
678
|
+
* Non Browser environment :
|
|
679
|
+
* - stream data to file
|
|
680
|
+
* - fetch response headers and body (if exists)
|
|
681
|
+
* - return in case of error or after stream finish
|
|
682
|
+
*
|
|
683
|
+
* NOTE :
|
|
684
|
+
* superagent does not provide access to headers before pipe, therefore response is piped to
|
|
685
|
+
* file with temporary name, which is renamed to proper filename after Content-Disposition header is available
|
|
686
|
+
*/
|
|
687
|
+
|
|
688
|
+
var tempFilename = _this2.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
|
|
689
|
+
var stream = _fs2["default"].createWriteStream(tempFilename);
|
|
690
|
+
_assertClassBrand(_ApiClient_brand, _this2, _processDownloadedFile).call(_this2, response, stream, tempFilename, resolve, reject, returnType);
|
|
691
|
+
}
|
|
692
|
+
} else if (response.status == 302) {
|
|
693
|
+
/*
|
|
694
|
+
* Handling 302 Redirects
|
|
695
|
+
* - Reads X-Redirect-Token header from response and writes into Cookie header for redirected request
|
|
696
|
+
*/
|
|
697
|
+
var _tempFilename = _this2.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
|
|
698
|
+
var context = _this2;
|
|
699
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Redirecting to :", response.headers.location);
|
|
700
|
+
var redirectRequest = (0, _superagent["default"])(httpMethod, response.headers.location);
|
|
701
|
+
redirectRequest.set(request.header);
|
|
702
|
+
if (response.headers.hasOwnProperty("x-redirect-token")) {
|
|
703
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Writing X-Redirect-Token into Cookie");
|
|
704
|
+
redirectRequest.set("Cookie", response.headers["x-redirect-token"]);
|
|
705
|
+
}
|
|
706
|
+
redirectRequest.redirects(0);
|
|
707
|
+
redirectRequest.withCredentials(_this2.withCredentials);
|
|
708
|
+
redirectRequest.buffer(false);
|
|
709
|
+
var redirectedStream = _fs2["default"].createWriteStream(_tempFilename);
|
|
710
|
+
redirectRequest.pipe(redirectedStream);
|
|
711
|
+
redirectRequest.on('response', function (redirectResponse) {
|
|
712
|
+
_assertClassBrand(_ApiClient_brand, context, _log).call(context, _classPrivateFieldGet(_LOG_LEVEL, context).INFO, null, "Received response after redirection :", redirectResponse.status);
|
|
713
|
+
_assertClassBrand(_ApiClient_brand, context, _processDownloadedFile).call(context, redirectResponse, redirectedStream, _tempFilename, resolve, reject, returnType);
|
|
570
714
|
});
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
reject(err);
|
|
715
|
+
} else {
|
|
716
|
+
_assertClassBrand(_ApiClient_brand, _this2, _handleApiResponseForPromise).call(_this2, response, path, queryParams, returnType, resolve, reject);
|
|
574
717
|
}
|
|
575
718
|
}
|
|
576
719
|
});
|
|
@@ -743,26 +886,35 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
743
886
|
}
|
|
744
887
|
}
|
|
745
888
|
}]);
|
|
746
|
-
return ApiClient;
|
|
747
889
|
}();
|
|
748
890
|
/**
|
|
749
891
|
* The default API client implementation.
|
|
750
892
|
* @type {ApiClient}
|
|
751
893
|
* @memberOf ApiClient
|
|
752
894
|
*/
|
|
753
|
-
|
|
754
|
-
function
|
|
895
|
+
_ApiClient = ApiClient;
|
|
896
|
+
function _isJsonMime(contentType) {
|
|
755
897
|
return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
|
|
756
898
|
}
|
|
757
|
-
|
|
899
|
+
/*
|
|
900
|
+
* Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
|
|
901
|
+
* @param {Array.<String>} contentTypes
|
|
902
|
+
* @returns {String} The chosen content type, preferring JSON.
|
|
903
|
+
*/
|
|
904
|
+
function _jsonPreferredMime(contentTypes) {
|
|
758
905
|
for (var i = 0; i < contentTypes.length; i++) {
|
|
759
|
-
if (
|
|
906
|
+
if (_assertClassBrand(_ApiClient_brand, this, _isJsonMime).call(this, contentTypes[i])) {
|
|
760
907
|
return contentTypes[i];
|
|
761
908
|
}
|
|
762
909
|
}
|
|
763
910
|
return contentTypes[0];
|
|
764
911
|
}
|
|
765
|
-
|
|
912
|
+
/*
|
|
913
|
+
* Checks whether the given parameter value represents file-like content.
|
|
914
|
+
* @param param The parameter to check.
|
|
915
|
+
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
|
916
|
+
*/
|
|
917
|
+
function _isFileParam(param) {
|
|
766
918
|
// fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
|
|
767
919
|
if (typeof require === 'function') {
|
|
768
920
|
var _fs;
|
|
@@ -780,7 +932,7 @@ function _isFileParam2(param) {
|
|
|
780
932
|
}
|
|
781
933
|
|
|
782
934
|
// Blob in browser
|
|
783
|
-
if (typeof Blob === 'function' && param instanceof Blob) {
|
|
935
|
+
if (typeof _buffer.Blob === 'function' && param instanceof _buffer.Blob) {
|
|
784
936
|
return true;
|
|
785
937
|
}
|
|
786
938
|
|
|
@@ -790,12 +942,22 @@ function _isFileParam2(param) {
|
|
|
790
942
|
}
|
|
791
943
|
return false;
|
|
792
944
|
}
|
|
793
|
-
|
|
945
|
+
/*
|
|
946
|
+
* Normalizes parameter values:
|
|
947
|
+
* <ul>
|
|
948
|
+
* <li>remove nils</li>
|
|
949
|
+
* <li>keep files and arrays</li>
|
|
950
|
+
* <li>format to string with `paramToString` for other cases</li>
|
|
951
|
+
* </ul>
|
|
952
|
+
* @param {Object.<String, Object>} params The parameters as object properties.
|
|
953
|
+
* @returns {Object.<String, Object>} normalized parameters.
|
|
954
|
+
*/
|
|
955
|
+
function _normalizeParams(params) {
|
|
794
956
|
var newParams = {};
|
|
795
957
|
for (var key in params) {
|
|
796
958
|
if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
|
|
797
959
|
var value = params[key];
|
|
798
|
-
if (
|
|
960
|
+
if (_assertClassBrand(_ApiClient_brand, this, _isFileParam).call(this, value) || Array.isArray(value)) {
|
|
799
961
|
newParams[key] = value;
|
|
800
962
|
} else {
|
|
801
963
|
newParams[key] = this.paramToString(value);
|
|
@@ -804,7 +966,7 @@ function _normalizeParams2(params) {
|
|
|
804
966
|
}
|
|
805
967
|
return newParams;
|
|
806
968
|
}
|
|
807
|
-
function
|
|
969
|
+
function _applyAuthToRequest(request, authNames) {
|
|
808
970
|
var _this3 = this;
|
|
809
971
|
authNames.forEach(function (authName) {
|
|
810
972
|
var auth = _this3.authentications[authName];
|
|
@@ -815,7 +977,7 @@ function _applyAuthToRequest2(request, authNames) {
|
|
|
815
977
|
} else if (_this3.username || _this3.password) {
|
|
816
978
|
request.auth(_this3.username || '', _this3.password || '');
|
|
817
979
|
}
|
|
818
|
-
|
|
980
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "Basic Auth applied to request");
|
|
819
981
|
break;
|
|
820
982
|
case 'apiKey':
|
|
821
983
|
if (auth.apiKey) {
|
|
@@ -831,7 +993,7 @@ function _applyAuthToRequest2(request, authNames) {
|
|
|
831
993
|
request.query(data);
|
|
832
994
|
}
|
|
833
995
|
}
|
|
834
|
-
|
|
996
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "apiKey applied to request");
|
|
835
997
|
break;
|
|
836
998
|
case 'oauth2':
|
|
837
999
|
if (auth.accessToken) {
|
|
@@ -839,19 +1001,57 @@ function _applyAuthToRequest2(request, authNames) {
|
|
|
839
1001
|
'Authorization': 'Bearer ' + auth.accessToken
|
|
840
1002
|
});
|
|
841
1003
|
}
|
|
842
|
-
|
|
1004
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "oauth2 applied to request");
|
|
843
1005
|
break;
|
|
844
1006
|
default:
|
|
845
|
-
|
|
1007
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).ERROR, null, "Unknown authentication type:", auth.type);
|
|
846
1008
|
throw new Error('Unknown authentication type: ' + auth.type);
|
|
847
1009
|
}
|
|
848
1010
|
});
|
|
849
1011
|
}
|
|
850
|
-
|
|
1012
|
+
/**
|
|
1013
|
+
* Wraps errors in generic response format.
|
|
1014
|
+
* @param {Object} error object encountered during request.
|
|
1015
|
+
* @returns an error object with wrapped response within error.data .
|
|
1016
|
+
*/
|
|
1017
|
+
function _wrapErrorInResponse(error) {
|
|
1018
|
+
var response = {
|
|
1019
|
+
data: {},
|
|
1020
|
+
metadata: {}
|
|
1021
|
+
};
|
|
1022
|
+
response.data.status = error.status;
|
|
1023
|
+
response.data.message = error.message;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Deserializes an HTTP response body into a value of the specified type.
|
|
1027
|
+
* @param {Object} response A SuperAgent response object.
|
|
1028
|
+
* @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
|
|
1029
|
+
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
|
|
1030
|
+
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
|
|
1031
|
+
* all properties on <code>data<code> will be converted to this type.
|
|
1032
|
+
* @returns A value of the specified type.
|
|
1033
|
+
*/
|
|
1034
|
+
function _deserialize(response, returnType) {
|
|
851
1035
|
if (response == null || returnType == null || response.status == 204) {
|
|
852
1036
|
return null;
|
|
853
1037
|
}
|
|
854
1038
|
|
|
1039
|
+
// Handle text response
|
|
1040
|
+
if (response.headers && ['text/event-stream', 'text/html', 'text/xml', 'text/csv', 'text/javascript', 'text/markdown', 'text/vcard'].includes(response.headers['content-type'])) {
|
|
1041
|
+
var data = new returnType();
|
|
1042
|
+
data.data = new _buffer.Blob([response.text], {
|
|
1043
|
+
type: response.headers['content-type']
|
|
1044
|
+
});
|
|
1045
|
+
var flag = new _Flag["default"]();
|
|
1046
|
+
flag.name = "hasError";
|
|
1047
|
+
flag.value = false;
|
|
1048
|
+
var flags = [flag];
|
|
1049
|
+
var metadata = new _ApiResponseMetadata["default"]();
|
|
1050
|
+
metadata.flags = flags;
|
|
1051
|
+
data.metadata = metadata;
|
|
1052
|
+
return data;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
855
1055
|
// Rely on SuperAgent for parsing response body.
|
|
856
1056
|
// See http://visionmedia.github.io/superagent/#parsing-response-bodies
|
|
857
1057
|
var data = response.body;
|
|
@@ -859,9 +1059,15 @@ function _deserialize2(response, returnType) {
|
|
|
859
1059
|
// SuperAgent does not always produce a body; use the unparsed response as a fallback
|
|
860
1060
|
data = response.text;
|
|
861
1061
|
}
|
|
862
|
-
return
|
|
1062
|
+
return _ApiClient.convertToType(data, returnType);
|
|
863
1063
|
}
|
|
864
|
-
|
|
1064
|
+
/**
|
|
1065
|
+
* Set pagination data if response is a Paginable object
|
|
1066
|
+
* @param {Object} data The response data already passed through deserialize
|
|
1067
|
+
* @param {String} path The path given to callApi method
|
|
1068
|
+
* @param {Object.<String, Object>} queryParams The queryParams given to callApi method
|
|
1069
|
+
*/
|
|
1070
|
+
function _paginateIfNeeded(data, path, queryParams) {
|
|
865
1071
|
// If response is not a Paginable instance, nothing to do
|
|
866
1072
|
if (!(data instanceof _Paginable["default"])) {
|
|
867
1073
|
return;
|
|
@@ -876,15 +1082,16 @@ function _paginateIfNeeded2(data, path, queryParams) {
|
|
|
876
1082
|
// current ApiClient instance
|
|
877
1083
|
page, resultsPerPage);
|
|
878
1084
|
}
|
|
879
|
-
function
|
|
1085
|
+
function _getValidTimeout(timeout, defaultTimeout) {
|
|
880
1086
|
if (timeout <= 0) {
|
|
881
1087
|
timeout = defaultTimeout;
|
|
882
|
-
} else if (timeout > _classPrivateFieldGet(
|
|
883
|
-
timeout = _classPrivateFieldGet(
|
|
1088
|
+
} else if (timeout > _classPrivateFieldGet(_defaultMaxTimeout, this)) {
|
|
1089
|
+
timeout = _classPrivateFieldGet(_defaultMaxTimeout, this);
|
|
884
1090
|
}
|
|
885
1091
|
return timeout;
|
|
886
1092
|
}
|
|
887
|
-
|
|
1093
|
+
// If enabled, update cookie information to reuse in subsequent requests for a valid response
|
|
1094
|
+
function _updateCookies(response) {
|
|
888
1095
|
if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("set-cookie")) {
|
|
889
1096
|
var finalCookie = "";
|
|
890
1097
|
var cookieList = response.headers["set-cookie"];
|
|
@@ -911,61 +1118,48 @@ function _updateCookies2(response) {
|
|
|
911
1118
|
finalCookie = finalCookie.substr(0, finalCookie.length - 1);
|
|
912
1119
|
}
|
|
913
1120
|
}
|
|
914
|
-
_classPrivateFieldSet(
|
|
915
|
-
|
|
1121
|
+
_classPrivateFieldSet(_cookie, this, finalCookie);
|
|
1122
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Retained cookie :", finalCookie);
|
|
916
1123
|
} else {
|
|
917
|
-
_classPrivateFieldSet(
|
|
1124
|
+
_classPrivateFieldSet(_cookie, this, null);
|
|
918
1125
|
}
|
|
919
1126
|
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1127
|
+
// If enabled, attach saved cookies to request
|
|
1128
|
+
function _attachCookies(request) {
|
|
1129
|
+
if (_classPrivateFieldGet(_cookie, this) != null) {
|
|
1130
|
+
request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
|
|
1131
|
+
'Cookie': _classPrivateFieldGet(_cookie, this)
|
|
924
1132
|
}));
|
|
925
1133
|
}
|
|
926
1134
|
}
|
|
927
|
-
function
|
|
1135
|
+
function _log(level, mapper) {
|
|
928
1136
|
for (var _len = arguments.length, messages = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
929
1137
|
messages[_key - 2] = arguments[_key];
|
|
930
1138
|
}
|
|
931
1139
|
// Set default log level to INFO
|
|
932
1140
|
if (_typeof(level) !== "object" || !("key" in level) || !("value" in level) || _typeof(level["value"]) !== "symbol") {
|
|
933
|
-
level = _classPrivateFieldGet(
|
|
1141
|
+
level = _classPrivateFieldGet(_LOG_LEVEL, this).INFO;
|
|
934
1142
|
}
|
|
935
|
-
if (!
|
|
1143
|
+
if (!_assertClassBrand(_ApiClient_brand, this, _skipLogging).call(this, level)) {
|
|
936
1144
|
// Preprocess message to prefix with timestamp and log level
|
|
937
1145
|
messages = messages.map(function (message) {
|
|
938
1146
|
return typeof message === "string" ? message : mapper ? mapper(message) : JSON.stringify(message);
|
|
939
1147
|
});
|
|
940
1148
|
var message = messages.join(' ');
|
|
941
|
-
message =
|
|
942
|
-
if (typeof _classPrivateFieldGet(
|
|
943
|
-
_classPrivateFieldGet(
|
|
1149
|
+
message = new Date().toISOString() + ' ' + level.key + ' - ' + message;
|
|
1150
|
+
if (typeof _classPrivateFieldGet(_logger, this) !== "undefined" && _classPrivateFieldGet(_logger, this) !== null && typeof _classPrivateFieldGet(_logger, this).log === 'function') {
|
|
1151
|
+
_classPrivateFieldGet(_logger, this).log(message);
|
|
944
1152
|
} else {
|
|
945
1153
|
console.log(message);
|
|
946
1154
|
}
|
|
947
1155
|
}
|
|
948
1156
|
}
|
|
949
|
-
function
|
|
1157
|
+
function _skipLogging(level) {
|
|
950
1158
|
// Skip logging if log level is DEBUG but debug is not enabled.
|
|
951
|
-
return !this.debug && level === _classPrivateFieldGet(
|
|
952
|
-
}
|
|
953
|
-
function _getLocalDateTime2() {
|
|
954
|
-
// Current epoch UTC time in milliseconds
|
|
955
|
-
var epochTime = Date.now();
|
|
956
|
-
|
|
957
|
-
// "getTimezoneOffset" returns the difference, in minutes, between a date as evaluated in the UTC time zone,
|
|
958
|
-
// and the same date as evaluated in the local time zone.
|
|
959
|
-
// if you are in timezone UTC-1, outputs 60
|
|
960
|
-
// if you are in timezone UTC+3, outputs -180
|
|
961
|
-
var timezoneOffsetInMinutes = new Date().getTimezoneOffset();
|
|
962
|
-
var timezoneOffsetInMilliseconds = timezoneOffsetInMinutes * 60 * 1000;
|
|
963
|
-
|
|
964
|
-
// Create a new date with adjusted epoch time based on timezone offset
|
|
965
|
-
var date = new Date(epochTime - timezoneOffsetInMilliseconds);
|
|
966
|
-
return date.toISOString().slice(0, 23);
|
|
1159
|
+
return !this.debug && level === _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG;
|
|
967
1160
|
}
|
|
968
|
-
function
|
|
1161
|
+
// A mapper function to flatten a simple non-nested (key:value) object to string
|
|
1162
|
+
function _flatten(obj) {
|
|
969
1163
|
if (_typeof(obj) !== "object") {
|
|
970
1164
|
return obj;
|
|
971
1165
|
}
|
|
@@ -977,4 +1171,92 @@ function _flatten2(obj) {
|
|
|
977
1171
|
}
|
|
978
1172
|
return output === '\n' ? obj : output;
|
|
979
1173
|
}
|
|
1174
|
+
// handle and deserialize received response
|
|
1175
|
+
function _handleApiResponseForPromise(response, path, queryParams, returnType, resolve, reject) {
|
|
1176
|
+
try {
|
|
1177
|
+
var data = _assertClassBrand(_ApiClient_brand, this, _deserialize).call(this, response, returnType);
|
|
1178
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Response Status :", response.status);
|
|
1179
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Response Headers :", response.headers);
|
|
1180
|
+
_assertClassBrand(_ApiClient_brand, this, _updateCookies).call(this, response || {});
|
|
1181
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Response Body :", data);
|
|
1182
|
+
if (response.status == 204 && data == null) {
|
|
1183
|
+
resolve({
|
|
1184
|
+
data: data,
|
|
1185
|
+
response: response
|
|
1186
|
+
});
|
|
1187
|
+
} else if (response.ok && data != null) {
|
|
1188
|
+
this.addEtagToReservedMap(response, data);
|
|
1189
|
+
_assertClassBrand(_ApiClient_brand, this, _paginateIfNeeded).call(this, data, path, queryParams);
|
|
1190
|
+
resolve({
|
|
1191
|
+
data: data,
|
|
1192
|
+
response: response
|
|
1193
|
+
});
|
|
1194
|
+
} else {
|
|
1195
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, data);
|
|
1196
|
+
reject(_objectSpread(_objectSpread({}, response.error), {}, {
|
|
1197
|
+
data: data
|
|
1198
|
+
}));
|
|
1199
|
+
}
|
|
1200
|
+
} catch (err) {
|
|
1201
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Caught error while processing response!");
|
|
1202
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, err);
|
|
1203
|
+
err.data = _assertClassBrand(_ApiClient_brand, this, _wrapErrorInResponse).call(this, err);
|
|
1204
|
+
reject(err);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
function _processDownloadedFile(response, stream, tempFilename, resolve, reject, returnType) {
|
|
1208
|
+
var _this4 = this;
|
|
1209
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Streaming response to : ", tempFilename);
|
|
1210
|
+
try {
|
|
1211
|
+
response.on('data', function (chunk) {
|
|
1212
|
+
stream.write(chunk);
|
|
1213
|
+
});
|
|
1214
|
+
} catch (err) {
|
|
1215
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Issue while downloading file", err);
|
|
1216
|
+
}
|
|
1217
|
+
var data = new returnType();
|
|
1218
|
+
// Fetch filename
|
|
1219
|
+
var filename = "";
|
|
1220
|
+
if (typeof response.headers['content-disposition'] !== 'undefined' && response.headers['content-disposition'] !== null) {
|
|
1221
|
+
var match = response.headers['content-disposition'].match(/*#__PURE__*/_wrapRegExp(/.*filename="(.*)".*/, {
|
|
1222
|
+
filename: 1
|
|
1223
|
+
}));
|
|
1224
|
+
var filepath = _path["default"].parse(match.groups['filename']);
|
|
1225
|
+
filename = this.downloadDestination + '/' + filepath.name + '_' + Date.now() + filepath.ext;
|
|
1226
|
+
data.data = {
|
|
1227
|
+
"path": _path["default"].parse(filename),
|
|
1228
|
+
$objectType: "Path"
|
|
1229
|
+
};
|
|
1230
|
+
var flag = new _Flag["default"]();
|
|
1231
|
+
flag.name = "hasError";
|
|
1232
|
+
flag.value = false;
|
|
1233
|
+
var flags = [flag];
|
|
1234
|
+
var metadata = new _ApiResponseMetadata["default"]();
|
|
1235
|
+
metadata.flags = flags;
|
|
1236
|
+
data.metadata = metadata;
|
|
1237
|
+
}
|
|
1238
|
+
response.on('end', function () {
|
|
1239
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).INFO, null, "Finished streaming response");
|
|
1240
|
+
if (filename.length !== 0) {
|
|
1241
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).INFO, null, "Content-Disposition header found [", filename, "] is final filename");
|
|
1242
|
+
stream.close();
|
|
1243
|
+
_fs2["default"].renameSync(tempFilename, filename);
|
|
1244
|
+
resolve({
|
|
1245
|
+
data: data,
|
|
1246
|
+
response: response
|
|
1247
|
+
});
|
|
1248
|
+
} else {
|
|
1249
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).ERROR, null, "Content-Disposition header not found [", tempFilename, "] is final filename");
|
|
1250
|
+
resolve({
|
|
1251
|
+
data: data,
|
|
1252
|
+
response: response
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
response.on('error', function (err) {
|
|
1257
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).ERROR, null, "Caught the following error :", err);
|
|
1258
|
+
error.data = _assertClassBrand(_ApiClient_brand, _this4, _wrapErrorInResponse).call(_this4, error);
|
|
1259
|
+
reject(err);
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
980
1262
|
ApiClient.instance = new ApiClient();
|