@nutanix-scratch/dataprotection-js-client 4.0.1-alpha.4 → 4.0.1
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 +64 -41
- package/dist/Ntnx-Dataprotection-js-client-prod.js +1 -11
- package/dist/Ntnx-Dataprotection-js-client.js +669 -1486
- package/dist/es/ApiClient.d.ts +9 -1
- package/dist/es/ApiClient.js +476 -261
- package/dist/es/Paginable.d.ts +1 -1
- package/dist/es/Paginable.js +23 -25
- package/dist/es/apis/protectedresources-endpoints.d.ts +52 -0
- package/dist/es/apis/protectedresources-endpoints.js +192 -0
- package/dist/es/apis/recoverypoints-endpoints.d.ts +186 -0
- package/dist/es/apis/recoverypoints-endpoints.js +655 -0
- package/dist/es/index.d.ts +95 -99
- package/dist/es/index.js +268 -285
- package/dist/es/models/common/v1/config/Flag.d.ts +33 -27
- package/dist/es/models/common/v1/config/Flag.js +86 -44
- package/dist/es/models/common/v1/config/IPAddress.d.ts +77 -0
- package/dist/es/models/common/v1/config/IPAddress.js +323 -0
- package/dist/es/models/common/v1/config/IPv4Address.d.ts +41 -27
- package/dist/es/models/common/v1/config/IPv4Address.js +85 -46
- package/dist/es/models/common/v1/config/IPv6Address.d.ts +76 -0
- package/dist/es/models/common/v1/config/IPv6Address.js +329 -0
- package/dist/es/models/common/v1/config/KVPair.d.ts +36 -27
- package/dist/es/models/common/v1/config/KVPair.js +94 -50
- 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 +42 -39
- package/dist/es/models/common/v1/config/Message.js +78 -48
- package/dist/es/models/common/v1/config/MessageSeverity.js +15 -16
- package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +25 -23
- package/dist/es/models/common/v1/config/TenantAwareModel.js +75 -45
- package/dist/es/models/common/v1/response/ApiLink.d.ts +29 -27
- package/dist/es/models/common/v1/response/ApiLink.js +75 -45
- package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +82 -47
- package/dist/es/models/common/v1/response/ApiResponseMetadata.js +95 -53
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +26 -20
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +100 -63
- package/dist/{lib/models/dataprotection/v4/config/PowerState.d.ts → es/models/dataprotection/v4/common/BackupType.d.ts} +6 -6
- package/dist/es/models/dataprotection/v4/common/BackupType.js +85 -0
- package/dist/es/models/dataprotection/v4/common/BaseRecoveryPoint.d.ts +49 -54
- package/dist/es/models/dataprotection/v4/common/BaseRecoveryPoint.js +113 -112
- package/dist/es/models/dataprotection/v4/common/BaseVmRecoveryPoint.d.ts +97 -0
- package/dist/es/models/dataprotection/v4/common/BaseVmRecoveryPoint.js +513 -0
- package/dist/es/models/dataprotection/v4/common/ClusterInfo.d.ts +81 -0
- package/dist/es/models/dataprotection/v4/common/ClusterInfo.js +312 -0
- package/dist/es/models/dataprotection/v4/common/DiskRecoveryPoint.d.ts +64 -0
- package/dist/es/models/dataprotection/v4/common/DiskRecoveryPoint.js +314 -0
- package/dist/es/models/dataprotection/v4/common/RecoveryPointStatus.js +11 -24
- package/dist/es/models/dataprotection/v4/common/RecoveryPointType.js +9 -10
- package/dist/es/models/dataprotection/v4/common/VssProperties.d.ts +97 -0
- package/dist/es/models/dataprotection/v4/common/VssProperties.js +407 -0
- package/dist/es/models/dataprotection/v4/config/AhvVmOverrideSpec.d.ts +23 -21
- package/dist/es/models/dataprotection/v4/config/AhvVmOverrideSpec.js +75 -45
- package/dist/es/models/dataprotection/v4/config/AmazonS3Bucket.d.ts +64 -0
- package/dist/es/models/dataprotection/v4/config/AmazonS3Bucket.js +321 -0
- package/dist/es/models/dataprotection/v4/config/AzureBlobStorageContainer.d.ts +64 -0
- package/dist/es/models/dataprotection/v4/config/AzureBlobStorageContainer.js +321 -0
- package/dist/es/models/dataprotection/v4/config/ClusterInfoApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/config/ClusterInfoApiResponse.js +343 -0
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroup.d.ts +76 -33
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroup.js +201 -73
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMember.d.ts +43 -45
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMember.js +107 -110
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMemberType.js +11 -12
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.d.ts +32 -37
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.js +119 -91
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupProjection.d.ts +6 -1
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupProjection.js +71 -44
- package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.js +343 -0
- package/dist/es/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.js +87 -62
- package/dist/es/models/dataprotection/v4/config/DataProtectionSiteReference.d.ts +39 -27
- package/dist/es/models/dataprotection/v4/config/DataProtectionSiteReference.js +100 -64
- package/dist/es/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.d.ts +65 -26
- package/dist/es/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.js +87 -58
- package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.js +87 -62
- package/dist/es/models/dataprotection/v4/config/EsxiVmOverrideSpec.d.ts +23 -21
- package/dist/es/models/dataprotection/v4/config/EsxiVmOverrideSpec.js +75 -45
- package/dist/es/models/dataprotection/v4/config/ExpirationTimeSpec.d.ts +62 -0
- package/dist/es/models/dataprotection/v4/config/ExpirationTimeSpec.js +280 -0
- package/dist/es/models/dataprotection/v4/config/GetProtectedResourceApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/config/GetProtectedResourceApiResponse.js +343 -0
- package/dist/es/models/dataprotection/v4/config/GetRecoveryPointApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/config/GetRecoveryPointApiResponse.js +343 -0
- package/dist/es/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.d.ts +101 -0
- package/dist/es/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.js +343 -0
- package/dist/es/models/dataprotection/v4/config/HostReference.d.ts +26 -20
- package/dist/es/models/dataprotection/v4/config/HostReference.js +106 -58
- package/dist/es/models/dataprotection/v4/config/HostType.js +10 -11
- package/dist/es/models/dataprotection/v4/config/IpAddress.d.ts +29 -24
- package/dist/es/models/dataprotection/v4/config/IpAddress.js +76 -43
- package/dist/es/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.d.ts +100 -0
- package/dist/es/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.js +370 -0
- package/dist/es/models/dataprotection/v4/config/LocationReference.d.ts +25 -23
- package/dist/es/models/dataprotection/v4/config/LocationReference.js +76 -46
- package/dist/es/models/dataprotection/v4/config/MigrateConsistencyGroupApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/config/MigrateConsistencyGroupApiResponse.js +343 -0
- package/dist/es/models/dataprotection/v4/config/NutanixObjectsBucket.d.ts +52 -0
- package/dist/es/models/dataprotection/v4/config/NutanixObjectsBucket.js +277 -0
- package/dist/es/models/dataprotection/v4/config/ObjectStorageType.d.ts +19 -0
- package/dist/es/models/dataprotection/v4/config/ObjectStorageType.js +91 -0
- package/dist/es/models/dataprotection/v4/config/{ValidationSeverity.d.ts → ProtectedEntityType.d.ts} +6 -6
- package/dist/es/models/dataprotection/v4/config/ProtectedEntityType.js +85 -0
- package/dist/es/models/dataprotection/v4/config/ProtectedResource.d.ts +120 -40
- package/dist/es/models/dataprotection/v4/config/ProtectedResource.js +226 -89
- package/dist/es/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.js +87 -58
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.js +17 -30
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.js +87 -58
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.d.ts +34 -29
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.js +81 -47
- package/dist/es/models/dataprotection/v4/config/RecoveryInfo.d.ts +30 -21
- package/dist/es/models/dataprotection/v4/config/RecoveryInfo.js +75 -42
- package/dist/es/models/dataprotection/v4/config/RecoveryPoint.d.ts +111 -74
- package/dist/es/models/dataprotection/v4/config/RecoveryPoint.js +165 -190
- package/dist/es/models/dataprotection/v4/config/RecoveryPointProjection.d.ts +10 -0
- package/dist/es/models/dataprotection/v4/config/RecoveryPointProjection.js +156 -0
- package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.js +87 -62
- package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicationSpec.d.ts +46 -25
- package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicationSpec.js +161 -106
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRepository.d.ts +63 -0
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRepository.js +374 -0
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.d.ts +10 -0
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.js +152 -0
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRestorationSpec.d.ts +59 -39
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRestorationSpec.js +90 -60
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.js +87 -62
- package/dist/es/models/dataprotection/v4/config/ReplicationState.d.ts +53 -41
- package/dist/es/models/dataprotection/v4/config/ReplicationState.js +123 -85
- package/dist/es/models/dataprotection/v4/config/RestorableTimeRange.d.ts +27 -25
- package/dist/es/models/dataprotection/v4/config/RestorableTimeRange.js +79 -48
- package/dist/es/models/dataprotection/v4/config/SiteProtectionInfo.d.ts +90 -0
- package/dist/es/models/dataprotection/v4/config/SiteProtectionInfo.js +344 -0
- package/dist/es/models/dataprotection/v4/config/SiteReference.d.ts +29 -27
- package/dist/es/models/dataprotection/v4/config/SiteReference.js +74 -44
- package/dist/es/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.js +87 -58
- package/dist/es/models/dataprotection/v4/config/SynchronousReplicationRole.d.ts +19 -0
- package/dist/es/models/dataprotection/v4/config/SynchronousReplicationRole.js +97 -0
- package/dist/es/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.js +365 -0
- package/dist/es/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.d.ts +66 -26
- package/dist/es/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.js +87 -58
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPoint.d.ts +10 -0
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPoint.js +154 -0
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.d.ts +24 -48
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.js +95 -139
- package/dist/es/models/dataprotection/v4/config/VolumeGroupOverrideSpec.d.ts +23 -21
- package/dist/es/models/dataprotection/v4/config/VolumeGroupOverrideSpec.js +73 -43
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.d.ts +83 -31
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.js +269 -110
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.d.ts +36 -34
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.js +97 -69
- package/dist/es/models/dataprotection/v4/config/VolumeGroupSyncContext.d.ts +40 -40
- package/dist/es/models/dataprotection/v4/config/VolumeGroupSyncContext.js +122 -95
- package/dist/es/models/dataprotection/v4/config/Witness.d.ts +56 -34
- package/dist/es/models/dataprotection/v4/config/Witness.js +123 -65
- package/dist/es/models/dataprotection/v4/config/WitnessAvailabilityStatus.js +11 -12
- package/dist/es/models/dataprotection/v4/content/BaseRecoveryPointSpec.d.ts +64 -0
- package/dist/es/models/dataprotection/v4/content/BaseRecoveryPointSpec.js +317 -0
- package/dist/es/models/dataprotection/v4/content/ChangedRegion.d.ts +93 -0
- package/dist/es/models/dataprotection/v4/content/ChangedRegion.js +363 -0
- package/dist/es/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.js +365 -0
- package/dist/es/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.d.ts +99 -0
- package/dist/es/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.js +365 -0
- package/dist/es/models/dataprotection/v4/content/ClusterDiscoverOperation.d.ts +19 -0
- package/dist/es/models/dataprotection/v4/content/ClusterDiscoverOperation.js +85 -0
- package/dist/es/models/dataprotection/v4/content/ClusterDiscoverSpec.d.ts +79 -0
- package/dist/es/models/dataprotection/v4/content/ClusterDiscoverSpec.js +341 -0
- package/dist/es/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.d.ts +76 -0
- package/dist/es/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.js +358 -0
- package/dist/es/models/dataprotection/v4/content/DiskRecoveryPointReference.d.ts +64 -0
- package/dist/es/models/dataprotection/v4/content/DiskRecoveryPointReference.js +318 -0
- package/dist/es/models/dataprotection/v4/content/GetVssMetadataApiResponse.d.ts +98 -0
- package/dist/es/models/dataprotection/v4/content/GetVssMetadataApiResponse.js +342 -0
- package/dist/es/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.d.ts +62 -0
- package/dist/es/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.js +284 -0
- package/dist/es/models/dataprotection/v4/{config/PowerState.d.ts → content/RegionType.d.ts} +6 -6
- package/dist/es/models/dataprotection/v4/content/RegionType.js +85 -0
- package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.d.ts +30 -0
- package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.js +269 -0
- package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointReference.d.ts +30 -0
- package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointReference.js +270 -0
- package/dist/es/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.d.ts +57 -0
- package/dist/es/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.js +360 -0
- package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.d.ts +30 -0
- package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.js +269 -0
- package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.d.ts +30 -0
- package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.js +270 -0
- package/dist/es/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.d.ts +57 -0
- package/dist/es/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.js +360 -0
- package/dist/es/models/dataprotection/v4/error/AppMessage.d.ts +68 -51
- package/dist/es/models/dataprotection/v4/error/AppMessage.js +101 -59
- package/dist/es/models/dataprotection/v4/error/ErrorResponse.d.ts +24 -20
- package/dist/es/models/dataprotection/v4/error/ErrorResponse.js +88 -66
- package/dist/es/models/dataprotection/v4/error/SchemaValidationError.d.ts +64 -44
- package/dist/es/models/dataprotection/v4/error/SchemaValidationError.js +98 -52
- package/dist/es/models/dataprotection/v4/error/SchemaValidationErrorMessage.d.ts +41 -33
- package/dist/es/models/dataprotection/v4/error/SchemaValidationErrorMessage.js +85 -46
- package/dist/es/models/prism/v4/config/TaskReference.d.ts +23 -21
- package/dist/es/models/prism/v4/config/TaskReference.js +74 -47
- 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 +9 -1
- package/dist/lib/ApiClient.js +476 -261
- package/dist/lib/Paginable.d.ts +1 -1
- package/dist/lib/Paginable.js +23 -25
- package/dist/lib/apis/protectedresources-endpoints.d.ts +52 -0
- package/dist/lib/apis/protectedresources-endpoints.js +192 -0
- package/dist/lib/apis/recoverypoints-endpoints.d.ts +186 -0
- package/dist/lib/apis/recoverypoints-endpoints.js +655 -0
- package/dist/lib/index.d.ts +95 -99
- package/dist/lib/index.js +268 -285
- package/dist/lib/models/common/v1/config/Flag.d.ts +33 -27
- package/dist/lib/models/common/v1/config/Flag.js +86 -44
- package/dist/lib/models/common/v1/config/IPAddress.d.ts +77 -0
- package/dist/lib/models/common/v1/config/IPAddress.js +323 -0
- package/dist/lib/models/common/v1/config/IPv4Address.d.ts +41 -27
- package/dist/lib/models/common/v1/config/IPv4Address.js +85 -46
- package/dist/lib/models/common/v1/config/IPv6Address.d.ts +76 -0
- package/dist/lib/models/common/v1/config/IPv6Address.js +329 -0
- package/dist/lib/models/common/v1/config/KVPair.d.ts +36 -27
- package/dist/lib/models/common/v1/config/KVPair.js +94 -50
- 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 +42 -39
- package/dist/lib/models/common/v1/config/Message.js +78 -48
- package/dist/lib/models/common/v1/config/MessageSeverity.js +15 -16
- package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +25 -23
- package/dist/lib/models/common/v1/config/TenantAwareModel.js +75 -45
- package/dist/lib/models/common/v1/response/ApiLink.d.ts +29 -27
- package/dist/lib/models/common/v1/response/ApiLink.js +75 -45
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +82 -47
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +95 -53
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +26 -20
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +100 -63
- package/dist/lib/models/dataprotection/v4/{config/HypervisorType.d.ts → common/BackupType.d.ts} +6 -6
- package/dist/lib/models/dataprotection/v4/common/BackupType.js +85 -0
- package/dist/lib/models/dataprotection/v4/common/BaseRecoveryPoint.d.ts +49 -54
- package/dist/lib/models/dataprotection/v4/common/BaseRecoveryPoint.js +113 -112
- package/dist/lib/models/dataprotection/v4/common/BaseVmRecoveryPoint.d.ts +97 -0
- package/dist/lib/models/dataprotection/v4/common/BaseVmRecoveryPoint.js +513 -0
- package/dist/lib/models/dataprotection/v4/common/ClusterInfo.d.ts +81 -0
- package/dist/lib/models/dataprotection/v4/common/ClusterInfo.js +312 -0
- package/dist/lib/models/dataprotection/v4/common/DiskRecoveryPoint.d.ts +64 -0
- package/dist/lib/models/dataprotection/v4/common/DiskRecoveryPoint.js +314 -0
- package/dist/lib/models/dataprotection/v4/common/RecoveryPointStatus.js +11 -24
- package/dist/lib/models/dataprotection/v4/common/RecoveryPointType.js +9 -10
- package/dist/lib/models/dataprotection/v4/common/VssProperties.d.ts +97 -0
- package/dist/lib/models/dataprotection/v4/common/VssProperties.js +407 -0
- package/dist/lib/models/dataprotection/v4/config/AhvVmOverrideSpec.d.ts +23 -21
- package/dist/lib/models/dataprotection/v4/config/AhvVmOverrideSpec.js +75 -45
- package/dist/lib/models/dataprotection/v4/config/AmazonS3Bucket.d.ts +64 -0
- package/dist/lib/models/dataprotection/v4/config/AmazonS3Bucket.js +321 -0
- package/dist/lib/models/dataprotection/v4/config/AzureBlobStorageContainer.d.ts +64 -0
- package/dist/lib/models/dataprotection/v4/config/AzureBlobStorageContainer.js +321 -0
- package/dist/lib/models/dataprotection/v4/config/ClusterInfoApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/config/ClusterInfoApiResponse.js +343 -0
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroup.d.ts +76 -33
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroup.js +201 -73
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMember.d.ts +43 -45
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMember.js +107 -110
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMemberType.js +11 -12
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.d.ts +32 -37
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.js +119 -91
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupProjection.d.ts +6 -1
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupProjection.js +71 -44
- package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.js +343 -0
- package/dist/lib/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.js +87 -62
- package/dist/lib/models/dataprotection/v4/config/DataProtectionSiteReference.d.ts +39 -27
- package/dist/lib/models/dataprotection/v4/config/DataProtectionSiteReference.js +100 -64
- package/dist/lib/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.d.ts +65 -26
- package/dist/lib/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.js +87 -58
- package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.js +87 -62
- package/dist/lib/models/dataprotection/v4/config/EsxiVmOverrideSpec.d.ts +23 -21
- package/dist/lib/models/dataprotection/v4/config/EsxiVmOverrideSpec.js +75 -45
- package/dist/lib/models/dataprotection/v4/config/ExpirationTimeSpec.d.ts +62 -0
- package/dist/lib/models/dataprotection/v4/config/ExpirationTimeSpec.js +280 -0
- package/dist/lib/models/dataprotection/v4/config/GetProtectedResourceApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/config/GetProtectedResourceApiResponse.js +343 -0
- package/dist/lib/models/dataprotection/v4/config/GetRecoveryPointApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/config/GetRecoveryPointApiResponse.js +343 -0
- package/dist/lib/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.d.ts +101 -0
- package/dist/lib/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.js +343 -0
- package/dist/lib/models/dataprotection/v4/config/HostReference.d.ts +26 -20
- package/dist/lib/models/dataprotection/v4/config/HostReference.js +106 -58
- package/dist/lib/models/dataprotection/v4/config/HostType.js +10 -11
- package/dist/lib/models/dataprotection/v4/config/IpAddress.d.ts +29 -24
- package/dist/lib/models/dataprotection/v4/config/IpAddress.js +76 -43
- package/dist/lib/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.d.ts +100 -0
- package/dist/lib/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.js +370 -0
- package/dist/lib/models/dataprotection/v4/config/LocationReference.d.ts +25 -23
- package/dist/lib/models/dataprotection/v4/config/LocationReference.js +76 -46
- package/dist/lib/models/dataprotection/v4/config/MigrateConsistencyGroupApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/config/MigrateConsistencyGroupApiResponse.js +343 -0
- package/dist/lib/models/dataprotection/v4/config/NutanixObjectsBucket.d.ts +52 -0
- package/dist/lib/models/dataprotection/v4/config/NutanixObjectsBucket.js +277 -0
- package/dist/lib/models/dataprotection/v4/config/ObjectStorageType.d.ts +19 -0
- package/dist/lib/models/dataprotection/v4/config/ObjectStorageType.js +91 -0
- package/dist/lib/models/dataprotection/v4/config/ProtectedEntityType.d.ts +19 -0
- package/dist/lib/models/dataprotection/v4/config/ProtectedEntityType.js +85 -0
- package/dist/lib/models/dataprotection/v4/config/ProtectedResource.d.ts +120 -40
- package/dist/lib/models/dataprotection/v4/config/ProtectedResource.js +226 -89
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.js +87 -58
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.js +17 -30
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.js +87 -58
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.d.ts +34 -29
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.js +81 -47
- package/dist/lib/models/dataprotection/v4/config/RecoveryInfo.d.ts +30 -21
- package/dist/lib/models/dataprotection/v4/config/RecoveryInfo.js +75 -42
- package/dist/lib/models/dataprotection/v4/config/RecoveryPoint.d.ts +111 -74
- package/dist/lib/models/dataprotection/v4/config/RecoveryPoint.js +165 -190
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointProjection.d.ts +10 -0
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointProjection.js +156 -0
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.js +87 -62
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicationSpec.d.ts +46 -25
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicationSpec.js +161 -106
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepository.d.ts +63 -0
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepository.js +374 -0
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.d.ts +10 -0
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.js +152 -0
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestorationSpec.d.ts +59 -39
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestorationSpec.js +90 -60
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.js +87 -62
- package/dist/lib/models/dataprotection/v4/config/ReplicationState.d.ts +53 -41
- package/dist/lib/models/dataprotection/v4/config/ReplicationState.js +123 -85
- package/dist/lib/models/dataprotection/v4/config/RestorableTimeRange.d.ts +27 -25
- package/dist/lib/models/dataprotection/v4/config/RestorableTimeRange.js +79 -48
- package/dist/lib/models/dataprotection/v4/config/SiteProtectionInfo.d.ts +90 -0
- package/dist/lib/models/dataprotection/v4/config/SiteProtectionInfo.js +344 -0
- package/dist/lib/models/dataprotection/v4/config/SiteReference.d.ts +29 -27
- package/dist/lib/models/dataprotection/v4/config/SiteReference.js +74 -44
- package/dist/lib/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.js +87 -58
- package/dist/lib/models/dataprotection/v4/config/SynchronousReplicationRole.d.ts +19 -0
- package/dist/lib/models/dataprotection/v4/config/SynchronousReplicationRole.js +97 -0
- package/dist/lib/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.js +365 -0
- package/dist/lib/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.d.ts +66 -26
- package/dist/lib/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.js +87 -58
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPoint.d.ts +10 -0
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPoint.js +154 -0
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.d.ts +24 -48
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.js +95 -139
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupOverrideSpec.d.ts +23 -21
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupOverrideSpec.js +73 -43
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.d.ts +83 -31
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.js +269 -110
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.d.ts +36 -34
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.js +97 -69
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupSyncContext.d.ts +40 -40
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupSyncContext.js +122 -95
- package/dist/lib/models/dataprotection/v4/config/Witness.d.ts +56 -34
- package/dist/lib/models/dataprotection/v4/config/Witness.js +123 -65
- package/dist/lib/models/dataprotection/v4/config/WitnessAvailabilityStatus.js +11 -12
- package/dist/lib/models/dataprotection/v4/content/BaseRecoveryPointSpec.d.ts +64 -0
- package/dist/lib/models/dataprotection/v4/content/BaseRecoveryPointSpec.js +317 -0
- package/dist/lib/models/dataprotection/v4/content/ChangedRegion.d.ts +93 -0
- package/dist/lib/models/dataprotection/v4/content/ChangedRegion.js +363 -0
- package/dist/lib/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.js +365 -0
- package/dist/lib/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.d.ts +99 -0
- package/dist/lib/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.js +365 -0
- package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverOperation.d.ts +19 -0
- package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverOperation.js +85 -0
- package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverSpec.d.ts +79 -0
- package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverSpec.js +341 -0
- package/dist/lib/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.d.ts +76 -0
- package/dist/lib/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.js +358 -0
- package/dist/lib/models/dataprotection/v4/content/DiskRecoveryPointReference.d.ts +64 -0
- package/dist/lib/models/dataprotection/v4/content/DiskRecoveryPointReference.js +318 -0
- package/dist/lib/models/dataprotection/v4/content/GetVssMetadataApiResponse.d.ts +98 -0
- package/dist/lib/models/dataprotection/v4/content/GetVssMetadataApiResponse.js +342 -0
- package/dist/lib/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.d.ts +62 -0
- package/dist/lib/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.js +284 -0
- package/dist/{es/models/dataprotection/v4/config/HypervisorType.d.ts → lib/models/dataprotection/v4/content/RegionType.d.ts} +6 -6
- package/dist/lib/models/dataprotection/v4/content/RegionType.js +85 -0
- package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.d.ts +30 -0
- package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.js +269 -0
- package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointReference.d.ts +30 -0
- package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointReference.js +270 -0
- package/dist/lib/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.d.ts +57 -0
- package/dist/lib/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.js +360 -0
- package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.d.ts +30 -0
- package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.js +269 -0
- package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.d.ts +30 -0
- package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.js +270 -0
- package/dist/lib/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.d.ts +57 -0
- package/dist/lib/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.js +360 -0
- package/dist/lib/models/dataprotection/v4/error/AppMessage.d.ts +68 -51
- package/dist/lib/models/dataprotection/v4/error/AppMessage.js +101 -59
- package/dist/lib/models/dataprotection/v4/error/ErrorResponse.d.ts +24 -20
- package/dist/lib/models/dataprotection/v4/error/ErrorResponse.js +88 -66
- package/dist/lib/models/dataprotection/v4/error/SchemaValidationError.d.ts +64 -44
- package/dist/lib/models/dataprotection/v4/error/SchemaValidationError.js +98 -52
- package/dist/lib/models/dataprotection/v4/error/SchemaValidationErrorMessage.d.ts +41 -33
- package/dist/lib/models/dataprotection/v4/error/SchemaValidationErrorMessage.js +85 -46
- package/dist/lib/models/prism/v4/config/TaskReference.d.ts +23 -21
- package/dist/lib/models/prism/v4/config/TaskReference.js +74 -47
- 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 +5 -4
- package/dist/es/apis/consistencygroup-endpoints.d.ts +0 -98
- package/dist/es/apis/consistencygroup-endpoints.js +0 -304
- package/dist/es/models/dataprotection/v4/common/VendorSpecificProperty.d.ts +0 -70
- package/dist/es/models/dataprotection/v4/common/VendorSpecificProperty.js +0 -286
- package/dist/es/models/dataprotection/v4/config/Category.d.ts +0 -70
- package/dist/es/models/dataprotection/v4/config/Category.js +0 -286
- package/dist/es/models/dataprotection/v4/config/ChangedRegions.d.ts +0 -62
- package/dist/es/models/dataprotection/v4/config/ChangedRegions.js +0 -295
- package/dist/es/models/dataprotection/v4/config/ChangedRegionsListApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/ChangedRegionsListApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/ClusterReference.d.ts +0 -69
- package/dist/es/models/dataprotection/v4/config/ClusterReference.js +0 -285
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.js +0 -341
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.js +0 -318
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.d.ts +0 -67
- package/dist/es/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.js +0 -285
- package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.js +0 -318
- package/dist/es/models/dataprotection/v4/config/DataProtectionInfo.d.ts +0 -58
- package/dist/es/models/dataprotection/v4/config/DataProtectionInfo.js +0 -278
- package/dist/es/models/dataprotection/v4/config/DisasterRecoveryLocation.d.ts +0 -68
- package/dist/es/models/dataprotection/v4/config/DisasterRecoveryLocation.js +0 -297
- package/dist/es/models/dataprotection/v4/config/Disk.d.ts +0 -62
- package/dist/es/models/dataprotection/v4/config/Disk.js +0 -285
- package/dist/es/models/dataprotection/v4/config/DiskRecoveryPoint.d.ts +0 -37
- package/dist/es/models/dataprotection/v4/config/DiskRecoveryPoint.js +0 -254
- package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.js +0 -336
- package/dist/es/models/dataprotection/v4/config/HardwareArchitecture.d.ts +0 -19
- package/dist/es/models/dataprotection/v4/config/HardwareArchitecture.js +0 -86
- package/dist/es/models/dataprotection/v4/config/HypervisorType.js +0 -92
- package/dist/es/models/dataprotection/v4/config/PowerState.js +0 -86
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceEntityType.d.ts +0 -19
- package/dist/es/models/dataprotection/v4/config/ProtectedResourceEntityType.js +0 -86
- package/dist/es/models/dataprotection/v4/config/RecoveryPointApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/RecoveryPointApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/RecoveryPointListApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/RecoveryPointListApiResponse.js +0 -336
- package/dist/es/models/dataprotection/v4/config/Regions.d.ts +0 -62
- package/dist/es/models/dataprotection/v4/config/Regions.js +0 -282
- package/dist/es/models/dataprotection/v4/config/SetExpirationTimeSpec.d.ts +0 -57
- package/dist/es/models/dataprotection/v4/config/SetExpirationTimeSpec.js +0 -246
- package/dist/es/models/dataprotection/v4/config/Subnet.d.ts +0 -48
- package/dist/es/models/dataprotection/v4/config/Subnet.js +0 -242
- package/dist/es/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/VMRecoveryPoint.d.ts +0 -49
- package/dist/es/models/dataprotection/v4/config/VMRecoveryPoint.js +0 -295
- package/dist/es/models/dataprotection/v4/config/VMRecoveryPointApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/VMRecoveryPointApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.js +0 -336
- package/dist/es/models/dataprotection/v4/config/ValidateRecoveryPointResult.d.ts +0 -79
- package/dist/es/models/dataprotection/v4/config/ValidateRecoveryPointResult.js +0 -320
- package/dist/es/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.js +0 -336
- package/dist/es/models/dataprotection/v4/config/ValidationSeverity.js +0 -86
- package/dist/es/models/dataprotection/v4/config/Vm.d.ts +0 -140
- package/dist/es/models/dataprotection/v4/config/Vm.js +0 -545
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.d.ts +0 -70
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.js +0 -319
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.js +0 -318
- package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPoint.d.ts +0 -98
- package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPoint.js +0 -405
- package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPointProjection.d.ts +0 -9
- package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPointProjection.js +0 -132
- package/dist/es/models/dataprotection/v4/config/VolumeGroup.d.ts +0 -62
- package/dist/es/models/dataprotection/v4/config/VolumeGroup.js +0 -285
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.js +0 -314
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.js +0 -336
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.d.ts +0 -62
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.js +0 -288
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.js +0 -318
- package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.d.ts +0 -98
- package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.js +0 -407
- package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.d.ts +0 -9
- package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.js +0 -132
- package/dist/es/models/dataprotection/v4/config/VpcReference.d.ts +0 -69
- package/dist/es/models/dataprotection/v4/config/VpcReference.js +0 -285
- package/dist/es/models/dataprotection/v4/config/WitnessApiResponse.d.ts +0 -59
- package/dist/es/models/dataprotection/v4/config/WitnessApiResponse.js +0 -314
- package/dist/es/models/storage/v4/config/Task.d.ts +0 -50
- package/dist/es/models/storage/v4/config/Task.js +0 -254
- package/dist/lib/apis/consistencygroup-endpoints.d.ts +0 -98
- package/dist/lib/apis/consistencygroup-endpoints.js +0 -304
- package/dist/lib/models/dataprotection/v4/common/VendorSpecificProperty.d.ts +0 -70
- package/dist/lib/models/dataprotection/v4/common/VendorSpecificProperty.js +0 -286
- package/dist/lib/models/dataprotection/v4/config/Category.d.ts +0 -70
- package/dist/lib/models/dataprotection/v4/config/Category.js +0 -286
- package/dist/lib/models/dataprotection/v4/config/ChangedRegions.d.ts +0 -62
- package/dist/lib/models/dataprotection/v4/config/ChangedRegions.js +0 -295
- package/dist/lib/models/dataprotection/v4/config/ChangedRegionsListApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/ChangedRegionsListApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/ClusterReference.d.ts +0 -69
- package/dist/lib/models/dataprotection/v4/config/ClusterReference.js +0 -285
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.js +0 -341
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.js +0 -318
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.d.ts +0 -67
- package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.js +0 -285
- package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.js +0 -318
- package/dist/lib/models/dataprotection/v4/config/DataProtectionInfo.d.ts +0 -58
- package/dist/lib/models/dataprotection/v4/config/DataProtectionInfo.js +0 -278
- package/dist/lib/models/dataprotection/v4/config/DisasterRecoveryLocation.d.ts +0 -68
- package/dist/lib/models/dataprotection/v4/config/DisasterRecoveryLocation.js +0 -297
- package/dist/lib/models/dataprotection/v4/config/Disk.d.ts +0 -62
- package/dist/lib/models/dataprotection/v4/config/Disk.js +0 -285
- package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPoint.d.ts +0 -37
- package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPoint.js +0 -254
- package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.js +0 -336
- package/dist/lib/models/dataprotection/v4/config/HardwareArchitecture.d.ts +0 -19
- package/dist/lib/models/dataprotection/v4/config/HardwareArchitecture.js +0 -86
- package/dist/lib/models/dataprotection/v4/config/HypervisorType.js +0 -92
- package/dist/lib/models/dataprotection/v4/config/PowerState.js +0 -86
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceEntityType.d.ts +0 -19
- package/dist/lib/models/dataprotection/v4/config/ProtectedResourceEntityType.js +0 -86
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointListApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/RecoveryPointListApiResponse.js +0 -336
- package/dist/lib/models/dataprotection/v4/config/Regions.d.ts +0 -62
- package/dist/lib/models/dataprotection/v4/config/Regions.js +0 -282
- package/dist/lib/models/dataprotection/v4/config/SetExpirationTimeSpec.d.ts +0 -57
- package/dist/lib/models/dataprotection/v4/config/SetExpirationTimeSpec.js +0 -246
- package/dist/lib/models/dataprotection/v4/config/Subnet.d.ts +0 -48
- package/dist/lib/models/dataprotection/v4/config/Subnet.js +0 -242
- package/dist/lib/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/VMRecoveryPoint.d.ts +0 -49
- package/dist/lib/models/dataprotection/v4/config/VMRecoveryPoint.js +0 -295
- package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.js +0 -336
- package/dist/lib/models/dataprotection/v4/config/ValidateRecoveryPointResult.d.ts +0 -79
- package/dist/lib/models/dataprotection/v4/config/ValidateRecoveryPointResult.js +0 -320
- package/dist/lib/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.js +0 -336
- package/dist/lib/models/dataprotection/v4/config/ValidationSeverity.d.ts +0 -19
- package/dist/lib/models/dataprotection/v4/config/ValidationSeverity.js +0 -86
- package/dist/lib/models/dataprotection/v4/config/Vm.d.ts +0 -140
- package/dist/lib/models/dataprotection/v4/config/Vm.js +0 -545
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.d.ts +0 -70
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.js +0 -319
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.js +0 -318
- package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPoint.d.ts +0 -98
- package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPoint.js +0 -405
- package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPointProjection.d.ts +0 -9
- package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPointProjection.js +0 -132
- package/dist/lib/models/dataprotection/v4/config/VolumeGroup.d.ts +0 -62
- package/dist/lib/models/dataprotection/v4/config/VolumeGroup.js +0 -285
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.js +0 -314
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.js +0 -336
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.d.ts +0 -62
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.js +0 -288
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.js +0 -318
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.d.ts +0 -98
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.js +0 -407
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.d.ts +0 -9
- package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.js +0 -132
- package/dist/lib/models/dataprotection/v4/config/VpcReference.d.ts +0 -69
- package/dist/lib/models/dataprotection/v4/config/VpcReference.js +0 -285
- package/dist/lib/models/dataprotection/v4/config/WitnessApiResponse.d.ts +0 -59
- package/dist/lib/models/dataprotection/v4/config/WitnessApiResponse.js +0 -314
- package/dist/lib/models/storage/v4/config/Task.d.ts +0 -50
- package/dist/lib/models/storage/v4/config/Task.js +0 -254
package/dist/lib/ApiClient.js
CHANGED
|
@@ -10,47 +10,51 @@ 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
|
-
var
|
|
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
|
|
32
|
-
function
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } 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 Data Protection APIs
|
|
41
|
+
*
|
|
42
|
+
* OpenAPI spec version: 4.0.1
|
|
43
|
+
*
|
|
44
|
+
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
45
|
+
*
|
|
46
|
+
* Open API Dev Platform Codegen version: 16.9.0.8546-RELEASE
|
|
47
|
+
*
|
|
48
|
+
* Do not edit the class manually.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
47
51
|
(0, _superagentRetryDelay["default"])(_superagent["default"]);
|
|
48
52
|
/**
|
|
49
53
|
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
|
|
50
54
|
* application to use this class directly - the *Api and model classes provide the public API for the service. The
|
|
51
55
|
* contents of this file should be regarded as internal but are documented for completeness.
|
|
52
56
|
* @module ApiClient
|
|
53
|
-
* @version 4.0.1
|
|
57
|
+
* @version 4.0.1
|
|
54
58
|
*/
|
|
55
59
|
var _protocol = /*#__PURE__*/new WeakMap();
|
|
56
60
|
var _cookie = /*#__PURE__*/new WeakMap();
|
|
@@ -60,93 +64,14 @@ var _defaultConnectTimeout = /*#__PURE__*/new WeakMap();
|
|
|
60
64
|
var _defaultReadTimeout = /*#__PURE__*/new WeakMap();
|
|
61
65
|
var _defaultMaxTimeout = /*#__PURE__*/new WeakMap();
|
|
62
66
|
var _LOG_LEVEL = /*#__PURE__*/new WeakMap();
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
var _isFileParam = /*#__PURE__*/new WeakSet();
|
|
66
|
-
var _normalizeParams = /*#__PURE__*/new WeakSet();
|
|
67
|
-
var _applyAuthToRequest = /*#__PURE__*/new WeakSet();
|
|
68
|
-
var _wrapErrorInResponse = /*#__PURE__*/new WeakSet();
|
|
69
|
-
var _deserialize = /*#__PURE__*/new WeakSet();
|
|
70
|
-
var _paginateIfNeeded = /*#__PURE__*/new WeakSet();
|
|
71
|
-
var _getValidTimeout = /*#__PURE__*/new WeakSet();
|
|
72
|
-
var _updateCookies = /*#__PURE__*/new WeakSet();
|
|
73
|
-
var _attachCookies = /*#__PURE__*/new WeakSet();
|
|
74
|
-
var _log = /*#__PURE__*/new WeakSet();
|
|
75
|
-
var _skipLogging = /*#__PURE__*/new WeakSet();
|
|
76
|
-
var _getLocalDateTime = /*#__PURE__*/new WeakSet();
|
|
77
|
-
var _flatten = /*#__PURE__*/new WeakSet();
|
|
78
|
-
var ApiClient = /*#__PURE__*/function () {
|
|
67
|
+
var _ApiClient_brand = /*#__PURE__*/new WeakSet();
|
|
68
|
+
var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
|
|
79
69
|
/**
|
|
80
70
|
* @alias module:ApiClient
|
|
81
71
|
* @class
|
|
82
72
|
*/
|
|
83
73
|
function ApiClient() {
|
|
84
74
|
_classCallCheck(this, ApiClient);
|
|
85
|
-
// A mapper function to flatten a simple non-nested (key:value) object to string
|
|
86
|
-
_classPrivateMethodInitSpec(this, _flatten);
|
|
87
|
-
_classPrivateMethodInitSpec(this, _getLocalDateTime);
|
|
88
|
-
_classPrivateMethodInitSpec(this, _skipLogging);
|
|
89
|
-
_classPrivateMethodInitSpec(this, _log);
|
|
90
|
-
// If enabled, attach saved cookies to request
|
|
91
|
-
_classPrivateMethodInitSpec(this, _attachCookies);
|
|
92
|
-
// If enabled, update cookie information to reuse in subsequent requests for a valid response
|
|
93
|
-
_classPrivateMethodInitSpec(this, _updateCookies);
|
|
94
|
-
// Gets a valid timeout
|
|
95
|
-
// 1. Sets to provided default timeout in case invalid value is passed
|
|
96
|
-
// 2. Sets to default max value of 30 minutes in case a value of more than 30 minutes is passed
|
|
97
|
-
_classPrivateMethodInitSpec(this, _getValidTimeout);
|
|
98
|
-
/**
|
|
99
|
-
* Set pagination data if response is a Paginable object
|
|
100
|
-
* @param {Object} data The response data already passed through deserialize
|
|
101
|
-
* @param {String} path The path given to callApi method
|
|
102
|
-
* @param {Object.<String, Object>} queryParams The queryParams given to callApi method
|
|
103
|
-
*/
|
|
104
|
-
_classPrivateMethodInitSpec(this, _paginateIfNeeded);
|
|
105
|
-
/**
|
|
106
|
-
* Deserializes an HTTP response body into a value of the specified type.
|
|
107
|
-
* @param {Object} response A SuperAgent response object.
|
|
108
|
-
* @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
|
|
109
|
-
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
|
|
110
|
-
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
|
|
111
|
-
* all properties on <code>data<code> will be converted to this type.
|
|
112
|
-
* @returns A value of the specified type.
|
|
113
|
-
*/
|
|
114
|
-
_classPrivateMethodInitSpec(this, _deserialize);
|
|
115
|
-
/**
|
|
116
|
-
* Wraps errors in generic response format.
|
|
117
|
-
* @param {Object} error object encountered during request.
|
|
118
|
-
* @returns an error object with wrapped response within error.data .
|
|
119
|
-
*/
|
|
120
|
-
_classPrivateMethodInitSpec(this, _wrapErrorInResponse);
|
|
121
|
-
/*
|
|
122
|
-
* Applies authentication headers to the request.
|
|
123
|
-
* @param {Object} request The request object created by a <code>superagent()</code> call.
|
|
124
|
-
* @param {Array.<String>} authNames An array of authentication method names.
|
|
125
|
-
*/
|
|
126
|
-
_classPrivateMethodInitSpec(this, _applyAuthToRequest);
|
|
127
|
-
/*
|
|
128
|
-
* Normalizes parameter values:
|
|
129
|
-
* <ul>
|
|
130
|
-
* <li>remove nils</li>
|
|
131
|
-
* <li>keep files and arrays</li>
|
|
132
|
-
* <li>format to string with `paramToString` for other cases</li>
|
|
133
|
-
* </ul>
|
|
134
|
-
* @param {Object.<String, Object>} params The parameters as object properties.
|
|
135
|
-
* @returns {Object.<String, Object>} normalized parameters.
|
|
136
|
-
*/
|
|
137
|
-
_classPrivateMethodInitSpec(this, _normalizeParams);
|
|
138
|
-
/*
|
|
139
|
-
* Checks whether the given parameter value represents file-like content.
|
|
140
|
-
* @param param The parameter to check.
|
|
141
|
-
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
|
142
|
-
*/
|
|
143
|
-
_classPrivateMethodInitSpec(this, _isFileParam);
|
|
144
|
-
/*
|
|
145
|
-
* Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
|
|
146
|
-
* @param {Array.<String>} contentTypes
|
|
147
|
-
* @returns {String} The chosen content type, preferring JSON.
|
|
148
|
-
*/
|
|
149
|
-
_classPrivateMethodInitSpec(this, _jsonPreferredMime);
|
|
150
75
|
/*
|
|
151
76
|
* Checks whether the given content type represents JSON.<br>
|
|
152
77
|
* JSON content type examples:<br>
|
|
@@ -158,41 +83,17 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
158
83
|
* @param {String} contentType The MIME content type to check.
|
|
159
84
|
* @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
|
|
160
85
|
*/
|
|
161
|
-
_classPrivateMethodInitSpec(this,
|
|
86
|
+
_classPrivateMethodInitSpec(this, _ApiClient_brand);
|
|
162
87
|
// PRIVATE VARIABLES
|
|
163
|
-
_classPrivateFieldInitSpec(this, _protocol,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
_classPrivateFieldInitSpec(this,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
writable: true,
|
|
173
|
-
value: void 0
|
|
174
|
-
});
|
|
175
|
-
_classPrivateFieldInitSpec(this, _verifySslFlag, {
|
|
176
|
-
writable: true,
|
|
177
|
-
value: void 0
|
|
178
|
-
});
|
|
179
|
-
_classPrivateFieldInitSpec(this, _defaultConnectTimeout, {
|
|
180
|
-
writable: true,
|
|
181
|
-
value: void 0
|
|
182
|
-
});
|
|
183
|
-
_classPrivateFieldInitSpec(this, _defaultReadTimeout, {
|
|
184
|
-
writable: true,
|
|
185
|
-
value: void 0
|
|
186
|
-
});
|
|
187
|
-
_classPrivateFieldInitSpec(this, _defaultMaxTimeout, {
|
|
188
|
-
writable: true,
|
|
189
|
-
value: void 0
|
|
190
|
-
});
|
|
191
|
-
_classPrivateFieldInitSpec(this, _LOG_LEVEL, {
|
|
192
|
-
writable: true,
|
|
193
|
-
value: void 0
|
|
194
|
-
});
|
|
195
|
-
_classPrivateFieldSet(this, _LOG_LEVEL, Object.freeze({
|
|
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({
|
|
196
97
|
DEBUG: {
|
|
197
98
|
key: "DEBUG",
|
|
198
99
|
value: Symbol(0)
|
|
@@ -237,6 +138,11 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
237
138
|
* @type {Array.<String>}
|
|
238
139
|
*/
|
|
239
140
|
this.authentications = {
|
|
141
|
+
'apiKeyAuthScheme': {
|
|
142
|
+
type: 'apiKey',
|
|
143
|
+
'in': 'header',
|
|
144
|
+
name: 'X-ntnx-api-key'
|
|
145
|
+
},
|
|
240
146
|
'basicAuthScheme': {
|
|
241
147
|
type: 'basic'
|
|
242
148
|
}
|
|
@@ -248,23 +154,23 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
248
154
|
* @default {}
|
|
249
155
|
*/
|
|
250
156
|
this.defaultHeaders = {};
|
|
251
|
-
_classPrivateFieldSet(
|
|
252
|
-
_classPrivateFieldSet(
|
|
253
|
-
_classPrivateFieldSet(
|
|
157
|
+
_classPrivateFieldSet(_defaultConnectTimeout, this, 30000);
|
|
158
|
+
_classPrivateFieldSet(_defaultReadTimeout, this, 30000);
|
|
159
|
+
_classPrivateFieldSet(_defaultMaxTimeout, this, 10800000);
|
|
254
160
|
|
|
255
161
|
/**
|
|
256
162
|
* The default HTTP read timeout in milliseconds for all API calls.
|
|
257
163
|
* @type {Number}
|
|
258
164
|
* @default 30000
|
|
259
165
|
*/
|
|
260
|
-
this.readTimeout = _classPrivateFieldGet(
|
|
166
|
+
this.readTimeout = _classPrivateFieldGet(_defaultReadTimeout, this);
|
|
261
167
|
|
|
262
168
|
/**
|
|
263
169
|
* The default HTTP connection timeout in milliseconds for all API calls.
|
|
264
170
|
* @type {Number}
|
|
265
171
|
* @default 30000
|
|
266
172
|
*/
|
|
267
|
-
this.connectTimeout = _classPrivateFieldGet(
|
|
173
|
+
this.connectTimeout = _classPrivateFieldGet(_defaultConnectTimeout, this);
|
|
268
174
|
|
|
269
175
|
/**
|
|
270
176
|
* If set to false an additional timestamp parameter is added to all API GET calls to
|
|
@@ -278,7 +184,14 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
278
184
|
* Saved Cookies
|
|
279
185
|
* @default null
|
|
280
186
|
*/
|
|
281
|
-
_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;
|
|
282
195
|
|
|
283
196
|
/**
|
|
284
197
|
* The maximum number of retry attempts to be made by the client
|
|
@@ -307,7 +220,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
307
220
|
* Allow SDK to print debug logs
|
|
308
221
|
*/
|
|
309
222
|
this.debug = false;
|
|
310
|
-
_classPrivateFieldSet(
|
|
223
|
+
_classPrivateFieldSet(_logger, this, null);
|
|
311
224
|
|
|
312
225
|
/**
|
|
313
226
|
* Username for basic auth
|
|
@@ -318,7 +231,13 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
318
231
|
* Password for basic auth
|
|
319
232
|
*/
|
|
320
233
|
this.password = null;
|
|
321
|
-
_classPrivateFieldSet(
|
|
234
|
+
_classPrivateFieldSet(_verifySslFlag, this, true);
|
|
235
|
+
|
|
236
|
+
/*
|
|
237
|
+
* Non Browser Environment : path to directory where downloaded files will be stored
|
|
238
|
+
* Browser Environment : WritableStream to pipe downloaded file to
|
|
239
|
+
*/
|
|
240
|
+
this.downloadDestination = null;
|
|
322
241
|
|
|
323
242
|
/*
|
|
324
243
|
* Log file to write activity logs
|
|
@@ -330,10 +249,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
330
249
|
* Enable/Disable SSL Verification
|
|
331
250
|
* @param verifySsl (boolean)
|
|
332
251
|
*/
|
|
333
|
-
_createClass(ApiClient, [{
|
|
252
|
+
return _createClass(ApiClient, [{
|
|
334
253
|
key: "verifySsl",
|
|
335
254
|
get: function get() {
|
|
336
|
-
return _classPrivateFieldGet(
|
|
255
|
+
return _classPrivateFieldGet(_verifySslFlag, this);
|
|
337
256
|
}
|
|
338
257
|
|
|
339
258
|
/**
|
|
@@ -348,7 +267,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
348
267
|
rejectUnauthorized: false
|
|
349
268
|
});
|
|
350
269
|
}
|
|
351
|
-
_classPrivateFieldSet(
|
|
270
|
+
_classPrivateFieldSet(_verifySslFlag, this, verifySsl);
|
|
352
271
|
}
|
|
353
272
|
}, {
|
|
354
273
|
key: "loggerFile",
|
|
@@ -359,7 +278,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
359
278
|
flags: 'a'
|
|
360
279
|
});
|
|
361
280
|
}
|
|
362
|
-
_classPrivateFieldSet(
|
|
281
|
+
_classPrivateFieldSet(_logger, this, new console.Console({
|
|
363
282
|
stdout: logfile,
|
|
364
283
|
stderr: logfile
|
|
365
284
|
}));
|
|
@@ -375,7 +294,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
375
294
|
key: "addDefaultHeader",
|
|
376
295
|
value: function addDefaultHeader(key, value) {
|
|
377
296
|
if (key === "Authorization") {
|
|
378
|
-
_classPrivateFieldSet(
|
|
297
|
+
_classPrivateFieldSet(_cookie, this, null);
|
|
379
298
|
}
|
|
380
299
|
this.defaultHeaders[key] = value;
|
|
381
300
|
}
|
|
@@ -405,10 +324,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
405
324
|
}
|
|
406
325
|
|
|
407
326
|
// The protocol of the base URL, including the colon (:).
|
|
408
|
-
_classPrivateFieldSet(
|
|
327
|
+
_classPrivateFieldSet(_protocol, this, typeof self === 'undefined' ? this.scheme + ':' : self.location.protocol);
|
|
409
328
|
var basePath = ''; //default
|
|
410
|
-
if (_classPrivateFieldGet(
|
|
411
|
-
basePath = _classPrivateFieldGet(
|
|
329
|
+
if (_classPrivateFieldGet(_protocol, this) !== '' && this.host !== '' && this.port !== '') {
|
|
330
|
+
basePath = _classPrivateFieldGet(_protocol, this) + '\/\/' + this.host + ':' + this.port;
|
|
412
331
|
} else if (typeof self !== "undefined") {
|
|
413
332
|
basePath = self.origin;
|
|
414
333
|
}
|
|
@@ -454,6 +373,27 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
454
373
|
throw new Error('Unknown collection format: ' + collectionFormat);
|
|
455
374
|
}
|
|
456
375
|
}
|
|
376
|
+
|
|
377
|
+
/*
|
|
378
|
+
* Sets API key for authentication
|
|
379
|
+
*
|
|
380
|
+
* @param {String} key The API key for authentication
|
|
381
|
+
*/
|
|
382
|
+
}, {
|
|
383
|
+
key: "setApiKey",
|
|
384
|
+
value: function setApiKey(key) {
|
|
385
|
+
if (key == undefined || typeof key === 'string' || key instanceof String) {
|
|
386
|
+
this.authentications['apiKeyAuthScheme']['apiKey'] = key;
|
|
387
|
+
} else {
|
|
388
|
+
this.authentications['apiKeyAuthScheme']['apiKey'] = undefined;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/*
|
|
393
|
+
* Applies authentication headers to the request.
|
|
394
|
+
* @param {Object} request The request object created by a <code>superagent()</code> call.
|
|
395
|
+
* @param {Array.<String>} authNames An array of authentication method names.
|
|
396
|
+
*/
|
|
457
397
|
}, {
|
|
458
398
|
key: "addEtagToReservedMap",
|
|
459
399
|
value: function addEtagToReservedMap(response, data) {
|
|
@@ -520,31 +460,38 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
520
460
|
request.callback = function (err, res) {
|
|
521
461
|
if (res && res.status) {
|
|
522
462
|
var status = res.status;
|
|
523
|
-
if (status >= 400 && !(status === 401 || status === 408 || status === 503 || status === 504)) {
|
|
463
|
+
if (status >= 400 && !(status === 401 || status === 408 || status === 429 || status === 503 || status === 504)) {
|
|
524
464
|
this._maxRetries = 0;
|
|
525
465
|
}
|
|
526
466
|
if (res.status === 401) {
|
|
527
467
|
this.unset("Cookie");
|
|
528
468
|
this._maxRetries = 1;
|
|
529
469
|
}
|
|
470
|
+
if (status === 429) {
|
|
471
|
+
var retryAfter = res.headers['retry-after'];
|
|
472
|
+
if (retryAfter) {
|
|
473
|
+
var delay = parseInt(retryAfter, 10) * 1000;
|
|
474
|
+
this._retryDelays[this._retries] = delay;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
530
477
|
}
|
|
531
478
|
this.oldCallback(err, res);
|
|
532
479
|
};
|
|
533
480
|
|
|
534
481
|
// apply authentications
|
|
535
|
-
|
|
482
|
+
_assertClassBrand(_ApiClient_brand, this, _applyAuthToRequest).call(this, request, authNames);
|
|
536
483
|
|
|
537
484
|
// set query parameters
|
|
538
485
|
if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
|
|
539
486
|
queryParams['_'] = new Date().getTime();
|
|
540
487
|
}
|
|
541
|
-
request.query(
|
|
488
|
+
request.query(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, queryParams));
|
|
542
489
|
|
|
543
490
|
// set header parameters
|
|
544
|
-
request.set(this.defaultHeaders).set(
|
|
491
|
+
request.set(this.defaultHeaders).set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, headerParams));
|
|
545
492
|
if ((this.defaultHeaders['NTNX-Request-Id'] === null || this.defaultHeaders['NTNX-Request-Id'] === undefined) && (headerParams['NTNX-Request-Id'] === null || headerParams['NTNX-Request-Id'] === undefined)) {
|
|
546
493
|
var requestId = (0, _uuid.v4)();
|
|
547
|
-
request.set(
|
|
494
|
+
request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
|
|
548
495
|
'NTNX-Request-Id': requestId
|
|
549
496
|
}));
|
|
550
497
|
}
|
|
@@ -552,8 +499,9 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
552
499
|
// Set User-Agent header only if it is not a browser environment
|
|
553
500
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
554
501
|
if (!isBrowser) {
|
|
555
|
-
|
|
556
|
-
|
|
502
|
+
this.downloadDestination = '.';
|
|
503
|
+
request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
|
|
504
|
+
'User-Agent': 'Nutanix-dataprotection-js-client/4.0.1'
|
|
557
505
|
}));
|
|
558
506
|
}
|
|
559
507
|
|
|
@@ -564,10 +512,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
564
512
|
|
|
565
513
|
// set request timeouts
|
|
566
514
|
var timeoutOptions = {};
|
|
567
|
-
timeoutOptions["response"] =
|
|
568
|
-
timeoutOptions["deadline"] =
|
|
515
|
+
timeoutOptions["response"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.connectTimeout, _classPrivateFieldGet(_defaultConnectTimeout, this));
|
|
516
|
+
timeoutOptions["deadline"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.readTimeout, _classPrivateFieldGet(_defaultReadTimeout, this));
|
|
569
517
|
request.timeout(timeoutOptions);
|
|
570
|
-
var contentType =
|
|
518
|
+
var contentType = headerParams.hasOwnProperty("Content-Type") ? headerParams["Content-Type"] : _assertClassBrand(_ApiClient_brand, this, _jsonPreferredMime).call(this, contentTypes);
|
|
571
519
|
if (contentType) {
|
|
572
520
|
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
|
|
573
521
|
if (contentType != 'multipart/form-data') {
|
|
@@ -576,13 +524,15 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
576
524
|
} else if (!request.header['Content-Type']) {
|
|
577
525
|
request.type('application/json');
|
|
578
526
|
}
|
|
527
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Request URL :", httpMethod, url);
|
|
528
|
+
_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);
|
|
579
529
|
if (contentType === 'application/x-www-form-urlencoded') {
|
|
580
|
-
request.send(
|
|
530
|
+
request.send(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams));
|
|
581
531
|
} else if (contentType == 'multipart/form-data') {
|
|
582
|
-
var _formParams =
|
|
532
|
+
var _formParams = _assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams);
|
|
583
533
|
for (var key in _formParams) {
|
|
584
534
|
if (_formParams.hasOwnProperty(key)) {
|
|
585
|
-
if (
|
|
535
|
+
if (_assertClassBrand(_ApiClient_brand, this, _isFileParam).call(this, _formParams[key])) {
|
|
586
536
|
// file field
|
|
587
537
|
request.attach(key, _formParams[key]);
|
|
588
538
|
} else {
|
|
@@ -590,60 +540,176 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
590
540
|
}
|
|
591
541
|
}
|
|
592
542
|
}
|
|
543
|
+
} else if (contentType === 'application/octet-stream' && bodyParam !== null && typeof bodyParam !== 'undefined' && typeof bodyParam.pipe === 'function') {
|
|
544
|
+
// FILE UPLOAD SUPPORT
|
|
545
|
+
|
|
546
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Piping octet-stream request");
|
|
547
|
+
if (typeof bodyParam.pipe === 'function') {
|
|
548
|
+
bodyParam.pipe(request);
|
|
549
|
+
} else if (typeof require === 'function') {
|
|
550
|
+
var webstream;
|
|
551
|
+
try {
|
|
552
|
+
webstream = require('stream/web');
|
|
553
|
+
} catch (err) {
|
|
554
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Error fetching steam/web");
|
|
555
|
+
}
|
|
556
|
+
if (bodyParam instanceof webstream.ReadableStream) {
|
|
557
|
+
bodyParam.pipeTo(new webstream.WritableStream({
|
|
558
|
+
write: function write(chunk) {
|
|
559
|
+
request.write(chunk);
|
|
560
|
+
},
|
|
561
|
+
close: function close() {
|
|
562
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "READABLE STREAM CLOSED");
|
|
563
|
+
},
|
|
564
|
+
abort: function abort(err) {
|
|
565
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "READABLE STREAM ABORTED");
|
|
566
|
+
}
|
|
567
|
+
}));
|
|
568
|
+
} else {
|
|
569
|
+
request.send(bodyParam);
|
|
570
|
+
}
|
|
571
|
+
} else {
|
|
572
|
+
request.send(bodyParam);
|
|
573
|
+
}
|
|
574
|
+
return new Promise(function (resolve, reject) {
|
|
575
|
+
request.on('error', function (err) {
|
|
576
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught the following error :", err);
|
|
577
|
+
reject(err);
|
|
578
|
+
}).on('response', function (response) {
|
|
579
|
+
_assertClassBrand(_ApiClient_brand, _this2, _handleApiResponseForPromise).call(_this2, response, path, queryParams, returnType, resolve, reject);
|
|
580
|
+
});
|
|
581
|
+
});
|
|
593
582
|
} else if (bodyParam) {
|
|
594
583
|
request.send(bodyParam);
|
|
595
584
|
}
|
|
596
|
-
|
|
597
|
-
if (accept) {
|
|
598
|
-
request.accept(accept);
|
|
599
|
-
}
|
|
600
|
-
if (returnType === 'Blob') {
|
|
585
|
+
if (typeof returnType === 'Blob') {
|
|
601
586
|
request.responseType('blob');
|
|
602
587
|
} else if (returnType === 'String') {
|
|
603
588
|
request.responseType('string');
|
|
604
589
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
590
|
+
_assertClassBrand(_ApiClient_brand, this, _attachCookies).call(this, request);
|
|
591
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Request Body :", typeof request._data === "undefined" ? "" : request._data);
|
|
592
|
+
var accept = headerParams.hasOwnProperty("Accept") && headerParams["Accept"] != undefined ? headerParams["Accept"] : accepts.join(', ');
|
|
593
|
+
var binaryMediaTypes = ['application/octet-stream', 'application/pdf', 'application/zip'];
|
|
594
|
+
if (accept) {
|
|
595
|
+
request.accept(accept);
|
|
596
|
+
}
|
|
609
597
|
return new Promise(function (resolve, reject) {
|
|
610
|
-
request.on('error', function (err) {
|
|
611
|
-
|
|
612
|
-
}).
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
_classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Response Body :", data);
|
|
619
|
-
if (response.ok) {
|
|
620
|
-
_this2.addEtagToReservedMap(response, data);
|
|
621
|
-
_classPrivateMethodGet(_this2, _paginateIfNeeded, _paginateIfNeeded2).call(_this2, data, path, queryParams);
|
|
622
|
-
resolve({
|
|
623
|
-
data: data,
|
|
624
|
-
response: response
|
|
625
|
-
});
|
|
598
|
+
request.buffer(false).redirects(0).retry(_this2.maxRetryAttempts, _this2.retryInterval, []).on('error', function (err) {
|
|
599
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught the following error :", err);
|
|
600
|
+
}).end(function (error, response) {
|
|
601
|
+
if (error) {
|
|
602
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught error during the request!");
|
|
603
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, error);
|
|
604
|
+
if (error.response !== null && typeof error.response !== 'undefined') {
|
|
605
|
+
error.data = _assertClassBrand(_ApiClient_brand, _this2, _deserialize).call(_this2, error.response, returnType);
|
|
626
606
|
} else {
|
|
627
|
-
|
|
628
|
-
reject(_objectSpread(_objectSpread({}, response.error), {}, {
|
|
629
|
-
data: data
|
|
630
|
-
}));
|
|
607
|
+
error.data = _assertClassBrand(_ApiClient_brand, _this2, _wrapErrorInResponse).call(_this2, error);
|
|
631
608
|
}
|
|
632
|
-
|
|
633
|
-
_classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Caught error while processing response!");
|
|
634
|
-
_classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).ERROR, null, err);
|
|
635
|
-
err.data = _classPrivateMethodGet(_this2, _wrapErrorInResponse, _wrapErrorInResponse2).call(_this2, err);
|
|
636
|
-
reject(err);
|
|
637
|
-
}
|
|
638
|
-
})["catch"](function (error) {
|
|
639
|
-
_classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Caught error during the request!");
|
|
640
|
-
_classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).ERROR, null, error);
|
|
641
|
-
if (error.response !== null && typeof error.response !== 'undefined') {
|
|
642
|
-
error.data = _classPrivateMethodGet(_this2, _deserialize, _deserialize2).call(_this2, error.response, returnType);
|
|
609
|
+
reject(error);
|
|
643
610
|
} else {
|
|
644
|
-
|
|
611
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Response Status :", response.status);
|
|
612
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, _assertClassBrand(_ApiClient_brand, _this2, _flatten), "Response Headers :", response.headers);
|
|
613
|
+
var _contentType = '';
|
|
614
|
+
if (response.headers.hasOwnProperty('content-type')) {
|
|
615
|
+
_contentType = response.headers["content-type"];
|
|
616
|
+
}
|
|
617
|
+
var fetchStream = binaryMediaTypes.some(function (binaryMediaType) {
|
|
618
|
+
return _contentType.includes(binaryMediaType);
|
|
619
|
+
});
|
|
620
|
+
if (fetchStream) {
|
|
621
|
+
/*
|
|
622
|
+
* Browser environment :
|
|
623
|
+
* uses Web Streams, downloadDestination expected to be a WritableStream (i.e. sink for response to be streamed to)
|
|
624
|
+
* Node.js environment :
|
|
625
|
+
* uses File System, downloadDestination expected to be a directory path, file is downloaded to this directory
|
|
626
|
+
*/
|
|
627
|
+
if (isBrowser) {
|
|
628
|
+
/*
|
|
629
|
+
* Browser environment :
|
|
630
|
+
* - fetch webstream module
|
|
631
|
+
* - write file to WritableStream downloadDestination
|
|
632
|
+
* - if webstream if not available or downloadDestination is not instance of WritableStream
|
|
633
|
+
* code flow goes to main request.then execution
|
|
634
|
+
*/
|
|
635
|
+
if (typeof require === 'function') {
|
|
636
|
+
var _webstream;
|
|
637
|
+
try {
|
|
638
|
+
_webstream = require('stream/web');
|
|
639
|
+
} catch (err) {
|
|
640
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Error fetching steam/web");
|
|
641
|
+
}
|
|
642
|
+
if (_this2.downloadDestination instanceof _webstream.WritableStream) {
|
|
643
|
+
// Piping Data
|
|
644
|
+
var writer = _this2.downloadDestination.getWriter();
|
|
645
|
+
try {
|
|
646
|
+
response.on('data', function (chunk) {
|
|
647
|
+
writer.write(chunk);
|
|
648
|
+
});
|
|
649
|
+
} catch (err) {
|
|
650
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Issue while downloading file", err);
|
|
651
|
+
}
|
|
652
|
+
response.on('end', function () {
|
|
653
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Finished streaming response");
|
|
654
|
+
writer.close();
|
|
655
|
+
var data = _assertClassBrand(_ApiClient_brand, _this2, _deserialize).call(_this2, response, returnType);
|
|
656
|
+
resolve({
|
|
657
|
+
data: data,
|
|
658
|
+
response: response
|
|
659
|
+
});
|
|
660
|
+
}).on('error', function (err) {
|
|
661
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Caught the following error :", err);
|
|
662
|
+
err.data = _assertClassBrand(_ApiClient_brand, _this2, _wrapErrorInResponse).call(_this2, err);
|
|
663
|
+
reject(err);
|
|
664
|
+
});
|
|
665
|
+
} else {
|
|
666
|
+
var errMsg = "Incompatible downloadDestination for Browser Environment, must be WritableStream";
|
|
667
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, errMsg);
|
|
668
|
+
reject(errMsg);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
} else {
|
|
672
|
+
/*
|
|
673
|
+
* Non Browser environment :
|
|
674
|
+
* - stream data to file
|
|
675
|
+
* - fetch response headers and body (if exists)
|
|
676
|
+
* - return in case of error or after stream finish
|
|
677
|
+
*
|
|
678
|
+
* NOTE :
|
|
679
|
+
* superagent does not provide access to headers before pipe, therefore response is piped to
|
|
680
|
+
* file with temporary name, which is renamed to proper filename after Content-Disposition header is available
|
|
681
|
+
*/
|
|
682
|
+
|
|
683
|
+
var tempFilename = _this2.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
|
|
684
|
+
var stream = _fs2["default"].createWriteStream(tempFilename);
|
|
685
|
+
_assertClassBrand(_ApiClient_brand, _this2, _processDownloadedFile).call(_this2, response, stream, tempFilename, resolve, reject, returnType);
|
|
686
|
+
}
|
|
687
|
+
} else if (response.status == 302) {
|
|
688
|
+
/*
|
|
689
|
+
* Handling 302 Redirects
|
|
690
|
+
* - Reads X-Redirect-Token header from response and writes into Cookie header for redirected request
|
|
691
|
+
*/
|
|
692
|
+
var _tempFilename = _this2.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
|
|
693
|
+
var context = _this2;
|
|
694
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Redirecting to :", response.headers.location);
|
|
695
|
+
var redirectRequest = (0, _superagent["default"])(httpMethod, response.headers.location);
|
|
696
|
+
redirectRequest.set(request.header);
|
|
697
|
+
if (response.headers.hasOwnProperty("x-redirect-token")) {
|
|
698
|
+
_assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Writing X-Redirect-Token into Cookie");
|
|
699
|
+
redirectRequest.set("Cookie", response.headers["x-redirect-token"]);
|
|
700
|
+
}
|
|
701
|
+
redirectRequest.redirects(0);
|
|
702
|
+
redirectRequest.buffer(false);
|
|
703
|
+
var redirectedStream = _fs2["default"].createWriteStream(_tempFilename);
|
|
704
|
+
redirectRequest.pipe(redirectedStream);
|
|
705
|
+
redirectRequest.on('response', function (redirectResponse) {
|
|
706
|
+
_assertClassBrand(_ApiClient_brand, context, _log).call(context, _classPrivateFieldGet(_LOG_LEVEL, context).INFO, null, "Received response after redirection :", redirectResponse.status);
|
|
707
|
+
_assertClassBrand(_ApiClient_brand, context, _processDownloadedFile).call(context, redirectResponse, redirectedStream, _tempFilename, resolve, reject, returnType);
|
|
708
|
+
});
|
|
709
|
+
} else {
|
|
710
|
+
_assertClassBrand(_ApiClient_brand, _this2, _handleApiResponseForPromise).call(_this2, response, path, queryParams, returnType, resolve, reject);
|
|
711
|
+
}
|
|
645
712
|
}
|
|
646
|
-
reject(error);
|
|
647
713
|
});
|
|
648
714
|
});
|
|
649
715
|
}
|
|
@@ -673,6 +739,10 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
673
739
|
}
|
|
674
740
|
return null;
|
|
675
741
|
}
|
|
742
|
+
|
|
743
|
+
// Gets a valid timeout
|
|
744
|
+
// 1. Sets to provided default timeout in case invalid value is passed
|
|
745
|
+
// 2. Sets to default max value of 30 minutes in case a value of more than 30 minutes is passed
|
|
676
746
|
}, {
|
|
677
747
|
key: "addEtagReferenceToHeader",
|
|
678
748
|
value: function addEtagReferenceToHeader(bodyParam, headerParams) {
|
|
@@ -810,27 +880,35 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
810
880
|
}
|
|
811
881
|
}
|
|
812
882
|
}]);
|
|
813
|
-
return ApiClient;
|
|
814
883
|
}();
|
|
815
884
|
/**
|
|
816
885
|
* The default API client implementation.
|
|
817
886
|
* @type {ApiClient}
|
|
818
887
|
* @memberOf ApiClient
|
|
819
888
|
*/
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
function _isJsonMime2(contentType) {
|
|
889
|
+
_ApiClient = ApiClient;
|
|
890
|
+
function _isJsonMime(contentType) {
|
|
823
891
|
return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
|
|
824
892
|
}
|
|
825
|
-
|
|
893
|
+
/*
|
|
894
|
+
* Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
|
|
895
|
+
* @param {Array.<String>} contentTypes
|
|
896
|
+
* @returns {String} The chosen content type, preferring JSON.
|
|
897
|
+
*/
|
|
898
|
+
function _jsonPreferredMime(contentTypes) {
|
|
826
899
|
for (var i = 0; i < contentTypes.length; i++) {
|
|
827
|
-
if (
|
|
900
|
+
if (_assertClassBrand(_ApiClient_brand, this, _isJsonMime).call(this, contentTypes[i])) {
|
|
828
901
|
return contentTypes[i];
|
|
829
902
|
}
|
|
830
903
|
}
|
|
831
904
|
return contentTypes[0];
|
|
832
905
|
}
|
|
833
|
-
|
|
906
|
+
/*
|
|
907
|
+
* Checks whether the given parameter value represents file-like content.
|
|
908
|
+
* @param param The parameter to check.
|
|
909
|
+
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
|
910
|
+
*/
|
|
911
|
+
function _isFileParam(param) {
|
|
834
912
|
// fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
|
|
835
913
|
if (typeof require === 'function') {
|
|
836
914
|
var _fs;
|
|
@@ -848,7 +926,7 @@ function _isFileParam2(param) {
|
|
|
848
926
|
}
|
|
849
927
|
|
|
850
928
|
// Blob in browser
|
|
851
|
-
if (typeof Blob === 'function' && param instanceof Blob) {
|
|
929
|
+
if (typeof _buffer.Blob === 'function' && param instanceof _buffer.Blob) {
|
|
852
930
|
return true;
|
|
853
931
|
}
|
|
854
932
|
|
|
@@ -858,12 +936,22 @@ function _isFileParam2(param) {
|
|
|
858
936
|
}
|
|
859
937
|
return false;
|
|
860
938
|
}
|
|
861
|
-
|
|
939
|
+
/*
|
|
940
|
+
* Normalizes parameter values:
|
|
941
|
+
* <ul>
|
|
942
|
+
* <li>remove nils</li>
|
|
943
|
+
* <li>keep files and arrays</li>
|
|
944
|
+
* <li>format to string with `paramToString` for other cases</li>
|
|
945
|
+
* </ul>
|
|
946
|
+
* @param {Object.<String, Object>} params The parameters as object properties.
|
|
947
|
+
* @returns {Object.<String, Object>} normalized parameters.
|
|
948
|
+
*/
|
|
949
|
+
function _normalizeParams(params) {
|
|
862
950
|
var newParams = {};
|
|
863
951
|
for (var key in params) {
|
|
864
952
|
if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
|
|
865
953
|
var value = params[key];
|
|
866
|
-
if (
|
|
954
|
+
if (_assertClassBrand(_ApiClient_brand, this, _isFileParam).call(this, value) || Array.isArray(value)) {
|
|
867
955
|
newParams[key] = value;
|
|
868
956
|
} else {
|
|
869
957
|
newParams[key] = this.paramToString(value);
|
|
@@ -872,7 +960,7 @@ function _normalizeParams2(params) {
|
|
|
872
960
|
}
|
|
873
961
|
return newParams;
|
|
874
962
|
}
|
|
875
|
-
function
|
|
963
|
+
function _applyAuthToRequest(request, authNames) {
|
|
876
964
|
var _this3 = this;
|
|
877
965
|
authNames.forEach(function (authName) {
|
|
878
966
|
var auth = _this3.authentications[authName];
|
|
@@ -883,7 +971,7 @@ function _applyAuthToRequest2(request, authNames) {
|
|
|
883
971
|
} else if (_this3.username || _this3.password) {
|
|
884
972
|
request.auth(_this3.username || '', _this3.password || '');
|
|
885
973
|
}
|
|
886
|
-
|
|
974
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "Basic Auth applied to request");
|
|
887
975
|
break;
|
|
888
976
|
case 'apiKey':
|
|
889
977
|
if (auth.apiKey) {
|
|
@@ -899,7 +987,7 @@ function _applyAuthToRequest2(request, authNames) {
|
|
|
899
987
|
request.query(data);
|
|
900
988
|
}
|
|
901
989
|
}
|
|
902
|
-
|
|
990
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "apiKey applied to request");
|
|
903
991
|
break;
|
|
904
992
|
case 'oauth2':
|
|
905
993
|
if (auth.accessToken) {
|
|
@@ -907,15 +995,20 @@ function _applyAuthToRequest2(request, authNames) {
|
|
|
907
995
|
'Authorization': 'Bearer ' + auth.accessToken
|
|
908
996
|
});
|
|
909
997
|
}
|
|
910
|
-
|
|
998
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "oauth2 applied to request");
|
|
911
999
|
break;
|
|
912
1000
|
default:
|
|
913
|
-
|
|
1001
|
+
_assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).ERROR, null, "Unknown authentication type:", auth.type);
|
|
914
1002
|
throw new Error('Unknown authentication type: ' + auth.type);
|
|
915
1003
|
}
|
|
916
1004
|
});
|
|
917
1005
|
}
|
|
918
|
-
|
|
1006
|
+
/**
|
|
1007
|
+
* Wraps errors in generic response format.
|
|
1008
|
+
* @param {Object} error object encountered during request.
|
|
1009
|
+
* @returns an error object with wrapped response within error.data .
|
|
1010
|
+
*/
|
|
1011
|
+
function _wrapErrorInResponse(error) {
|
|
919
1012
|
var response = {
|
|
920
1013
|
data: {},
|
|
921
1014
|
metadata: {}
|
|
@@ -923,11 +1016,36 @@ function _wrapErrorInResponse2(error) {
|
|
|
923
1016
|
response.data.status = error.status;
|
|
924
1017
|
response.data.message = error.message;
|
|
925
1018
|
}
|
|
926
|
-
|
|
1019
|
+
/**
|
|
1020
|
+
* Deserializes an HTTP response body into a value of the specified type.
|
|
1021
|
+
* @param {Object} response A SuperAgent response object.
|
|
1022
|
+
* @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
|
|
1023
|
+
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
|
|
1024
|
+
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
|
|
1025
|
+
* all properties on <code>data<code> will be converted to this type.
|
|
1026
|
+
* @returns A value of the specified type.
|
|
1027
|
+
*/
|
|
1028
|
+
function _deserialize(response, returnType) {
|
|
927
1029
|
if (response == null || returnType == null || response.status == 204) {
|
|
928
1030
|
return null;
|
|
929
1031
|
}
|
|
930
1032
|
|
|
1033
|
+
// Handle text response
|
|
1034
|
+
if (response.headers && ['text/event-stream', 'text/html', 'text/xml', 'text/csv', 'text/javascript', 'text/markdown', 'text/vcard'].includes(response.headers['content-type'])) {
|
|
1035
|
+
var data = new returnType();
|
|
1036
|
+
data.data = new _buffer.Blob([response.text], {
|
|
1037
|
+
type: response.headers['content-type']
|
|
1038
|
+
});
|
|
1039
|
+
var flag = new _Flag["default"]();
|
|
1040
|
+
flag.name = "hasError";
|
|
1041
|
+
flag.value = false;
|
|
1042
|
+
var flags = [flag];
|
|
1043
|
+
var metadata = new _ApiResponseMetadata["default"]();
|
|
1044
|
+
metadata.flags = flags;
|
|
1045
|
+
data.metadata = metadata;
|
|
1046
|
+
return data;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
931
1049
|
// Rely on SuperAgent for parsing response body.
|
|
932
1050
|
// See http://visionmedia.github.io/superagent/#parsing-response-bodies
|
|
933
1051
|
var data = response.body;
|
|
@@ -935,9 +1053,15 @@ function _deserialize2(response, returnType) {
|
|
|
935
1053
|
// SuperAgent does not always produce a body; use the unparsed response as a fallback
|
|
936
1054
|
data = response.text;
|
|
937
1055
|
}
|
|
938
|
-
return
|
|
1056
|
+
return _ApiClient.convertToType(data, returnType);
|
|
939
1057
|
}
|
|
940
|
-
|
|
1058
|
+
/**
|
|
1059
|
+
* Set pagination data if response is a Paginable object
|
|
1060
|
+
* @param {Object} data The response data already passed through deserialize
|
|
1061
|
+
* @param {String} path The path given to callApi method
|
|
1062
|
+
* @param {Object.<String, Object>} queryParams The queryParams given to callApi method
|
|
1063
|
+
*/
|
|
1064
|
+
function _paginateIfNeeded(data, path, queryParams) {
|
|
941
1065
|
// If response is not a Paginable instance, nothing to do
|
|
942
1066
|
if (!(data instanceof _Paginable["default"])) {
|
|
943
1067
|
return;
|
|
@@ -952,15 +1076,16 @@ function _paginateIfNeeded2(data, path, queryParams) {
|
|
|
952
1076
|
// current ApiClient instance
|
|
953
1077
|
page, resultsPerPage);
|
|
954
1078
|
}
|
|
955
|
-
function
|
|
1079
|
+
function _getValidTimeout(timeout, defaultTimeout) {
|
|
956
1080
|
if (timeout <= 0) {
|
|
957
1081
|
timeout = defaultTimeout;
|
|
958
|
-
} else if (timeout > _classPrivateFieldGet(
|
|
959
|
-
timeout = _classPrivateFieldGet(
|
|
1082
|
+
} else if (timeout > _classPrivateFieldGet(_defaultMaxTimeout, this)) {
|
|
1083
|
+
timeout = _classPrivateFieldGet(_defaultMaxTimeout, this);
|
|
960
1084
|
}
|
|
961
1085
|
return timeout;
|
|
962
1086
|
}
|
|
963
|
-
|
|
1087
|
+
// If enabled, update cookie information to reuse in subsequent requests for a valid response
|
|
1088
|
+
function _updateCookies(response) {
|
|
964
1089
|
if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("set-cookie")) {
|
|
965
1090
|
var finalCookie = "";
|
|
966
1091
|
var cookieList = response.headers["set-cookie"];
|
|
@@ -987,46 +1112,47 @@ function _updateCookies2(response) {
|
|
|
987
1112
|
finalCookie = finalCookie.substr(0, finalCookie.length - 1);
|
|
988
1113
|
}
|
|
989
1114
|
}
|
|
990
|
-
_classPrivateFieldSet(
|
|
991
|
-
|
|
1115
|
+
_classPrivateFieldSet(_cookie, this, finalCookie);
|
|
1116
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Retained cookie :", finalCookie);
|
|
992
1117
|
} else {
|
|
993
|
-
_classPrivateFieldSet(
|
|
1118
|
+
_classPrivateFieldSet(_cookie, this, null);
|
|
994
1119
|
}
|
|
995
1120
|
}
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1121
|
+
// If enabled, attach saved cookies to request
|
|
1122
|
+
function _attachCookies(request) {
|
|
1123
|
+
if (_classPrivateFieldGet(_cookie, this) != null) {
|
|
1124
|
+
request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
|
|
1125
|
+
'Cookie': _classPrivateFieldGet(_cookie, this)
|
|
1000
1126
|
}));
|
|
1001
1127
|
}
|
|
1002
1128
|
}
|
|
1003
|
-
function
|
|
1129
|
+
function _log(level, mapper) {
|
|
1004
1130
|
for (var _len = arguments.length, messages = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1005
1131
|
messages[_key - 2] = arguments[_key];
|
|
1006
1132
|
}
|
|
1007
1133
|
// Set default log level to INFO
|
|
1008
1134
|
if (_typeof(level) !== "object" || !("key" in level) || !("value" in level) || _typeof(level["value"]) !== "symbol") {
|
|
1009
|
-
level = _classPrivateFieldGet(
|
|
1135
|
+
level = _classPrivateFieldGet(_LOG_LEVEL, this).INFO;
|
|
1010
1136
|
}
|
|
1011
|
-
if (!
|
|
1137
|
+
if (!_assertClassBrand(_ApiClient_brand, this, _skipLogging).call(this, level)) {
|
|
1012
1138
|
// Preprocess message to prefix with timestamp and log level
|
|
1013
1139
|
messages = messages.map(function (message) {
|
|
1014
1140
|
return typeof message === "string" ? message : mapper ? mapper(message) : JSON.stringify(message);
|
|
1015
1141
|
});
|
|
1016
1142
|
var message = messages.join(' ');
|
|
1017
|
-
message =
|
|
1018
|
-
if (typeof _classPrivateFieldGet(
|
|
1019
|
-
_classPrivateFieldGet(
|
|
1143
|
+
message = _assertClassBrand(_ApiClient_brand, this, _getLocalDateTime).call(this) + ' ' + level.key + ' - ' + message;
|
|
1144
|
+
if (typeof _classPrivateFieldGet(_logger, this) !== "undefined" && _classPrivateFieldGet(_logger, this) !== null && typeof _classPrivateFieldGet(_logger, this).log === 'function') {
|
|
1145
|
+
_classPrivateFieldGet(_logger, this).log(message);
|
|
1020
1146
|
} else {
|
|
1021
1147
|
console.log(message);
|
|
1022
1148
|
}
|
|
1023
1149
|
}
|
|
1024
1150
|
}
|
|
1025
|
-
function
|
|
1151
|
+
function _skipLogging(level) {
|
|
1026
1152
|
// Skip logging if log level is DEBUG but debug is not enabled.
|
|
1027
|
-
return !this.debug && level === _classPrivateFieldGet(
|
|
1153
|
+
return !this.debug && level === _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG;
|
|
1028
1154
|
}
|
|
1029
|
-
function
|
|
1155
|
+
function _getLocalDateTime() {
|
|
1030
1156
|
// Current epoch UTC time in milliseconds
|
|
1031
1157
|
var epochTime = Date.now();
|
|
1032
1158
|
|
|
@@ -1041,7 +1167,8 @@ function _getLocalDateTime2() {
|
|
|
1041
1167
|
var date = new Date(epochTime - timezoneOffsetInMilliseconds);
|
|
1042
1168
|
return date.toISOString().slice(0, 23);
|
|
1043
1169
|
}
|
|
1044
|
-
function
|
|
1170
|
+
// A mapper function to flatten a simple non-nested (key:value) object to string
|
|
1171
|
+
function _flatten(obj) {
|
|
1045
1172
|
if (_typeof(obj) !== "object") {
|
|
1046
1173
|
return obj;
|
|
1047
1174
|
}
|
|
@@ -1053,4 +1180,92 @@ function _flatten2(obj) {
|
|
|
1053
1180
|
}
|
|
1054
1181
|
return output === '\n' ? obj : output;
|
|
1055
1182
|
}
|
|
1183
|
+
// handle and deserialize received response
|
|
1184
|
+
function _handleApiResponseForPromise(response, path, queryParams, returnType, resolve, reject) {
|
|
1185
|
+
try {
|
|
1186
|
+
var data = _assertClassBrand(_ApiClient_brand, this, _deserialize).call(this, response, returnType);
|
|
1187
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Response Status :", response.status);
|
|
1188
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Response Headers :", response.headers);
|
|
1189
|
+
_assertClassBrand(_ApiClient_brand, this, _updateCookies).call(this, response || {});
|
|
1190
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Response Body :", data);
|
|
1191
|
+
if (response.status == 204 && data == null) {
|
|
1192
|
+
resolve({
|
|
1193
|
+
data: data,
|
|
1194
|
+
response: response
|
|
1195
|
+
});
|
|
1196
|
+
} else if (response.ok && data != null) {
|
|
1197
|
+
this.addEtagToReservedMap(response, data);
|
|
1198
|
+
_assertClassBrand(_ApiClient_brand, this, _paginateIfNeeded).call(this, data, path, queryParams);
|
|
1199
|
+
resolve({
|
|
1200
|
+
data: data,
|
|
1201
|
+
response: response
|
|
1202
|
+
});
|
|
1203
|
+
} else {
|
|
1204
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, data);
|
|
1205
|
+
reject(_objectSpread(_objectSpread({}, response.error), {}, {
|
|
1206
|
+
data: data
|
|
1207
|
+
}));
|
|
1208
|
+
}
|
|
1209
|
+
} catch (err) {
|
|
1210
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Caught error while processing response!");
|
|
1211
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, err);
|
|
1212
|
+
err.data = _assertClassBrand(_ApiClient_brand, this, _wrapErrorInResponse).call(this, err);
|
|
1213
|
+
reject(err);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
function _processDownloadedFile(response, stream, tempFilename, resolve, reject, returnType) {
|
|
1217
|
+
var _this4 = this;
|
|
1218
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Streaming response to : ", tempFilename);
|
|
1219
|
+
try {
|
|
1220
|
+
response.on('data', function (chunk) {
|
|
1221
|
+
stream.write(chunk);
|
|
1222
|
+
});
|
|
1223
|
+
} catch (err) {
|
|
1224
|
+
_assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Issue while downloading file", err);
|
|
1225
|
+
}
|
|
1226
|
+
var data = new returnType();
|
|
1227
|
+
// Fetch filename
|
|
1228
|
+
var filename = "";
|
|
1229
|
+
if (typeof response.headers['content-disposition'] !== 'undefined' && response.headers['content-disposition'] !== null) {
|
|
1230
|
+
var match = response.headers['content-disposition'].match(/*#__PURE__*/_wrapRegExp(/.*filename="(.*)".*/, {
|
|
1231
|
+
filename: 1
|
|
1232
|
+
}));
|
|
1233
|
+
var filepath = _path["default"].parse(match.groups['filename']);
|
|
1234
|
+
filename = this.downloadDestination + '/' + filepath.name + '_' + Date.now() + filepath.ext;
|
|
1235
|
+
data.data = {
|
|
1236
|
+
"path": _path["default"].parse(filename),
|
|
1237
|
+
$objectType: "Path"
|
|
1238
|
+
};
|
|
1239
|
+
var flag = new _Flag["default"]();
|
|
1240
|
+
flag.name = "hasError";
|
|
1241
|
+
flag.value = false;
|
|
1242
|
+
var flags = [flag];
|
|
1243
|
+
var metadata = new _ApiResponseMetadata["default"]();
|
|
1244
|
+
metadata.flags = flags;
|
|
1245
|
+
data.metadata = metadata;
|
|
1246
|
+
}
|
|
1247
|
+
response.on('end', function () {
|
|
1248
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).INFO, null, "Finished streaming response");
|
|
1249
|
+
if (filename.length !== 0) {
|
|
1250
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).INFO, null, "Content-Disposition header found [", filename, "] is final filename");
|
|
1251
|
+
stream.close();
|
|
1252
|
+
_fs2["default"].renameSync(tempFilename, filename);
|
|
1253
|
+
resolve({
|
|
1254
|
+
data: data,
|
|
1255
|
+
response: response
|
|
1256
|
+
});
|
|
1257
|
+
} else {
|
|
1258
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).ERROR, null, "Content-Disposition header not found [", tempFilename, "] is final filename");
|
|
1259
|
+
resolve({
|
|
1260
|
+
data: data,
|
|
1261
|
+
response: response
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
response.on('error', function (err) {
|
|
1266
|
+
_assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).ERROR, null, "Caught the following error :", err);
|
|
1267
|
+
error.data = _assertClassBrand(_ApiClient_brand, _this4, _wrapErrorInResponse).call(_this4, error);
|
|
1268
|
+
reject(err);
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1056
1271
|
ApiClient.instance = new ApiClient();
|