@azure/cosmos 4.2.0-beta.1 → 4.2.0
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/CHANGELOG.md +4 -5
- package/dist/index.js +351 -750
- package/dist/index.js.map +1 -1
- package/dist/types/latest/cosmos.d.ts +25 -21
- package/dist-esm/src/ChangeFeedIterator.d.ts +1 -1
- package/dist-esm/src/ChangeFeedIterator.d.ts.map +1 -1
- package/dist-esm/src/ChangeFeedIterator.js.map +1 -1
- package/dist-esm/src/ChangeFeedResponse.d.ts +2 -2
- package/dist-esm/src/ChangeFeedResponse.d.ts.map +1 -1
- package/dist-esm/src/ChangeFeedResponse.js.map +1 -1
- package/dist-esm/src/ClientContext.d.ts +12 -11
- package/dist-esm/src/ClientContext.d.ts.map +1 -1
- package/dist-esm/src/ClientContext.js +3 -3
- package/dist-esm/src/ClientContext.js.map +1 -1
- package/dist-esm/src/CosmosClient.d.ts +5 -4
- package/dist-esm/src/CosmosClient.d.ts.map +1 -1
- package/dist-esm/src/CosmosClient.js.map +1 -1
- package/dist-esm/src/CosmosClientOptions.d.ts +7 -7
- package/dist-esm/src/CosmosClientOptions.d.ts.map +1 -1
- package/dist-esm/src/CosmosClientOptions.js.map +1 -1
- package/dist-esm/src/CosmosDiagnostics.d.ts +4 -4
- package/dist-esm/src/CosmosDiagnostics.d.ts.map +1 -1
- package/dist-esm/src/CosmosDiagnostics.js.map +1 -1
- package/dist-esm/src/auth.d.ts +4 -3
- package/dist-esm/src/auth.d.ts.map +1 -1
- package/dist-esm/src/auth.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedForEpkRange.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedIteratorResponse.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedIteratorResponse.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedPolicy.d.ts +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedPolicy.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedPullModelIterator.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedPullModelIterator.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedPullModelIterator.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFrom.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFrom.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFrom.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromBeginning.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromBeginning.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromNow.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromNow.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromTime.d.ts +2 -2
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromTime.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/InternalChangeFeedOptions.d.ts +1 -1
- package/dist-esm/src/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/changeFeedIteratorBuilder.d.ts +4 -4
- package/dist-esm/src/client/ChangeFeed/changeFeedIteratorBuilder.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/changeFeedIteratorBuilder.js.map +1 -1
- package/dist-esm/src/client/ChangeFeed/changeFeedUtils.d.ts +5 -5
- package/dist-esm/src/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist-esm/src/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist-esm/src/client/ClientUtils.d.ts +3 -3
- package/dist-esm/src/client/ClientUtils.d.ts.map +1 -1
- package/dist-esm/src/client/ClientUtils.js.map +1 -1
- package/dist-esm/src/client/Conflict/Conflict.d.ts +4 -4
- package/dist-esm/src/client/Conflict/Conflict.d.ts.map +1 -1
- package/dist-esm/src/client/Conflict/Conflict.js.map +1 -1
- package/dist-esm/src/client/Conflict/ConflictDefinition.d.ts +1 -1
- package/dist-esm/src/client/Conflict/ConflictDefinition.d.ts.map +1 -1
- package/dist-esm/src/client/Conflict/ConflictDefinition.js.map +1 -1
- package/dist-esm/src/client/Conflict/ConflictResolutionPolicy.d.ts +1 -1
- package/dist-esm/src/client/Conflict/ConflictResolutionPolicy.d.ts.map +1 -1
- package/dist-esm/src/client/Conflict/ConflictResolutionPolicy.js.map +1 -1
- package/dist-esm/src/client/Conflict/ConflictResponse.d.ts +5 -5
- package/dist-esm/src/client/Conflict/ConflictResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Conflict/ConflictResponse.js.map +1 -1
- package/dist-esm/src/client/Conflict/Conflicts.d.ts +6 -6
- package/dist-esm/src/client/Conflict/Conflicts.d.ts.map +1 -1
- package/dist-esm/src/client/Conflict/Conflicts.js.map +1 -1
- package/dist-esm/src/client/Container/Container.d.ts +12 -11
- package/dist-esm/src/client/Container/Container.d.ts.map +1 -1
- package/dist-esm/src/client/Container/Container.js.map +1 -1
- package/dist-esm/src/client/Container/ContainerDefinition.d.ts +8 -8
- package/dist-esm/src/client/Container/ContainerDefinition.d.ts.map +1 -1
- package/dist-esm/src/client/Container/ContainerDefinition.js.map +1 -1
- package/dist-esm/src/client/Container/ContainerRequest.d.ts +3 -3
- package/dist-esm/src/client/Container/ContainerRequest.d.ts.map +1 -1
- package/dist-esm/src/client/Container/ContainerRequest.js.map +1 -1
- package/dist-esm/src/client/Container/ContainerResponse.d.ts +5 -5
- package/dist-esm/src/client/Container/ContainerResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Container/ContainerResponse.js.map +1 -1
- package/dist-esm/src/client/Container/Containers.d.ts +8 -8
- package/dist-esm/src/client/Container/Containers.d.ts.map +1 -1
- package/dist-esm/src/client/Container/Containers.js.map +1 -1
- package/dist-esm/src/client/Database/Database.d.ts +4 -4
- package/dist-esm/src/client/Database/Database.d.ts.map +1 -1
- package/dist-esm/src/client/Database/Database.js.map +1 -1
- package/dist-esm/src/client/Database/DatabaseRequest.d.ts +1 -1
- package/dist-esm/src/client/Database/DatabaseRequest.d.ts.map +1 -1
- package/dist-esm/src/client/Database/DatabaseRequest.js.map +1 -1
- package/dist-esm/src/client/Database/DatabaseResponse.d.ts +5 -5
- package/dist-esm/src/client/Database/DatabaseResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Database/DatabaseResponse.js.map +1 -1
- package/dist-esm/src/client/Database/Databases.d.ts +8 -8
- package/dist-esm/src/client/Database/Databases.d.ts.map +1 -1
- package/dist-esm/src/client/Database/Databases.js.map +1 -1
- package/dist-esm/src/client/Item/Item.d.ts +6 -6
- package/dist-esm/src/client/Item/Item.d.ts.map +1 -1
- package/dist-esm/src/client/Item/Item.js.map +1 -1
- package/dist-esm/src/client/Item/ItemResponse.d.ts +5 -5
- package/dist-esm/src/client/Item/ItemResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Item/ItemResponse.js.map +1 -1
- package/dist-esm/src/client/Item/Items.d.ts +9 -9
- package/dist-esm/src/client/Item/Items.d.ts.map +1 -1
- package/dist-esm/src/client/Item/Items.js +2 -2
- package/dist-esm/src/client/Item/Items.js.map +1 -1
- package/dist-esm/src/client/Offer/Offer.d.ts +4 -4
- package/dist-esm/src/client/Offer/Offer.d.ts.map +1 -1
- package/dist-esm/src/client/Offer/Offer.js.map +1 -1
- package/dist-esm/src/client/Offer/OfferResponse.d.ts +5 -5
- package/dist-esm/src/client/Offer/OfferResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Offer/OfferResponse.js.map +1 -1
- package/dist-esm/src/client/Offer/Offers.d.ts +6 -6
- package/dist-esm/src/client/Offer/Offers.d.ts.map +1 -1
- package/dist-esm/src/client/Offer/Offers.js.map +1 -1
- package/dist-esm/src/client/Permission/Permission.d.ts +4 -4
- package/dist-esm/src/client/Permission/Permission.d.ts.map +1 -1
- package/dist-esm/src/client/Permission/Permission.js.map +1 -1
- package/dist-esm/src/client/Permission/PermissionDefinition.d.ts +1 -1
- package/dist-esm/src/client/Permission/PermissionDefinition.d.ts.map +1 -1
- package/dist-esm/src/client/Permission/PermissionDefinition.js.map +1 -1
- package/dist-esm/src/client/Permission/PermissionResponse.d.ts +6 -6
- package/dist-esm/src/client/Permission/PermissionResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Permission/PermissionResponse.js.map +1 -1
- package/dist-esm/src/client/Permission/Permissions.d.ts +6 -6
- package/dist-esm/src/client/Permission/Permissions.d.ts.map +1 -1
- package/dist-esm/src/client/Permission/Permissions.js.map +1 -1
- package/dist-esm/src/client/SasToken/SasTokenProperties.d.ts +2 -2
- package/dist-esm/src/client/SasToken/SasTokenProperties.d.ts.map +1 -1
- package/dist-esm/src/client/SasToken/SasTokenProperties.js.map +1 -1
- package/dist-esm/src/client/Script/Scripts.d.ts +2 -2
- package/dist-esm/src/client/Script/Scripts.d.ts.map +1 -1
- package/dist-esm/src/client/Script/Scripts.js.map +1 -1
- package/dist-esm/src/client/StoredProcedure/StoredProcedure.d.ts +6 -5
- package/dist-esm/src/client/StoredProcedure/StoredProcedure.d.ts.map +1 -1
- package/dist-esm/src/client/StoredProcedure/StoredProcedure.js.map +1 -1
- package/dist-esm/src/client/StoredProcedure/StoredProcedureResponse.d.ts +5 -5
- package/dist-esm/src/client/StoredProcedure/StoredProcedureResponse.d.ts.map +1 -1
- package/dist-esm/src/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
- package/dist-esm/src/client/StoredProcedure/StoredProcedures.d.ts +6 -6
- package/dist-esm/src/client/StoredProcedure/StoredProcedures.d.ts.map +1 -1
- package/dist-esm/src/client/StoredProcedure/StoredProcedures.js.map +1 -1
- package/dist-esm/src/client/Trigger/Trigger.d.ts +4 -4
- package/dist-esm/src/client/Trigger/Trigger.d.ts.map +1 -1
- package/dist-esm/src/client/Trigger/Trigger.js.map +1 -1
- package/dist-esm/src/client/Trigger/TriggerDefinition.d.ts +1 -1
- package/dist-esm/src/client/Trigger/TriggerDefinition.d.ts.map +1 -1
- package/dist-esm/src/client/Trigger/TriggerDefinition.js.map +1 -1
- package/dist-esm/src/client/Trigger/TriggerResponse.d.ts +5 -5
- package/dist-esm/src/client/Trigger/TriggerResponse.d.ts.map +1 -1
- package/dist-esm/src/client/Trigger/TriggerResponse.js.map +1 -1
- package/dist-esm/src/client/Trigger/Triggers.d.ts +6 -6
- package/dist-esm/src/client/Trigger/Triggers.d.ts.map +1 -1
- package/dist-esm/src/client/Trigger/Triggers.js.map +1 -1
- package/dist-esm/src/client/User/User.d.ts +4 -4
- package/dist-esm/src/client/User/User.d.ts.map +1 -1
- package/dist-esm/src/client/User/User.js.map +1 -1
- package/dist-esm/src/client/User/UserResponse.d.ts +5 -5
- package/dist-esm/src/client/User/UserResponse.d.ts.map +1 -1
- package/dist-esm/src/client/User/UserResponse.js.map +1 -1
- package/dist-esm/src/client/User/Users.d.ts +6 -6
- package/dist-esm/src/client/User/Users.d.ts.map +1 -1
- package/dist-esm/src/client/User/Users.js.map +1 -1
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunction.d.ts +4 -4
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunction.d.ts.map +1 -1
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunctionResponse.d.ts +5 -5
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunctionResponse.d.ts.map +1 -1
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunctions.d.ts +6 -6
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunctions.d.ts.map +1 -1
- package/dist-esm/src/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
- package/dist-esm/src/common/constants.d.ts +0 -1
- package/dist-esm/src/common/constants.d.ts.map +1 -1
- package/dist-esm/src/common/constants.js +1 -2
- package/dist-esm/src/common/constants.js.map +1 -1
- package/dist-esm/src/common/helper.d.ts +3 -2
- package/dist-esm/src/common/helper.d.ts.map +1 -1
- package/dist-esm/src/common/helper.js.map +1 -1
- package/dist-esm/src/common/index.d.ts +0 -1
- package/dist-esm/src/common/index.d.ts.map +1 -1
- package/dist-esm/src/common/index.js +0 -1
- package/dist-esm/src/common/index.js.map +1 -1
- package/dist-esm/src/common/logger.d.ts +1 -1
- package/dist-esm/src/common/logger.d.ts.map +1 -1
- package/dist-esm/src/common/logger.js +0 -2
- package/dist-esm/src/common/logger.js.map +1 -1
- package/dist-esm/src/diagnostics/CosmosDiagnosticsContext.d.ts +1 -1
- package/dist-esm/src/diagnostics/CosmosDiagnosticsContext.d.ts.map +1 -1
- package/dist-esm/src/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
- package/dist-esm/src/diagnostics/DiagnosticFormatter.d.ts +1 -1
- package/dist-esm/src/diagnostics/DiagnosticFormatter.d.ts.map +1 -1
- package/dist-esm/src/diagnostics/DiagnosticFormatter.js.map +1 -1
- package/dist-esm/src/diagnostics/DiagnosticNodeInternal.d.ts +3 -3
- package/dist-esm/src/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
- package/dist-esm/src/diagnostics/DiagnosticNodeInternal.js +1 -1
- package/dist-esm/src/diagnostics/DiagnosticNodeInternal.js.map +1 -1
- package/dist-esm/src/diagnostics/DiagnosticWriter.d.ts.map +1 -1
- package/dist-esm/src/diagnostics/DiagnosticWriter.js.map +1 -1
- package/dist-esm/src/documents/ConnectionPolicy.d.ts +1 -1
- package/dist-esm/src/documents/ConnectionPolicy.d.ts.map +1 -1
- package/dist-esm/src/documents/ConnectionPolicy.js.map +1 -1
- package/dist-esm/src/documents/DatabaseAccount.d.ts +1 -1
- package/dist-esm/src/documents/DatabaseAccount.d.ts.map +1 -1
- package/dist-esm/src/documents/DatabaseAccount.js.map +1 -1
- package/dist-esm/src/documents/IndexingPolicy.d.ts +19 -1
- package/dist-esm/src/documents/IndexingPolicy.d.ts.map +1 -1
- package/dist-esm/src/documents/IndexingPolicy.js.map +1 -1
- package/dist-esm/src/documents/PartitionKeyDefinition.d.ts +2 -2
- package/dist-esm/src/documents/PartitionKeyDefinition.d.ts.map +1 -1
- package/dist-esm/src/documents/PartitionKeyDefinition.js.map +1 -1
- package/dist-esm/src/documents/PartitionKeyInternal.d.ts +1 -1
- package/dist-esm/src/documents/PartitionKeyInternal.d.ts.map +1 -1
- package/dist-esm/src/documents/PartitionKeyInternal.js.map +1 -1
- package/dist-esm/src/extractPartitionKey.d.ts +3 -3
- package/dist-esm/src/extractPartitionKey.d.ts.map +1 -1
- package/dist-esm/src/extractPartitionKey.js +0 -2
- package/dist-esm/src/extractPartitionKey.js.map +1 -1
- package/dist-esm/src/globalEndpointManager.d.ts +1 -1
- package/dist-esm/src/globalEndpointManager.d.ts.map +1 -1
- package/dist-esm/src/globalEndpointManager.js.map +1 -1
- package/dist-esm/src/indexMetrics/IndexMetricWriter.d.ts +1 -1
- package/dist-esm/src/indexMetrics/IndexMetricWriter.d.ts.map +1 -1
- package/dist-esm/src/indexMetrics/IndexMetricWriter.js.map +1 -1
- package/dist-esm/src/indexMetrics/IndexUtilizationInfo.d.ts +2 -2
- package/dist-esm/src/indexMetrics/IndexUtilizationInfo.d.ts.map +1 -1
- package/dist-esm/src/indexMetrics/IndexUtilizationInfo.js.map +1 -1
- package/dist-esm/src/plugins/Plugin.d.ts +3 -3
- package/dist-esm/src/plugins/Plugin.d.ts.map +1 -1
- package/dist-esm/src/plugins/Plugin.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/AverageAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/AverageAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/CountAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/CountAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MakeListAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MakeListAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MakeSetAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MakeSetAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MaxAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MinAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/StaticValueAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/StaticValueAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/SumAggregator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/SumAggregator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/index.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/index.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/Aggregators/index.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts +5 -4
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +39 -52
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts +5 -4
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +30 -43
- package/dist-esm/src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -41
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +46 -54
- package/dist-esm/src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +11 -28
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +12 -25
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +8 -21
- package/dist-esm/src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +8 -23
- package/dist-esm/src/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/ExecutionContext.d.ts +4 -10
- package/dist-esm/src/queryExecutionContext/ExecutionContext.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/ExecutionContext.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/defaultQueryExecutionContext.d.ts +6 -6
- package/dist-esm/src/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/defaultQueryExecutionContext.js +8 -34
- package/dist-esm/src/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/documentProducer.d.ts +10 -9
- package/dist-esm/src/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/documentProducer.js +8 -24
- package/dist-esm/src/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/hybridQueryExecutionContext.d.ts +4 -3
- package/dist-esm/src/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/hybridQueryExecutionContext.js +21 -75
- package/dist-esm/src/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/nonStreamingOrderByResponse.d.ts +2 -2
- package/dist-esm/src/queryExecutionContext/nonStreamingOrderByResponse.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/nonStreamingOrderByResponse.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/orderByComparator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/orderByDocumentProducerComparator.d.ts +1 -1
- package/dist-esm/src/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/orderByQueryExecutionContext.d.ts +6 -6
- package/dist-esm/src/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContext.d.ts +2 -2
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +10 -19
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContextBase.js +105 -167
- package/dist-esm/src/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist-esm/src/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +8 -7
- package/dist-esm/src/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist-esm/src/queryExecutionContext/pipelinedQueryExecutionContext.js +12 -60
- package/dist-esm/src/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist-esm/src/queryIterator.d.ts +7 -8
- package/dist-esm/src/queryIterator.d.ts.map +1 -1
- package/dist-esm/src/queryIterator.js +18 -64
- package/dist-esm/src/queryIterator.js.map +1 -1
- package/dist-esm/src/request/ErrorResponse.d.ts +1 -1
- package/dist-esm/src/request/ErrorResponse.d.ts.map +1 -1
- package/dist-esm/src/request/ErrorResponse.js.map +1 -1
- package/dist-esm/src/request/FeedOptions.d.ts +2 -2
- package/dist-esm/src/request/FeedOptions.d.ts.map +1 -1
- package/dist-esm/src/request/FeedOptions.js.map +1 -1
- package/dist-esm/src/request/FeedResponse.d.ts +2 -2
- package/dist-esm/src/request/FeedResponse.d.ts.map +1 -1
- package/dist-esm/src/request/FeedResponse.js.map +1 -1
- package/dist-esm/src/request/RequestContext.d.ts +10 -10
- package/dist-esm/src/request/RequestContext.d.ts.map +1 -1
- package/dist-esm/src/request/RequestContext.js.map +1 -1
- package/dist-esm/src/request/RequestHandler.d.ts +3 -3
- package/dist-esm/src/request/RequestHandler.d.ts.map +1 -1
- package/dist-esm/src/request/RequestHandler.js +1 -1
- package/dist-esm/src/request/RequestHandler.js.map +1 -1
- package/dist-esm/src/request/RequestOptions.d.ts +1 -1
- package/dist-esm/src/request/RequestOptions.d.ts.map +1 -1
- package/dist-esm/src/request/RequestOptions.js.map +1 -1
- package/dist-esm/src/request/ResourceResponse.d.ts +3 -3
- package/dist-esm/src/request/ResourceResponse.d.ts.map +1 -1
- package/dist-esm/src/request/ResourceResponse.js.map +1 -1
- package/dist-esm/src/request/Response.d.ts +1 -1
- package/dist-esm/src/request/Response.d.ts.map +1 -1
- package/dist-esm/src/request/Response.js.map +1 -1
- package/dist-esm/src/request/SharedOptions.d.ts +2 -2
- package/dist-esm/src/request/SharedOptions.d.ts.map +1 -1
- package/dist-esm/src/request/SharedOptions.js.map +1 -1
- package/dist-esm/src/request/defaultAgent.browser.d.ts +1 -1
- package/dist-esm/src/request/defaultAgent.browser.d.ts.map +1 -1
- package/dist-esm/src/request/defaultAgent.browser.js.map +1 -1
- package/dist-esm/src/request/defaultAgent.d.ts +1 -1
- package/dist-esm/src/request/defaultAgent.d.ts.map +1 -1
- package/dist-esm/src/request/defaultAgent.js.map +1 -1
- package/dist-esm/src/request/index.d.ts +0 -2
- package/dist-esm/src/request/index.d.ts.map +1 -1
- package/dist-esm/src/request/index.js +0 -1
- package/dist-esm/src/request/index.js.map +1 -1
- package/dist-esm/src/request/request.d.ts +4 -4
- package/dist-esm/src/request/request.d.ts.map +1 -1
- package/dist-esm/src/request/request.js.map +1 -1
- package/dist-esm/src/retry/RetryPolicy.d.ts +3 -3
- package/dist-esm/src/retry/RetryPolicy.d.ts.map +1 -1
- package/dist-esm/src/retry/RetryPolicy.js.map +1 -1
- package/dist-esm/src/retry/defaultRetryPolicy.d.ts +3 -3
- package/dist-esm/src/retry/defaultRetryPolicy.d.ts.map +1 -1
- package/dist-esm/src/retry/defaultRetryPolicy.js.map +1 -1
- package/dist-esm/src/retry/endpointDiscoveryRetryPolicy.d.ts +6 -6
- package/dist-esm/src/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
- package/dist-esm/src/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
- package/dist-esm/src/retry/resourceThrottleRetryPolicy.d.ts +2 -2
- package/dist-esm/src/retry/resourceThrottleRetryPolicy.d.ts.map +1 -1
- package/dist-esm/src/retry/resourceThrottleRetryPolicy.js.map +1 -1
- package/dist-esm/src/retry/retryUtility.d.ts +4 -4
- package/dist-esm/src/retry/retryUtility.d.ts.map +1 -1
- package/dist-esm/src/retry/retryUtility.js.map +1 -1
- package/dist-esm/src/retry/sessionRetryPolicy.d.ts +7 -7
- package/dist-esm/src/retry/sessionRetryPolicy.d.ts.map +1 -1
- package/dist-esm/src/retry/sessionRetryPolicy.js.map +1 -1
- package/dist-esm/src/retry/timeoutFailoverRetryPolicy.d.ts +7 -7
- package/dist-esm/src/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
- package/dist-esm/src/retry/timeoutFailoverRetryPolicy.js.map +1 -1
- package/dist-esm/src/routing/QueryRange.d.ts +2 -2
- package/dist-esm/src/routing/QueryRange.d.ts.map +1 -1
- package/dist-esm/src/routing/QueryRange.js.map +1 -1
- package/dist-esm/src/routing/inMemoryCollectionRoutingMap.d.ts +1 -1
- package/dist-esm/src/routing/inMemoryCollectionRoutingMap.d.ts.map +1 -1
- package/dist-esm/src/routing/inMemoryCollectionRoutingMap.js.map +1 -1
- package/dist-esm/src/routing/partitionKeyRangeCache.d.ts +5 -5
- package/dist-esm/src/routing/partitionKeyRangeCache.d.ts.map +1 -1
- package/dist-esm/src/routing/partitionKeyRangeCache.js.map +1 -1
- package/dist-esm/src/routing/smartRoutingMapProvider.d.ts +2 -2
- package/dist-esm/src/routing/smartRoutingMapProvider.d.ts.map +1 -1
- package/dist-esm/src/routing/smartRoutingMapProvider.js.map +1 -1
- package/dist-esm/src/session/SessionContext.d.ts +1 -1
- package/dist-esm/src/session/SessionContext.d.ts.map +1 -1
- package/dist-esm/src/session/SessionContext.js.map +1 -1
- package/dist-esm/src/session/sessionContainer.d.ts +2 -2
- package/dist-esm/src/session/sessionContainer.d.ts.map +1 -1
- package/dist-esm/src/session/sessionContainer.js.map +1 -1
- package/dist-esm/src/utils/SasToken.d.ts +1 -1
- package/dist-esm/src/utils/SasToken.d.ts.map +1 -1
- package/dist-esm/src/utils/SasToken.js.map +1 -1
- package/dist-esm/src/utils/batch.d.ts +4 -4
- package/dist-esm/src/utils/batch.d.ts.map +1 -1
- package/dist-esm/src/utils/batch.js +1 -1
- package/dist-esm/src/utils/batch.js.map +1 -1
- package/dist-esm/src/utils/cachedClient.d.ts +1 -1
- package/dist-esm/src/utils/cachedClient.d.ts.map +1 -1
- package/dist-esm/src/utils/cachedClient.js.map +1 -1
- package/dist-esm/src/utils/diagnostics.d.ts +5 -3
- package/dist-esm/src/utils/diagnostics.d.ts.map +1 -1
- package/dist-esm/src/utils/diagnostics.js +1 -1
- package/dist-esm/src/utils/diagnostics.js.map +1 -1
- package/dist-esm/src/utils/hashing/hash.d.ts +1 -1
- package/dist-esm/src/utils/hashing/hash.d.ts.map +1 -1
- package/dist-esm/src/utils/hashing/hash.js +1 -1
- package/dist-esm/src/utils/hashing/hash.js.map +1 -1
- package/dist-esm/src/utils/hashing/multiHash.d.ts +1 -1
- package/dist-esm/src/utils/hashing/multiHash.d.ts.map +1 -1
- package/dist-esm/src/utils/hashing/multiHash.js.map +1 -1
- package/dist-esm/src/utils/hashing/v1.d.ts +1 -1
- package/dist-esm/src/utils/hashing/v1.d.ts.map +1 -1
- package/dist-esm/src/utils/hashing/v1.js.map +1 -1
- package/dist-esm/src/utils/hashing/v2.d.ts +1 -1
- package/dist-esm/src/utils/hashing/v2.d.ts.map +1 -1
- package/dist-esm/src/utils/hashing/v2.js.map +1 -1
- package/dist-esm/src/utils/headers.d.ts +2 -1
- package/dist-esm/src/utils/headers.d.ts.map +1 -1
- package/dist-esm/src/utils/headers.js.map +1 -1
- package/dist-esm/src/utils/offers.d.ts +1 -1
- package/dist-esm/src/utils/offers.d.ts.map +1 -1
- package/dist-esm/src/utils/offers.js.map +1 -1
- package/dist-esm/src/utils/typeChecks.d.ts.map +1 -1
- package/dist-esm/src/utils/typeChecks.js +1 -1
- package/dist-esm/src/utils/typeChecks.js.map +1 -1
- package/package.json +4 -4
- package/dist-esm/src/common/RUConsumedManager.d.ts +0 -13
- package/dist-esm/src/common/RUConsumedManager.d.ts.map +0 -1
- package/dist-esm/src/common/RUConsumedManager.js +0 -32
- package/dist-esm/src/common/RUConsumedManager.js.map +0 -1
- package/dist-esm/src/request/OperationOptions.d.ts +0 -7
- package/dist-esm/src/request/OperationOptions.d.ts.map +0 -1
- package/dist-esm/src/request/OperationOptions.js +0 -4
- package/dist-esm/src/request/OperationOptions.js.map +0 -1
- package/dist-esm/src/request/RUCapPerOperationExceededError.d.ts +0 -11
- package/dist-esm/src/request/RUCapPerOperationExceededError.d.ts.map +0 -1
- package/dist-esm/src/request/RUCapPerOperationExceededError.js +0 -20
- package/dist-esm/src/request/RUCapPerOperationExceededError.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ClientContext } from "../../ClientContext";
|
|
2
|
-
import { PartitionKey } from "../../documents";
|
|
3
|
-
import { RequestOptions } from "../../request";
|
|
4
|
-
import { PatchRequestBody } from "../../utils/patch";
|
|
5
|
-
import { Container } from "../Container";
|
|
6
|
-
import { ItemDefinition } from "./ItemDefinition";
|
|
1
|
+
import type { ClientContext } from "../../ClientContext";
|
|
2
|
+
import type { PartitionKey } from "../../documents";
|
|
3
|
+
import type { RequestOptions } from "../../request";
|
|
4
|
+
import type { PatchRequestBody } from "../../utils/patch";
|
|
5
|
+
import type { Container } from "../Container";
|
|
6
|
+
import type { ItemDefinition } from "./ItemDefinition";
|
|
7
7
|
import { ItemResponse } from "./ItemResponse";
|
|
8
8
|
/**
|
|
9
9
|
* Used to perform operations on a specific item.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/client/Item/Item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/client/Item/Item.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAUzD,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,iBAAiB,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;GAIG;AACH,qBAAa,IAAI;aAgBG,SAAS,EAAE,SAAS;aACpB,EAAE,EAAE,MAAM;IAC1B,OAAO,CAAC,QAAQ,CAA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E,IAAI,CAAC,YAAY,GAAG,MAAM,0BAA0B,CAClD,cAAc,EACd,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,YAAY,CAClB,CAAC;YACF,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAI;gBACjD,IAAI;gBACJ,IAAI;gBACJ,YAAY,EAAE,YAAY,CAAC,IAAI;gBAC/B,UAAU,EAAE,EAAE;gBACd,OAAO;gBACP,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,cAAc;aACf,CAAC,CAAC;YAEH,OAAO,IAAI,YAAY,CACrB,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,SAAS,EAClB,IAAI,EACJ,yBAAyB,EAAE,CAC5B,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ClientContext } from \"../../ClientContext\";\nimport { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport {\n createDocumentUri,\n getIdFromLink,\n getPathFromLink,\n isItemResourceValid,\n ResourceType,\n StatusCodes,\n} from \"../../common\";\nimport { PartitionKey, PartitionKeyInternal, convertToInternalPartitionKey } from \"../../documents\";\nimport { RequestOptions, Response } from \"../../request\";\nimport { PatchRequestBody } from \"../../utils/patch\";\nimport { Container } from \"../Container\";\nimport { Resource } from \"../Resource\";\nimport { ItemDefinition } from \"./ItemDefinition\";\nimport { ItemResponse } from \"./ItemResponse\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"../../utils/diagnostics\";\nimport { setPartitionKeyIfUndefined } from \"../../extractPartitionKey\";\n\n/**\n * Used to perform operations on a specific item.\n *\n * @see {@link Items} for operations on all items; see `container.items`.\n */\nexport class Item {\n private partitionKey: PartitionKeyInternal;\n /**\n * Returns a reference URL to the resource. Used for linking in Permissions.\n */\n public get url(): string {\n return createDocumentUri(this.container.database.id, this.container.id, this.id);\n }\n\n /**\n * @hidden\n * @param container - The parent {@link Container}.\n * @param id - The id of the given {@link Item}.\n * @param partitionKey - The primary key of the given {@link Item} (only for partitioned containers).\n */\n constructor(\n public readonly container: Container,\n public readonly id: string,\n private readonly clientContext: ClientContext,\n partitionKey?: PartitionKey,\n ) {\n this.partitionKey =\n partitionKey === undefined ? undefined : convertToInternalPartitionKey(partitionKey);\n }\n\n /**\n * Read the item's definition.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n * If the type, T, is a class, it won't pass `typeof` comparisons, because it won't have a match prototype.\n * It's recommended to only use interfaces.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param options - Additional options for the request\n *\n * @example Using custom type for response\n * ```typescript\n * interface TodoItem {\n * title: string;\n * done: bool;\n * id: string;\n * }\n *\n * let item: TodoItem;\n * ({body: item} = await item.read<TodoItem>());\n * ```\n */\n public async read<T extends ItemDefinition = any>(\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n let response: Response<T & Resource>;\n try {\n response = await this.clientContext.read<T>({\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n } catch (error: any) {\n if (error.code !== StatusCodes.NotFound) {\n throw error;\n }\n response = error;\n }\n\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Replace the item's definition.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - The definition to replace the existing {@link Item}'s definition with.\n * @param options - Additional options for the request\n */\n public replace(\n body: ItemDefinition,\n options?: RequestOptions,\n ): Promise<ItemResponse<ItemDefinition>>;\n /**\n * Replace the item's definition.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - The definition to replace the existing {@link Item}'s definition with.\n * @param options - Additional options for the request\n */\n public replace<T extends ItemDefinition>(\n body: T,\n options?: RequestOptions,\n ): Promise<ItemResponse<T>>;\n public async replace<T extends ItemDefinition>(\n body: T,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n const err = {};\n if (!isItemResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.replace<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Delete the item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * @param options - Additional options for the request\n */\n public async delete<T extends ItemDefinition = any>(\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.delete<T>({\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Perform a JSONPatch on the item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * @param options - Additional options for the request\n */\n public async patch<T extends ItemDefinition = any>(\n body: PatchRequestBody,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.patch<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/client/Item/Item.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAMhE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;GAIG;AACH,MAAM,OAAO,IAAI;IAEf;;OAEG;IACH,IA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Q,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAI;gBACjD,IAAI;gBACJ,IAAI;gBACJ,YAAY,EAAE,YAAY,CAAC,IAAI;gBAC/B,UAAU,EAAE,EAAE;gBACd,OAAO;gBACP,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,cAAc;aACf,CAAC,CAAC;YAEH,OAAO,IAAI,YAAY,CACrB,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,SAAS,EAClB,IAAI,EACJ,yBAAyB,EAAE,CAC5B,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ClientContext } from \"../../ClientContext\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport {\n createDocumentUri,\n getIdFromLink,\n getPathFromLink,\n isItemResourceValid,\n ResourceType,\n StatusCodes,\n} from \"../../common\";\nimport type { PartitionKey, PartitionKeyInternal } from \"../../documents\";\nimport { convertToInternalPartitionKey } from \"../../documents\";\nimport type { RequestOptions, Response } from \"../../request\";\nimport type { PatchRequestBody } from \"../../utils/patch\";\nimport type { Container } from \"../Container\";\nimport type { Resource } from \"../Resource\";\nimport type { ItemDefinition } from \"./ItemDefinition\";\nimport { ItemResponse } from \"./ItemResponse\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"../../utils/diagnostics\";\nimport { setPartitionKeyIfUndefined } from \"../../extractPartitionKey\";\n\n/**\n * Used to perform operations on a specific item.\n *\n * @see {@link Items} for operations on all items; see `container.items`.\n */\nexport class Item {\n private partitionKey: PartitionKeyInternal;\n /**\n * Returns a reference URL to the resource. Used for linking in Permissions.\n */\n public get url(): string {\n return createDocumentUri(this.container.database.id, this.container.id, this.id);\n }\n\n /**\n * @hidden\n * @param container - The parent {@link Container}.\n * @param id - The id of the given {@link Item}.\n * @param partitionKey - The primary key of the given {@link Item} (only for partitioned containers).\n */\n constructor(\n public readonly container: Container,\n public readonly id: string,\n private readonly clientContext: ClientContext,\n partitionKey?: PartitionKey,\n ) {\n this.partitionKey =\n partitionKey === undefined ? undefined : convertToInternalPartitionKey(partitionKey);\n }\n\n /**\n * Read the item's definition.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n * If the type, T, is a class, it won't pass `typeof` comparisons, because it won't have a match prototype.\n * It's recommended to only use interfaces.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param options - Additional options for the request\n *\n * @example Using custom type for response\n * ```typescript\n * interface TodoItem {\n * title: string;\n * done: bool;\n * id: string;\n * }\n *\n * let item: TodoItem;\n * ({body: item} = await item.read<TodoItem>());\n * ```\n */\n public async read<T extends ItemDefinition = any>(\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n let response: Response<T & Resource>;\n try {\n response = await this.clientContext.read<T>({\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n } catch (error: any) {\n if (error.code !== StatusCodes.NotFound) {\n throw error;\n }\n response = error;\n }\n\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Replace the item's definition.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - The definition to replace the existing {@link Item}'s definition with.\n * @param options - Additional options for the request\n */\n public replace(\n body: ItemDefinition,\n options?: RequestOptions,\n ): Promise<ItemResponse<ItemDefinition>>;\n /**\n * Replace the item's definition.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - The definition to replace the existing {@link Item}'s definition with.\n * @param options - Additional options for the request\n */\n public replace<T extends ItemDefinition>(\n body: T,\n options?: RequestOptions,\n ): Promise<ItemResponse<T>>;\n public async replace<T extends ItemDefinition>(\n body: T,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n const err = {};\n if (!isItemResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.replace<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Delete the item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * @param options - Additional options for the request\n */\n public async delete<T extends ItemDefinition = any>(\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.delete<T>({\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Perform a JSONPatch on the item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * @param options - Additional options for the request\n */\n public async patch<T extends ItemDefinition = any>(\n body: PatchRequestBody,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n this.partitionKey = await setPartitionKeyIfUndefined(\n diagnosticNode,\n this.container,\n this.partitionKey,\n );\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.patch<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey: this.partitionKey,\n diagnosticNode,\n });\n\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CosmosDiagnostics } from "../../CosmosDiagnostics";
|
|
2
|
-
import { CosmosHeaders } from "../../queryExecutionContext";
|
|
1
|
+
import type { CosmosDiagnostics } from "../../CosmosDiagnostics";
|
|
2
|
+
import type { CosmosHeaders } from "../../queryExecutionContext";
|
|
3
3
|
import { ResourceResponse } from "../../request/ResourceResponse";
|
|
4
|
-
import { Resource } from "../Resource";
|
|
5
|
-
import { Item } from "./Item";
|
|
6
|
-
import { ItemDefinition } from "./ItemDefinition";
|
|
4
|
+
import type { Resource } from "../Resource";
|
|
5
|
+
import type { Item } from "./Item";
|
|
6
|
+
import type { ItemDefinition } from "./ItemDefinition";
|
|
7
7
|
export declare class ItemResponse<T extends ItemDefinition> extends ResourceResponse<T & Resource> {
|
|
8
8
|
constructor(resource: T & Resource, headers: CosmosHeaders, statusCode: number, subsstatusCode: number, item: Item, diagnostics: CosmosDiagnostics);
|
|
9
9
|
/** Reference to the {@link Item} the response corresponds to. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemResponse.d.ts","sourceRoot":"","sources":["../../../../src/client/Item/ItemResponse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ItemResponse.d.ts","sourceRoot":"","sources":["../../../../src/client/Item/ItemResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,qBAAa,YAAY,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,gBAAgB,CAAC,CAAC,GAAG,QAAQ,CAAC;gBAEtF,QAAQ,EAAE,CAAC,GAAG,QAAQ,EACtB,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,iBAAiB;IAKhC,iEAAiE;IACjE,SAAgB,IAAI,EAAE,IAAI,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemResponse.js","sourceRoot":"","sources":["../../../../src/client/Item/ItemResponse.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,MAAM,OAAO,YAAuC,SAAQ,gBAA8B;IACxF,YACE,QAAsB,EACtB,OAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,IAAU,EACV,WAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CAGF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CosmosDiagnostics } from \"../../CosmosDiagnostics\";\nimport { CosmosHeaders } from \"../../queryExecutionContext\";\nimport { ResourceResponse } from \"../../request/ResourceResponse\";\nimport { Resource } from \"../Resource\";\nimport { Item } from \"./Item\";\nimport { ItemDefinition } from \"./ItemDefinition\";\n\nexport class ItemResponse<T extends ItemDefinition> extends ResourceResponse<T & Resource> {\n constructor(\n resource: T & Resource,\n headers: CosmosHeaders,\n statusCode: number,\n subsstatusCode: number,\n item: Item,\n diagnostics: CosmosDiagnostics,\n ) {\n super(resource, headers, statusCode, diagnostics, subsstatusCode);\n this.item = item;\n }\n /** Reference to the {@link Item} the response corresponds to. */\n public readonly item: Item;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ItemResponse.js","sourceRoot":"","sources":["../../../../src/client/Item/ItemResponse.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,MAAM,OAAO,YAAuC,SAAQ,gBAA8B;IACxF,YACE,QAAsB,EACtB,OAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,IAAU,EACV,WAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CAGF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { CosmosDiagnostics } from \"../../CosmosDiagnostics\";\nimport type { CosmosHeaders } from \"../../queryExecutionContext\";\nimport { ResourceResponse } from \"../../request/ResourceResponse\";\nimport type { Resource } from \"../Resource\";\nimport type { Item } from \"./Item\";\nimport type { ItemDefinition } from \"./ItemDefinition\";\n\nexport class ItemResponse<T extends ItemDefinition> extends ResourceResponse<T & Resource> {\n constructor(\n resource: T & Resource,\n headers: CosmosHeaders,\n statusCode: number,\n subsstatusCode: number,\n item: Item,\n diagnostics: CosmosDiagnostics,\n ) {\n super(resource, headers, statusCode, diagnostics, subsstatusCode);\n this.item = item;\n }\n /** Reference to the {@link Item} the response corresponds to. */\n public readonly item: Item;\n}\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ChangeFeedIterator } from "../../ChangeFeedIterator";
|
|
2
|
-
import { ChangeFeedOptions } from "../../ChangeFeedOptions";
|
|
3
|
-
import { ClientContext } from "../../ClientContext";
|
|
4
|
-
import { SqlQuerySpec } from "../../queryExecutionContext";
|
|
2
|
+
import type { ChangeFeedOptions } from "../../ChangeFeedOptions";
|
|
3
|
+
import type { ClientContext } from "../../ClientContext";
|
|
4
|
+
import type { SqlQuerySpec } from "../../queryExecutionContext";
|
|
5
5
|
import { QueryIterator } from "../../queryIterator";
|
|
6
|
-
import { FeedOptions, RequestOptions, Response } from "../../request";
|
|
7
|
-
import { Container } from "../Container";
|
|
8
|
-
import { ItemDefinition } from "./ItemDefinition";
|
|
6
|
+
import type { FeedOptions, RequestOptions, Response } from "../../request";
|
|
7
|
+
import type { Container } from "../Container";
|
|
8
|
+
import type { ItemDefinition } from "./ItemDefinition";
|
|
9
9
|
import { ItemResponse } from "./ItemResponse";
|
|
10
|
-
import { OperationResponse, OperationInput, BulkOptions, BulkOperationResponse } from "../../utils/batch";
|
|
11
|
-
import { PartitionKey } from "../../documents";
|
|
12
|
-
import { ChangeFeedPullModelIterator, ChangeFeedIteratorOptions } from "../../client/ChangeFeed";
|
|
10
|
+
import type { OperationResponse, OperationInput, BulkOptions, BulkOperationResponse } from "../../utils/batch";
|
|
11
|
+
import type { PartitionKey } from "../../documents";
|
|
12
|
+
import type { ChangeFeedPullModelIterator, ChangeFeedIteratorOptions } from "../../client/ChangeFeed";
|
|
13
13
|
/**
|
|
14
14
|
* Operations for creating new items, and reading/querying all items
|
|
15
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Items.d.ts","sourceRoot":"","sources":["../../../../src/client/Item/Items.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Items.d.ts","sourceRoot":"","sources":["../../../../src/client/Item/Items.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAUzD,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAEV,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EAAE,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AAoBjC;;;;GAIG;AACH,qBAAa,KAAK;aAQE,SAAS,EAAE,SAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,aAAa;IARhC,OAAO,CAAC,sBAAsB,CAAyB;IACvD;;;;OAIG;gBAEe,SAAS,EAAE,SAAS,EACnB,aAAa,EAAE,aAA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C,iBAAiB,EAAE,CAAC,CAAC;CAwB1C"}
|
|
@@ -10,9 +10,9 @@ import { isKeyInRange, prepareOperations, decorateBatchOperation, splitBatchBase
|
|
|
10
10
|
import { assertNotUndefined, isPrimitivePartitionKeyValue } from "../../utils/typeChecks";
|
|
11
11
|
import { hashPartitionKey } from "../../utils/hashing/hash";
|
|
12
12
|
import { PartitionKeyRangeCache, QueryRange } from "../../routing";
|
|
13
|
-
import { changeFeedIteratorBuilder
|
|
13
|
+
import { changeFeedIteratorBuilder } from "../../client/ChangeFeed";
|
|
14
14
|
import { validateChangeFeedIteratorOptions } from "../../client/ChangeFeed/changeFeedUtils";
|
|
15
|
-
import { DiagnosticNodeType
|
|
15
|
+
import { DiagnosticNodeType } from "../../diagnostics/DiagnosticNodeInternal";
|
|
16
16
|
import { getEmptyCosmosDiagnostics, withDiagnostics, addDignosticChild, } from "../../utils/diagnostics";
|
|
17
17
|
import { randomUUID } from "@azure/core-util";
|
|
18
18
|
import { readPartitionKeyDefinition } from "../ClientUtils";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Items.js","sourceRoot":"","sources":["../../../../src/client/Item/Items.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAEL,YAAY,EACZ,iBAAiB,EAIjB,sBAAsB,EACtB,yBAAyB,GAE1B,MAAM,m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C5B,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;YAC1F,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAkC,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;oBAC7E,IAAI,EAAE,UAAU;oBAChB,YAAY;oBACZ,IAAI;oBACJ,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG;oBAC9B,OAAO;oBACP,cAAc;iBACf,CAAC,CAAC;gBACH,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,CAAC;QACH,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChangeFeedIterator } from \"../../ChangeFeedIterator\";\nimport { ChangeFeedOptions } from \"../../ChangeFeedOptions\";\nimport { ClientContext } from \"../../ClientContext\";\nimport {\n getIdFromLink,\n getPathFromLink,\n isItemResourceValid,\n ResourceType,\n StatusCodes,\n SubStatusCodes,\n} from \"../../common\";\nimport { extractPartitionKeys, setPartitionKeyIfUndefined } from \"../../extractPartitionKey\";\nimport { FetchFunctionCallback, SqlQuerySpec } from \"../../queryExecutionContext\";\nimport { QueryIterator } from \"../../queryIterator\";\nimport { FeedOptions, RequestOptions, Response } from \"../../request\";\nimport { Container, PartitionKeyRange } from \"../Container\";\nimport { Item } from \"./Item\";\nimport { ItemDefinition } from \"./ItemDefinition\";\nimport { ItemResponse } from \"./ItemResponse\";\nimport {\n Batch,\n isKeyInRange,\n prepareOperations,\n OperationResponse,\n OperationInput,\n BulkOptions,\n decorateBatchOperation,\n splitBatchBasedOnBodySize,\n BulkOperationResponse,\n} from \"../../utils/batch\";\nimport { assertNotUndefined, isPrimitivePartitionKeyValue } from \"../../utils/typeChecks\";\nimport { hashPartitionKey } from \"../../utils/hashing/hash\";\nimport { PartitionKey, PartitionKeyDefinition } from \"../../documents\";\nimport { PartitionKeyRangeCache, QueryRange } from \"../../routing\";\nimport {\n ChangeFeedPullModelIterator,\n ChangeFeedIteratorOptions,\n changeFeedIteratorBuilder,\n} from \"../../client/ChangeFeed\";\nimport { validateChangeFeedIteratorOptions } from \"../../client/ChangeFeed/changeFeedUtils\";\nimport {\n DiagnosticNodeInternal,\n DiagnosticNodeType,\n} from \"../../diagnostics/DiagnosticNodeInternal\";\nimport {\n getEmptyCosmosDiagnostics,\n withDiagnostics,\n addDignosticChild,\n} from \"../../utils/diagnostics\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { readPartitionKeyDefinition } from \"../ClientUtils\";\n\n/**\n * @hidden\n */\nfunction isChangeFeedOptions(options: unknown): options is ChangeFeedOptions {\n return options && !(isPrimitivePartitionKeyValue(options) || Array.isArray(options));\n}\n\n/**\n * Operations for creating new items, and reading/querying all items\n *\n * @see {@link Item} for reading, replacing, or deleting an existing container; use `.item(id)`.\n */\nexport class Items {\n private partitionKeyRangeCache: PartitionKeyRangeCache;\n /**\n * Create an instance of {@link Items} linked to the parent {@link Container}.\n * @param container - The parent container.\n * @hidden\n */\n constructor(\n public readonly container: Container,\n private readonly clientContext: ClientContext,\n ) {\n this.partitionKeyRangeCache = new PartitionKeyRangeCache(this.clientContext);\n }\n\n /**\n * Queries all items.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const querySpec: SqlQuerySpec = {\n * query: \"SELECT * FROM Families f WHERE f.lastName = @lastName\",\n * parameters: [\n * {name: \"@lastName\", value: \"Hendricks\"}\n * ]\n * };\n * const {result: items} = await items.query(querySpec).fetchAll();\n * ```\n */\n public query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;\n /**\n * Queries all items.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const querySpec: SqlQuerySpec = {\n * query: \"SELECT firstname FROM Families f WHERE f.lastName = @lastName\",\n * parameters: [\n * {name: \"@lastName\", value: \"Hendricks\"}\n * ]\n * };\n * const {result: items} = await items.query<{firstName: string}>(querySpec).fetchAll();\n * ```\n */\n public query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;\n public query<T>(query: string | SqlQuerySpec, options: FeedOptions = {}): QueryIterator<T> {\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n\n const fetchFunction: FetchFunctionCallback = async (\n diagnosticNode: DiagnosticNodeInternal,\n innerOptions: FeedOptions,\n correlatedActivityId: string,\n ) => {\n const response = await this.clientContext.queryFeed({\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n resultFn: (result) => (result ? result.Documents : []),\n query,\n options: innerOptions,\n partitionKey: options.partitionKey,\n diagnosticNode,\n correlatedActivityId: correlatedActivityId,\n });\n return response;\n };\n\n return new QueryIterator(\n this.clientContext,\n query,\n options,\n fetchFunction,\n this.container.url,\n ResourceType.item,\n );\n }\n\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n *\n * @deprecated Use `changeFeed` instead.\n *\n * @example Read from the beginning of the change feed.\n * ```javascript\n * const iterator = items.readChangeFeed({ startFromBeginning: true });\n * const firstPage = await iterator.fetchNext();\n * const firstPageResults = firstPage.result\n * const secondPage = await iterator.fetchNext();\n * ```\n */\n public readChangeFeed(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n * @deprecated Use `changeFeed` instead.\n *\n */\n public readChangeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n * @deprecated Use `changeFeed` instead.\n */\n public readChangeFeed<T>(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n * @deprecated Use `changeFeed` instead.\n */\n public readChangeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;\n public readChangeFeed<T>(\n partitionKeyOrChangeFeedOptions?: PartitionKey | ChangeFeedOptions,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T> {\n if (isChangeFeedOptions(partitionKeyOrChangeFeedOptions)) {\n return this.changeFeed(partitionKeyOrChangeFeedOptions);\n } else {\n return this.changeFeed(partitionKeyOrChangeFeedOptions, changeFeedOptions);\n }\n }\n\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n *\n * @example Read from the beginning of the change feed.\n * ```javascript\n * const iterator = items.readChangeFeed({ startFromBeginning: true });\n * const firstPage = await iterator.fetchNext();\n * const firstPageResults = firstPage.result\n * const secondPage = await iterator.fetchNext();\n * ```\n */\n public changeFeed(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n */\n public changeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n */\n public changeFeed<T>(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n */\n public changeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;\n public changeFeed<T>(\n partitionKeyOrChangeFeedOptions?: PartitionKey | ChangeFeedOptions,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T> {\n let partitionKey: PartitionKey;\n if (!changeFeedOptions && isChangeFeedOptions(partitionKeyOrChangeFeedOptions)) {\n partitionKey = undefined;\n changeFeedOptions = partitionKeyOrChangeFeedOptions;\n } else if (\n partitionKeyOrChangeFeedOptions !== undefined &&\n !isChangeFeedOptions(partitionKeyOrChangeFeedOptions)\n ) {\n partitionKey = partitionKeyOrChangeFeedOptions;\n }\n\n if (!changeFeedOptions) {\n changeFeedOptions = {};\n }\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n return new ChangeFeedIterator<T>(this.clientContext, id, path, partitionKey, changeFeedOptions);\n }\n\n /**\n * Returns an iterator to iterate over pages of changes. The iterator returned can be used to fetch changes for a single partition key, feed range or an entire container.\n */\n public getChangeFeedIterator<T>(\n changeFeedIteratorOptions?: ChangeFeedIteratorOptions,\n ): ChangeFeedPullModelIterator<T> {\n const cfOptions = changeFeedIteratorOptions !== undefined ? changeFeedIteratorOptions : {};\n validateChangeFeedIteratorOptions(cfOptions);\n const iterator = changeFeedIteratorBuilder(\n cfOptions,\n this.clientContext,\n this.container,\n this.partitionKeyRangeCache,\n );\n return iterator;\n }\n\n /**\n * Read all items.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const {body: containerList} = await items.readAll().fetchAll();\n * ```\n */\n public readAll(options?: FeedOptions): QueryIterator<ItemDefinition>;\n /**\n * Read all items.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const {body: containerList} = await items.readAll().fetchAll();\n * ```\n */\n public readAll<T extends ItemDefinition>(options?: FeedOptions): QueryIterator<T>;\n public readAll<T extends ItemDefinition>(options?: FeedOptions): QueryIterator<T> {\n return this.query<T>(\"SELECT * from c\", options);\n }\n\n /**\n * Create an item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - Represents the body of the item. Can contain any number of user defined properties.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n */\n public async create<T extends ItemDefinition = any>(\n body: T,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n // Generate random document id if the id is missing in the payload and\n // options.disableAutomaticIdGeneration != true\n\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n if ((body.id === undefined || body.id === \"\") && !options.disableAutomaticIdGeneration) {\n body.id = randomUUID();\n }\n const partitionKeyDefinition = await readPartitionKeyDefinition(\n diagnosticNode,\n this.container,\n );\n const partitionKey = extractPartitionKeys(body, partitionKeyDefinition);\n\n const err = {};\n if (!isItemResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n\n const response = await this.clientContext.create<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n diagnosticNode,\n options,\n partitionKey,\n });\n\n const ref = new Item(\n this.container,\n (response.result as any).id,\n this.clientContext,\n partitionKey,\n );\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n ref,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Upsert an item.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - Represents the body of the item. Can contain any number of user defined properties.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n */\n public async upsert(\n body: unknown,\n options?: RequestOptions,\n ): Promise<ItemResponse<ItemDefinition>>;\n /**\n * Upsert an item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - Represents the body of the item. Can contain any number of user defined properties.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n */\n public async upsert<T extends ItemDefinition>(\n body: T,\n options?: RequestOptions,\n ): Promise<ItemResponse<T>>;\n public async upsert<T extends ItemDefinition>(\n body: T,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n // Generate random document id if the id is missing in the payload and\n // options.disableAutomaticIdGeneration != true\n if ((body.id === undefined || body.id === \"\") && !options.disableAutomaticIdGeneration) {\n body.id = randomUUID();\n }\n\n const partitionKeyDefinition = await readPartitionKeyDefinition(\n diagnosticNode,\n this.container,\n );\n const partitionKey = extractPartitionKeys(body, partitionKeyDefinition);\n\n const err = {};\n if (!isItemResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n\n const response = await this.clientContext.upsert<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey,\n diagnosticNode,\n });\n\n const ref = new Item(\n this.container,\n (response.result as any).id,\n this.clientContext,\n partitionKey,\n );\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n ref,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Execute bulk operations on items.\n *\n * Bulk takes an array of Operations which are typed based on what the operation does.\n * The choices are: Create, Upsert, Read, Replace, and Delete\n *\n * Usage example:\n * ```typescript\n * // partitionKey is optional at the top level if present in the resourceBody\n * const operations: OperationInput[] = [\n * {\n * operationType: \"Create\",\n * resourceBody: { id: \"doc1\", name: \"sample\", key: \"A\" }\n * },\n * {\n * operationType: \"Upsert\",\n * partitionKey: 'A',\n * resourceBody: { id: \"doc2\", name: \"other\", key: \"A\" }\n * }\n * ]\n *\n * await database.container.items.bulk(operations)\n * ```\n *\n * @param operations - List of operations. Limit 100\n * @param bulkOptions - Optional options object to modify bulk behavior. Pass \\{ continueOnError: false \\} to stop executing operations when one fails. (Defaults to true)\n * @param options - Used for modifying the request.\n */\n public async bulk(\n operations: OperationInput[],\n bulkOptions?: BulkOptions,\n options?: RequestOptions,\n ): Promise<BulkOperationResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const partitionKeyRanges = (\n await this.partitionKeyRangeCache.onCollectionRoutingMap(this.container.url, diagnosticNode)\n ).getOrderedParitionKeyRanges();\n\n const partitionKeyDefinition = await readPartitionKeyDefinition(\n diagnosticNode,\n this.container,\n );\n const batches: Batch[] = partitionKeyRanges.map((keyRange: PartitionKeyRange) => {\n return {\n min: keyRange.minInclusive,\n max: keyRange.maxExclusive,\n rangeId: keyRange.id,\n indexes: [],\n operations: [],\n };\n });\n\n this.groupOperationsBasedOnPartitionKey(operations, partitionKeyDefinition, options, batches);\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n\n const orderedResponses: OperationResponse[] = [];\n // split batches based on cumulative size of operations\n const batchMap = batches\n .filter((batch: Batch) => batch.operations.length)\n .flatMap((batch: Batch) => splitBatchBasedOnBodySize(batch));\n\n await Promise.all(\n this.executeBatchOperations(\n batchMap,\n path,\n bulkOptions,\n options,\n diagnosticNode,\n orderedResponses,\n partitionKeyDefinition,\n ),\n );\n const response: any = orderedResponses;\n response.diagnostics = diagnosticNode.toDiagnostic(this.clientContext.getClientConfig());\n return response;\n }, this.clientContext);\n }\n\n private executeBatchOperations(\n batchMap: Batch[],\n path: string,\n bulkOptions: BulkOptions,\n options: RequestOptions,\n diagnosticNode: DiagnosticNodeInternal,\n orderedResponses: OperationResponse[],\n partitionKeyDefinition: PartitionKeyDefinition,\n ): Promise<void>[] {\n return batchMap.map(async (batch: Batch) => {\n if (batch.operations.length > 100) {\n throw new Error(\"Cannot run bulk request with more than 100 operations per partition\");\n }\n try {\n const response = await addDignosticChild(\n async (childNode: DiagnosticNodeInternal) =>\n this.clientContext.bulk({\n body: batch.operations,\n partitionKeyRangeId: batch.rangeId,\n path,\n resourceId: this.container.url,\n bulkOptions,\n options,\n diagnosticNode: childNode,\n }),\n diagnosticNode,\n DiagnosticNodeType.BATCH_REQUEST,\n );\n response.result.forEach((operationResponse: OperationResponse, index: number) => {\n orderedResponses[batch.indexes[index]] = operationResponse;\n });\n } catch (err: any) {\n // In the case of 410 errors, we need to recompute the partition key ranges\n // and redo the batch request, however, 410 errors occur for unsupported\n // partition key types as well since we don't support them, so for now we throw\n if (err.code === StatusCodes.Gone) {\n const isPartitionSplit =\n err.substatus === SubStatusCodes.PartitionKeyRangeGone ||\n err.substatus === SubStatusCodes.CompletingSplit;\n\n if (isPartitionSplit) {\n const queryRange = new QueryRange(batch.min, batch.max, true, false);\n const overlappingRanges = await this.partitionKeyRangeCache.getOverlappingRanges(\n this.container.url,\n queryRange,\n diagnosticNode,\n true,\n );\n if (overlappingRanges.length < 1) {\n throw new Error(\"Partition split/merge detected but no overlapping ranges found.\");\n }\n // Handles both merge (overlappingRanges.length === 1) and split (overlappingRanges.length > 1) cases.\n if (overlappingRanges.length >= 1) {\n // const splitBatches: Batch[] = [];\n const newBatches: Batch[] = this.createNewBatches(\n overlappingRanges,\n batch,\n partitionKeyDefinition,\n );\n\n await Promise.all(\n this.executeBatchOperations(\n newBatches,\n path,\n bulkOptions,\n options,\n diagnosticNode,\n orderedResponses,\n partitionKeyDefinition,\n ),\n );\n }\n } else {\n throw new Error(\n \"Partition key error. An operation has an unsupported partitionKey type\" +\n err.message,\n );\n }\n } else {\n throw new Error(`Bulk request errored with: ${err.message}`);\n }\n }\n });\n }\n\n /**\n * Function to create new batches based of partition key Ranges.\n *\n * @param overlappingRanges - Overlapping partition key ranges.\n * @param batch - Batch to be split.\n * @param partitionKeyDefinition - PartitionKey definition of container.\n * @returns Array of new batches.\n */\n private createNewBatches(\n overlappingRanges: PartitionKeyRange[],\n batch: Batch,\n partitionKeyDefinition: PartitionKeyDefinition,\n ): Batch[] {\n const newBatches: Batch[] = overlappingRanges.map((keyRange: PartitionKeyRange) => {\n return {\n min: keyRange.minInclusive,\n max: keyRange.maxExclusive,\n rangeId: keyRange.id,\n indexes: [],\n operations: [],\n };\n });\n let indexValue = 0;\n batch.operations.forEach((operation) => {\n const partitionKey = JSON.parse(operation.partitionKey);\n const hashed = hashPartitionKey(\n assertNotUndefined(\n partitionKey,\n \"undefined value for PartitionKey is not expected during grouping of bulk operations.\",\n ),\n partitionKeyDefinition,\n );\n const batchForKey = assertNotUndefined(\n newBatches.find((newBatch: Batch) => {\n return isKeyInRange(newBatch.min, newBatch.max, hashed);\n }),\n \"No suitable Batch found.\",\n );\n batchForKey.operations.push(operation);\n batchForKey.indexes.push(batch.indexes[indexValue]);\n indexValue++;\n });\n return newBatches;\n }\n\n /**\n * Function to create batches based of partition key Ranges.\n * @param operations - operations to group\n * @param partitionDefinition - PartitionKey definition of container.\n * @param options - Request options for bulk request.\n * @param batches - Groups to be filled with operations.\n */\n private groupOperationsBasedOnPartitionKey(\n operations: OperationInput[],\n partitionDefinition: PartitionKeyDefinition,\n options: RequestOptions | undefined,\n batches: Batch[],\n ) {\n operations.forEach((operationInput, index: number) => {\n const { operation, partitionKey } = prepareOperations(\n operationInput,\n partitionDefinition,\n options,\n );\n const hashed = hashPartitionKey(\n assertNotUndefined(\n partitionKey,\n \"undefined value for PartitionKey is not expected during grouping of bulk operations.\",\n ),\n partitionDefinition,\n );\n const batchForKey = assertNotUndefined(\n batches.find((batch: Batch) => {\n return isKeyInRange(batch.min, batch.max, hashed);\n }),\n \"No suitable Batch found.\",\n );\n batchForKey.operations.push(operation);\n batchForKey.indexes.push(index);\n });\n }\n\n /**\n * Execute transactional batch operations on items.\n *\n * Batch takes an array of Operations which are typed based on what the operation does. Batch is transactional and will rollback all operations if one fails.\n * The choices are: Create, Upsert, Read, Replace, and Delete\n *\n * Usage example:\n * ```typescript\n * // The partitionKey is a required second argument. If it’s undefined, it defaults to the expected partition key format.\n * const operations: OperationInput[] = [\n * {\n * operationType: \"Create\",\n * resourceBody: { id: \"doc1\", name: \"sample\", key: \"A\" }\n * },\n * {\n * operationType: \"Upsert\",\n * resourceBody: { id: \"doc2\", name: \"other\", key: \"A\" }\n * }\n * ]\n *\n * await database.container.items.batch(operations, \"A\")\n * ```\n *\n * @param operations - List of operations. Limit 100\n * @param options - Used for modifying the request\n */\n public async batch(\n operations: OperationInput[],\n partitionKey?: PartitionKey,\n options?: RequestOptions,\n ): Promise<Response<OperationResponse[]>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n operations.map((operation) => decorateBatchOperation(operation, options));\n partitionKey = await setPartitionKeyIfUndefined(diagnosticNode, this.container, partitionKey);\n const path = getPathFromLink(this.container.url, ResourceType.item);\n\n if (operations.length > 100) {\n throw new Error(\"Cannot run batch request with more than 100 operations per partition\");\n }\n try {\n const response: Response<OperationResponse[]> = await this.clientContext.batch({\n body: operations,\n partitionKey,\n path,\n resourceId: this.container.url,\n options,\n diagnosticNode,\n });\n return response;\n } catch (err: any) {\n throw new Error(`Batch request error: ${err.message}`);\n }\n }, this.clientContext);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Items.js","sourceRoot":"","sources":["../../../../src/client/Item/Items.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AA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H,MAAM,QAAQ,GAAkC,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;oBAC7E,IAAI,EAAE,UAAU;oBAChB,YAAY;oBACZ,IAAI;oBACJ,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG;oBAC9B,OAAO;oBACP,cAAc;iBACf,CAAC,CAAC;gBACH,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,CAAC;QACH,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChangeFeedIterator } from \"../../ChangeFeedIterator\";\nimport type { ChangeFeedOptions } from \"../../ChangeFeedOptions\";\nimport type { ClientContext } from \"../../ClientContext\";\nimport {\n getIdFromLink,\n getPathFromLink,\n isItemResourceValid,\n ResourceType,\n StatusCodes,\n SubStatusCodes,\n} from \"../../common\";\nimport { extractPartitionKeys, setPartitionKeyIfUndefined } from \"../../extractPartitionKey\";\nimport type { FetchFunctionCallback, SqlQuerySpec } from \"../../queryExecutionContext\";\nimport { QueryIterator } from \"../../queryIterator\";\nimport type { FeedOptions, RequestOptions, Response } from \"../../request\";\nimport type { Container, PartitionKeyRange } from \"../Container\";\nimport { Item } from \"./Item\";\nimport type { ItemDefinition } from \"./ItemDefinition\";\nimport { ItemResponse } from \"./ItemResponse\";\nimport type {\n Batch,\n OperationResponse,\n OperationInput,\n BulkOptions,\n BulkOperationResponse,\n} from \"../../utils/batch\";\nimport {\n isKeyInRange,\n prepareOperations,\n decorateBatchOperation,\n splitBatchBasedOnBodySize,\n} from \"../../utils/batch\";\nimport { assertNotUndefined, isPrimitivePartitionKeyValue } from \"../../utils/typeChecks\";\nimport { hashPartitionKey } from \"../../utils/hashing/hash\";\nimport type { PartitionKey, PartitionKeyDefinition } from \"../../documents\";\nimport { PartitionKeyRangeCache, QueryRange } from \"../../routing\";\nimport type {\n ChangeFeedPullModelIterator,\n ChangeFeedIteratorOptions,\n} from \"../../client/ChangeFeed\";\nimport { changeFeedIteratorBuilder } from \"../../client/ChangeFeed\";\nimport { validateChangeFeedIteratorOptions } from \"../../client/ChangeFeed/changeFeedUtils\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport { DiagnosticNodeType } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport {\n getEmptyCosmosDiagnostics,\n withDiagnostics,\n addDignosticChild,\n} from \"../../utils/diagnostics\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { readPartitionKeyDefinition } from \"../ClientUtils\";\n\n/**\n * @hidden\n */\nfunction isChangeFeedOptions(options: unknown): options is ChangeFeedOptions {\n return options && !(isPrimitivePartitionKeyValue(options) || Array.isArray(options));\n}\n\n/**\n * Operations for creating new items, and reading/querying all items\n *\n * @see {@link Item} for reading, replacing, or deleting an existing container; use `.item(id)`.\n */\nexport class Items {\n private partitionKeyRangeCache: PartitionKeyRangeCache;\n /**\n * Create an instance of {@link Items} linked to the parent {@link Container}.\n * @param container - The parent container.\n * @hidden\n */\n constructor(\n public readonly container: Container,\n private readonly clientContext: ClientContext,\n ) {\n this.partitionKeyRangeCache = new PartitionKeyRangeCache(this.clientContext);\n }\n\n /**\n * Queries all items.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const querySpec: SqlQuerySpec = {\n * query: \"SELECT * FROM Families f WHERE f.lastName = @lastName\",\n * parameters: [\n * {name: \"@lastName\", value: \"Hendricks\"}\n * ]\n * };\n * const {result: items} = await items.query(querySpec).fetchAll();\n * ```\n */\n public query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;\n /**\n * Queries all items.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const querySpec: SqlQuerySpec = {\n * query: \"SELECT firstname FROM Families f WHERE f.lastName = @lastName\",\n * parameters: [\n * {name: \"@lastName\", value: \"Hendricks\"}\n * ]\n * };\n * const {result: items} = await items.query<{firstName: string}>(querySpec).fetchAll();\n * ```\n */\n public query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;\n public query<T>(query: string | SqlQuerySpec, options: FeedOptions = {}): QueryIterator<T> {\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n\n const fetchFunction: FetchFunctionCallback = async (\n diagnosticNode: DiagnosticNodeInternal,\n innerOptions: FeedOptions,\n correlatedActivityId: string,\n ) => {\n const response = await this.clientContext.queryFeed({\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n resultFn: (result) => (result ? result.Documents : []),\n query,\n options: innerOptions,\n partitionKey: options.partitionKey,\n diagnosticNode,\n correlatedActivityId: correlatedActivityId,\n });\n return response;\n };\n\n return new QueryIterator(\n this.clientContext,\n query,\n options,\n fetchFunction,\n this.container.url,\n ResourceType.item,\n );\n }\n\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n *\n * @deprecated Use `changeFeed` instead.\n *\n * @example Read from the beginning of the change feed.\n * ```javascript\n * const iterator = items.readChangeFeed({ startFromBeginning: true });\n * const firstPage = await iterator.fetchNext();\n * const firstPageResults = firstPage.result\n * const secondPage = await iterator.fetchNext();\n * ```\n */\n public readChangeFeed(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n * @deprecated Use `changeFeed` instead.\n *\n */\n public readChangeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n * @deprecated Use `changeFeed` instead.\n */\n public readChangeFeed<T>(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n * @deprecated Use `changeFeed` instead.\n */\n public readChangeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;\n public readChangeFeed<T>(\n partitionKeyOrChangeFeedOptions?: PartitionKey | ChangeFeedOptions,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T> {\n if (isChangeFeedOptions(partitionKeyOrChangeFeedOptions)) {\n return this.changeFeed(partitionKeyOrChangeFeedOptions);\n } else {\n return this.changeFeed(partitionKeyOrChangeFeedOptions, changeFeedOptions);\n }\n }\n\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n *\n * @example Read from the beginning of the change feed.\n * ```javascript\n * const iterator = items.readChangeFeed({ startFromBeginning: true });\n * const firstPage = await iterator.fetchNext();\n * const firstPageResults = firstPage.result\n * const secondPage = await iterator.fetchNext();\n * ```\n */\n public changeFeed(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n */\n public changeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n */\n public changeFeed<T>(\n partitionKey: PartitionKey,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T>;\n /**\n * Create a `ChangeFeedIterator` to iterate over pages of changes\n */\n public changeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;\n public changeFeed<T>(\n partitionKeyOrChangeFeedOptions?: PartitionKey | ChangeFeedOptions,\n changeFeedOptions?: ChangeFeedOptions,\n ): ChangeFeedIterator<T> {\n let partitionKey: PartitionKey;\n if (!changeFeedOptions && isChangeFeedOptions(partitionKeyOrChangeFeedOptions)) {\n partitionKey = undefined;\n changeFeedOptions = partitionKeyOrChangeFeedOptions;\n } else if (\n partitionKeyOrChangeFeedOptions !== undefined &&\n !isChangeFeedOptions(partitionKeyOrChangeFeedOptions)\n ) {\n partitionKey = partitionKeyOrChangeFeedOptions;\n }\n\n if (!changeFeedOptions) {\n changeFeedOptions = {};\n }\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n return new ChangeFeedIterator<T>(this.clientContext, id, path, partitionKey, changeFeedOptions);\n }\n\n /**\n * Returns an iterator to iterate over pages of changes. The iterator returned can be used to fetch changes for a single partition key, feed range or an entire container.\n */\n public getChangeFeedIterator<T>(\n changeFeedIteratorOptions?: ChangeFeedIteratorOptions,\n ): ChangeFeedPullModelIterator<T> {\n const cfOptions = changeFeedIteratorOptions !== undefined ? changeFeedIteratorOptions : {};\n validateChangeFeedIteratorOptions(cfOptions);\n const iterator = changeFeedIteratorBuilder(\n cfOptions,\n this.clientContext,\n this.container,\n this.partitionKeyRangeCache,\n );\n return iterator;\n }\n\n /**\n * Read all items.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const {body: containerList} = await items.readAll().fetchAll();\n * ```\n */\n public readAll(options?: FeedOptions): QueryIterator<ItemDefinition>;\n /**\n * Read all items.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n * @example Read all items to array.\n * ```typescript\n * const {body: containerList} = await items.readAll().fetchAll();\n * ```\n */\n public readAll<T extends ItemDefinition>(options?: FeedOptions): QueryIterator<T>;\n public readAll<T extends ItemDefinition>(options?: FeedOptions): QueryIterator<T> {\n return this.query<T>(\"SELECT * from c\", options);\n }\n\n /**\n * Create an item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - Represents the body of the item. Can contain any number of user defined properties.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n */\n public async create<T extends ItemDefinition = any>(\n body: T,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n // Generate random document id if the id is missing in the payload and\n // options.disableAutomaticIdGeneration != true\n\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n if ((body.id === undefined || body.id === \"\") && !options.disableAutomaticIdGeneration) {\n body.id = randomUUID();\n }\n const partitionKeyDefinition = await readPartitionKeyDefinition(\n diagnosticNode,\n this.container,\n );\n const partitionKey = extractPartitionKeys(body, partitionKeyDefinition);\n\n const err = {};\n if (!isItemResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n\n const response = await this.clientContext.create<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n diagnosticNode,\n options,\n partitionKey,\n });\n\n const ref = new Item(\n this.container,\n (response.result as any).id,\n this.clientContext,\n partitionKey,\n );\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n ref,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Upsert an item.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - Represents the body of the item. Can contain any number of user defined properties.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n */\n public async upsert(\n body: unknown,\n options?: RequestOptions,\n ): Promise<ItemResponse<ItemDefinition>>;\n /**\n * Upsert an item.\n *\n * Any provided type, T, is not necessarily enforced by the SDK.\n * You may get more or less properties and it's up to your logic to enforce it.\n *\n * There is no set schema for JSON items. They may contain any number of custom properties.\n *\n * @param body - Represents the body of the item. Can contain any number of user defined properties.\n * @param options - Used for modifying the request (for instance, specifying the partition key).\n */\n public async upsert<T extends ItemDefinition>(\n body: T,\n options?: RequestOptions,\n ): Promise<ItemResponse<T>>;\n public async upsert<T extends ItemDefinition>(\n body: T,\n options: RequestOptions = {},\n ): Promise<ItemResponse<T>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n // Generate random document id if the id is missing in the payload and\n // options.disableAutomaticIdGeneration != true\n if ((body.id === undefined || body.id === \"\") && !options.disableAutomaticIdGeneration) {\n body.id = randomUUID();\n }\n\n const partitionKeyDefinition = await readPartitionKeyDefinition(\n diagnosticNode,\n this.container,\n );\n const partitionKey = extractPartitionKeys(body, partitionKeyDefinition);\n\n const err = {};\n if (!isItemResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n const id = getIdFromLink(this.container.url);\n\n const response = await this.clientContext.upsert<T>({\n body,\n path,\n resourceType: ResourceType.item,\n resourceId: id,\n options,\n partitionKey,\n diagnosticNode,\n });\n\n const ref = new Item(\n this.container,\n (response.result as any).id,\n this.clientContext,\n partitionKey,\n );\n return new ItemResponse(\n response.result,\n response.headers,\n response.code,\n response.substatus,\n ref,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Execute bulk operations on items.\n *\n * Bulk takes an array of Operations which are typed based on what the operation does.\n * The choices are: Create, Upsert, Read, Replace, and Delete\n *\n * Usage example:\n * ```typescript\n * // partitionKey is optional at the top level if present in the resourceBody\n * const operations: OperationInput[] = [\n * {\n * operationType: \"Create\",\n * resourceBody: { id: \"doc1\", name: \"sample\", key: \"A\" }\n * },\n * {\n * operationType: \"Upsert\",\n * partitionKey: 'A',\n * resourceBody: { id: \"doc2\", name: \"other\", key: \"A\" }\n * }\n * ]\n *\n * await database.container.items.bulk(operations)\n * ```\n *\n * @param operations - List of operations. Limit 100\n * @param bulkOptions - Optional options object to modify bulk behavior. Pass \\{ continueOnError: false \\} to stop executing operations when one fails. (Defaults to true)\n * @param options - Used for modifying the request.\n */\n public async bulk(\n operations: OperationInput[],\n bulkOptions?: BulkOptions,\n options?: RequestOptions,\n ): Promise<BulkOperationResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const partitionKeyRanges = (\n await this.partitionKeyRangeCache.onCollectionRoutingMap(this.container.url, diagnosticNode)\n ).getOrderedParitionKeyRanges();\n\n const partitionKeyDefinition = await readPartitionKeyDefinition(\n diagnosticNode,\n this.container,\n );\n const batches: Batch[] = partitionKeyRanges.map((keyRange: PartitionKeyRange) => {\n return {\n min: keyRange.minInclusive,\n max: keyRange.maxExclusive,\n rangeId: keyRange.id,\n indexes: [],\n operations: [],\n };\n });\n\n this.groupOperationsBasedOnPartitionKey(operations, partitionKeyDefinition, options, batches);\n\n const path = getPathFromLink(this.container.url, ResourceType.item);\n\n const orderedResponses: OperationResponse[] = [];\n // split batches based on cumulative size of operations\n const batchMap = batches\n .filter((batch: Batch) => batch.operations.length)\n .flatMap((batch: Batch) => splitBatchBasedOnBodySize(batch));\n\n await Promise.all(\n this.executeBatchOperations(\n batchMap,\n path,\n bulkOptions,\n options,\n diagnosticNode,\n orderedResponses,\n partitionKeyDefinition,\n ),\n );\n const response: any = orderedResponses;\n response.diagnostics = diagnosticNode.toDiagnostic(this.clientContext.getClientConfig());\n return response;\n }, this.clientContext);\n }\n\n private executeBatchOperations(\n batchMap: Batch[],\n path: string,\n bulkOptions: BulkOptions,\n options: RequestOptions,\n diagnosticNode: DiagnosticNodeInternal,\n orderedResponses: OperationResponse[],\n partitionKeyDefinition: PartitionKeyDefinition,\n ): Promise<void>[] {\n return batchMap.map(async (batch: Batch) => {\n if (batch.operations.length > 100) {\n throw new Error(\"Cannot run bulk request with more than 100 operations per partition\");\n }\n try {\n const response = await addDignosticChild(\n async (childNode: DiagnosticNodeInternal) =>\n this.clientContext.bulk({\n body: batch.operations,\n partitionKeyRangeId: batch.rangeId,\n path,\n resourceId: this.container.url,\n bulkOptions,\n options,\n diagnosticNode: childNode,\n }),\n diagnosticNode,\n DiagnosticNodeType.BATCH_REQUEST,\n );\n response.result.forEach((operationResponse: OperationResponse, index: number) => {\n orderedResponses[batch.indexes[index]] = operationResponse;\n });\n } catch (err: any) {\n // In the case of 410 errors, we need to recompute the partition key ranges\n // and redo the batch request, however, 410 errors occur for unsupported\n // partition key types as well since we don't support them, so for now we throw\n if (err.code === StatusCodes.Gone) {\n const isPartitionSplit =\n err.substatus === SubStatusCodes.PartitionKeyRangeGone ||\n err.substatus === SubStatusCodes.CompletingSplit;\n\n if (isPartitionSplit) {\n const queryRange = new QueryRange(batch.min, batch.max, true, false);\n const overlappingRanges = await this.partitionKeyRangeCache.getOverlappingRanges(\n this.container.url,\n queryRange,\n diagnosticNode,\n true,\n );\n if (overlappingRanges.length < 1) {\n throw new Error(\"Partition split/merge detected but no overlapping ranges found.\");\n }\n // Handles both merge (overlappingRanges.length === 1) and split (overlappingRanges.length > 1) cases.\n if (overlappingRanges.length >= 1) {\n // const splitBatches: Batch[] = [];\n const newBatches: Batch[] = this.createNewBatches(\n overlappingRanges,\n batch,\n partitionKeyDefinition,\n );\n\n await Promise.all(\n this.executeBatchOperations(\n newBatches,\n path,\n bulkOptions,\n options,\n diagnosticNode,\n orderedResponses,\n partitionKeyDefinition,\n ),\n );\n }\n } else {\n throw new Error(\n \"Partition key error. An operation has an unsupported partitionKey type\" +\n err.message,\n );\n }\n } else {\n throw new Error(`Bulk request errored with: ${err.message}`);\n }\n }\n });\n }\n\n /**\n * Function to create new batches based of partition key Ranges.\n *\n * @param overlappingRanges - Overlapping partition key ranges.\n * @param batch - Batch to be split.\n * @param partitionKeyDefinition - PartitionKey definition of container.\n * @returns Array of new batches.\n */\n private createNewBatches(\n overlappingRanges: PartitionKeyRange[],\n batch: Batch,\n partitionKeyDefinition: PartitionKeyDefinition,\n ): Batch[] {\n const newBatches: Batch[] = overlappingRanges.map((keyRange: PartitionKeyRange) => {\n return {\n min: keyRange.minInclusive,\n max: keyRange.maxExclusive,\n rangeId: keyRange.id,\n indexes: [],\n operations: [],\n };\n });\n let indexValue = 0;\n batch.operations.forEach((operation) => {\n const partitionKey = JSON.parse(operation.partitionKey);\n const hashed = hashPartitionKey(\n assertNotUndefined(\n partitionKey,\n \"undefined value for PartitionKey is not expected during grouping of bulk operations.\",\n ),\n partitionKeyDefinition,\n );\n const batchForKey = assertNotUndefined(\n newBatches.find((newBatch: Batch) => {\n return isKeyInRange(newBatch.min, newBatch.max, hashed);\n }),\n \"No suitable Batch found.\",\n );\n batchForKey.operations.push(operation);\n batchForKey.indexes.push(batch.indexes[indexValue]);\n indexValue++;\n });\n return newBatches;\n }\n\n /**\n * Function to create batches based of partition key Ranges.\n * @param operations - operations to group\n * @param partitionDefinition - PartitionKey definition of container.\n * @param options - Request options for bulk request.\n * @param batches - Groups to be filled with operations.\n */\n private groupOperationsBasedOnPartitionKey(\n operations: OperationInput[],\n partitionDefinition: PartitionKeyDefinition,\n options: RequestOptions | undefined,\n batches: Batch[],\n ) {\n operations.forEach((operationInput, index: number) => {\n const { operation, partitionKey } = prepareOperations(\n operationInput,\n partitionDefinition,\n options,\n );\n const hashed = hashPartitionKey(\n assertNotUndefined(\n partitionKey,\n \"undefined value for PartitionKey is not expected during grouping of bulk operations.\",\n ),\n partitionDefinition,\n );\n const batchForKey = assertNotUndefined(\n batches.find((batch: Batch) => {\n return isKeyInRange(batch.min, batch.max, hashed);\n }),\n \"No suitable Batch found.\",\n );\n batchForKey.operations.push(operation);\n batchForKey.indexes.push(index);\n });\n }\n\n /**\n * Execute transactional batch operations on items.\n *\n * Batch takes an array of Operations which are typed based on what the operation does. Batch is transactional and will rollback all operations if one fails.\n * The choices are: Create, Upsert, Read, Replace, and Delete\n *\n * Usage example:\n * ```typescript\n * // The partitionKey is a required second argument. If it’s undefined, it defaults to the expected partition key format.\n * const operations: OperationInput[] = [\n * {\n * operationType: \"Create\",\n * resourceBody: { id: \"doc1\", name: \"sample\", key: \"A\" }\n * },\n * {\n * operationType: \"Upsert\",\n * resourceBody: { id: \"doc2\", name: \"other\", key: \"A\" }\n * }\n * ]\n *\n * await database.container.items.batch(operations, \"A\")\n * ```\n *\n * @param operations - List of operations. Limit 100\n * @param options - Used for modifying the request\n */\n public async batch(\n operations: OperationInput[],\n partitionKey?: PartitionKey,\n options?: RequestOptions,\n ): Promise<Response<OperationResponse[]>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n operations.map((operation) => decorateBatchOperation(operation, options));\n partitionKey = await setPartitionKeyIfUndefined(diagnosticNode, this.container, partitionKey);\n const path = getPathFromLink(this.container.url, ResourceType.item);\n\n if (operations.length > 100) {\n throw new Error(\"Cannot run batch request with more than 100 operations per partition\");\n }\n try {\n const response: Response<OperationResponse[]> = await this.clientContext.batch({\n body: operations,\n partitionKey,\n path,\n resourceId: this.container.url,\n options,\n diagnosticNode,\n });\n return response;\n } catch (err: any) {\n throw new Error(`Batch request error: ${err.message}`);\n }\n }, this.clientContext);\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClientContext } from "../../ClientContext";
|
|
2
|
-
import { CosmosClient } from "../../CosmosClient";
|
|
3
|
-
import { RequestOptions } from "../../request";
|
|
4
|
-
import { OfferDefinition } from "./OfferDefinition";
|
|
1
|
+
import type { ClientContext } from "../../ClientContext";
|
|
2
|
+
import type { CosmosClient } from "../../CosmosClient";
|
|
3
|
+
import type { RequestOptions } from "../../request";
|
|
4
|
+
import type { OfferDefinition } from "./OfferDefinition";
|
|
5
5
|
import { OfferResponse } from "./OfferResponse";
|
|
6
6
|
/**
|
|
7
7
|
* Use to read or replace an existing {@link Offer} by id.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Offer.d.ts","sourceRoot":"","sources":["../../../../src/client/Offer/Offer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Offer.d.ts","sourceRoot":"","sources":["../../../../src/client/Offer/Offer.ts"],"names":[],"mappings":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AChB,QAAQ,CAAC,IAAI,EACb,yBAAyB,EAAE,EAC3B,IAAI,CACL,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ClientContext } from \"../../ClientContext\";\nimport { Constants, isResourceValid, ResourceType } from \"../../common\";\nimport { CosmosClient } from \"../../CosmosClient\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"../../utils/diagnostics\";\nimport { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport { RequestOptions } from \"../../request\";\nimport { OfferDefinition } from \"./OfferDefinition\";\nimport { OfferResponse } from \"./OfferResponse\";\n\n/**\n * Use to read or replace an existing {@link Offer} by id.\n *\n * @see {@link Offers} to query or read all offers.\n */\nexport class Offer {\n /**\n * Returns a reference URL to the resource. Used for linking in Permissions.\n */\n public get url(): string {\n return `/${Constants.Path.OffersPathSegment}/${this.id}`;\n }\n /**\n * @hidden\n * @param client - The parent {@link CosmosClient} for the Database Account.\n * @param id - The id of the given {@link Offer}.\n */\n constructor(\n public readonly client: CosmosClient,\n public readonly id: string,\n private readonly clientContext: ClientContext,\n ) {}\n\n /**\n * Read the {@link OfferDefinition} for the given {@link Offer}.\n */\n public async read(options?: RequestOptions): Promise<OfferResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const response = await this.clientContext.read<OfferDefinition>({\n path: this.url,\n resourceType: ResourceType.offer,\n resourceId: this.id,\n options,\n diagnosticNode,\n });\n return new OfferResponse(\n response.result,\n response.headers,\n response.code,\n getEmptyCosmosDiagnostics(),\n this,\n );\n }, this.clientContext);\n }\n\n /**\n * Replace the given {@link Offer} with the specified {@link OfferDefinition}.\n * @param body - The specified {@link OfferDefinition}\n */\n public async replace(body: OfferDefinition, options?: RequestOptions): Promise<OfferResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const err = {};\n if (!isResourceValid(body, err)) {\n throw err;\n }\n const response = await this.clientContext.replace<OfferDefinition>({\n body,\n path: this.url,\n resourceType: ResourceType.offer,\n resourceId: this.id,\n options,\n diagnosticNode,\n });\n return new OfferResponse(\n response.result,\n response.headers,\n response.code,\n getEmptyCosmosDiagnostics(),\n this,\n );\n }, this.clientContext);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Offer.js","sourceRoot":"","sources":["../../../../src/client/Offer/Offer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAIrF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,KAAK;IAChB;;OAEG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3D,CAAC;IACD;;;;OAIG;IACH,YACkB,MAAoB,EACpB,EAAU,EACT,aAA4B;QAF7B,WAAM,GAAN,MAAM,CAAc;QACpB,OAAE,GAAF,EAAE,CAAQ;QACT,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ;;OAEG;IACI,KAAK,CAAC,IAAI,CAAC,OAAwB;QACxC,OAAO,eAAe,CAAC,KAAK,EAAE,cAAsC,EAAE,EAAE;YACtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAkB;gBAC9D,IAAI,EAAE,IAAI,CAAC,GAAG;gBACd,YAAY,EAAE,YAAY,CAAC,KAAK;gBAChC,UAAU,EAAE,IAAI,CAAC,EAAE;gBACnB,OAAO;gBACP,cAAc;aACf,CAAC,CAAC;YACH,OAAO,IAAI,aAAa,CACtB,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,yBAAyB,EAAE,EAC3B,IAAI,CACL,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,OAAwB;QAClE,OAAO,eAAe,CAAC,KAAK,EAAE,cAAsC,EAAE,EAAE;YACtE,MAAM,GAAG,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;gBAChC,MAAM,GAAG,CAAC;YACZ,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAkB;gBACjE,IAAI;gBACJ,IAAI,EAAE,IAAI,CAAC,GAAG;gBACd,YAAY,EAAE,YAAY,CAAC,KAAK;gBAChC,UAAU,EAAE,IAAI,CAAC,EAAE;gBACnB,OAAO;gBACP,cAAc;aACf,CAAC,CAAC;YACH,OAAO,IAAI,aAAa,CACtB,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,yBAAyB,EAAE,EAC3B,IAAI,CACL,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ClientContext } from \"../../ClientContext\";\nimport { Constants, isResourceValid, ResourceType } from \"../../common\";\nimport type { CosmosClient } from \"../../CosmosClient\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"../../utils/diagnostics\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport type { RequestOptions } from \"../../request\";\nimport type { OfferDefinition } from \"./OfferDefinition\";\nimport { OfferResponse } from \"./OfferResponse\";\n\n/**\n * Use to read or replace an existing {@link Offer} by id.\n *\n * @see {@link Offers} to query or read all offers.\n */\nexport class Offer {\n /**\n * Returns a reference URL to the resource. Used for linking in Permissions.\n */\n public get url(): string {\n return `/${Constants.Path.OffersPathSegment}/${this.id}`;\n }\n /**\n * @hidden\n * @param client - The parent {@link CosmosClient} for the Database Account.\n * @param id - The id of the given {@link Offer}.\n */\n constructor(\n public readonly client: CosmosClient,\n public readonly id: string,\n private readonly clientContext: ClientContext,\n ) {}\n\n /**\n * Read the {@link OfferDefinition} for the given {@link Offer}.\n */\n public async read(options?: RequestOptions): Promise<OfferResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const response = await this.clientContext.read<OfferDefinition>({\n path: this.url,\n resourceType: ResourceType.offer,\n resourceId: this.id,\n options,\n diagnosticNode,\n });\n return new OfferResponse(\n response.result,\n response.headers,\n response.code,\n getEmptyCosmosDiagnostics(),\n this,\n );\n }, this.clientContext);\n }\n\n /**\n * Replace the given {@link Offer} with the specified {@link OfferDefinition}.\n * @param body - The specified {@link OfferDefinition}\n */\n public async replace(body: OfferDefinition, options?: RequestOptions): Promise<OfferResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const err = {};\n if (!isResourceValid(body, err)) {\n throw err;\n }\n const response = await this.clientContext.replace<OfferDefinition>({\n body,\n path: this.url,\n resourceType: ResourceType.offer,\n resourceId: this.id,\n options,\n diagnosticNode,\n });\n return new OfferResponse(\n response.result,\n response.headers,\n response.code,\n getEmptyCosmosDiagnostics(),\n this,\n );\n }, this.clientContext);\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CosmosDiagnostics } from "../../CosmosDiagnostics";
|
|
2
|
-
import { CosmosHeaders } from "../../queryExecutionContext";
|
|
1
|
+
import type { CosmosDiagnostics } from "../../CosmosDiagnostics";
|
|
2
|
+
import type { CosmosHeaders } from "../../queryExecutionContext";
|
|
3
3
|
import { ResourceResponse } from "../../request";
|
|
4
|
-
import { Resource } from "../Resource";
|
|
5
|
-
import { Offer } from "./Offer";
|
|
6
|
-
import { OfferDefinition } from "./OfferDefinition";
|
|
4
|
+
import type { Resource } from "../Resource";
|
|
5
|
+
import type { Offer } from "./Offer";
|
|
6
|
+
import type { OfferDefinition } from "./OfferDefinition";
|
|
7
7
|
export declare class OfferResponse extends ResourceResponse<OfferDefinition & Resource> {
|
|
8
8
|
constructor(resource: OfferDefinition & Resource, headers: CosmosHeaders, statusCode: number, diagnostics: CosmosDiagnostics, offer?: Offer);
|
|
9
9
|
/** A reference to the {@link Offer} corresponding to the returned {@link OfferDefinition}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferResponse.d.ts","sourceRoot":"","sources":["../../../../src/client/Offer/OfferResponse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"OfferResponse.d.ts","sourceRoot":"","sources":["../../../../src/client/Offer/OfferResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,qBAAa,aAAc,SAAQ,gBAAgB,CAAC,eAAe,GAAG,QAAQ,CAAC;gBAE3E,QAAQ,EAAE,eAAe,GAAG,QAAQ,EACpC,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,iBAAiB,EAC9B,KAAK,CAAC,EAAE,KAAK;IAKf,8FAA8F;IAC9F,SAAgB,KAAK,EAAE,KAAK,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferResponse.js","sourceRoot":"","sources":["../../../../src/client/Offer/OfferResponse.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKjD,MAAM,OAAO,aAAc,SAAQ,gBAA4C;IAC7E,YACE,QAAoC,EACpC,OAAsB,EACtB,UAAkB,EAClB,WAA8B,EAC9B,KAAa;QAEb,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CAGF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CosmosDiagnostics } from \"../../CosmosDiagnostics\";\nimport { CosmosHeaders } from \"../../queryExecutionContext\";\nimport { ResourceResponse } from \"../../request\";\nimport { Resource } from \"../Resource\";\nimport { Offer } from \"./Offer\";\nimport { OfferDefinition } from \"./OfferDefinition\";\n\nexport class OfferResponse extends ResourceResponse<OfferDefinition & Resource> {\n constructor(\n resource: OfferDefinition & Resource,\n headers: CosmosHeaders,\n statusCode: number,\n diagnostics: CosmosDiagnostics,\n offer?: Offer,\n ) {\n super(resource, headers, statusCode, diagnostics);\n this.offer = offer;\n }\n /** A reference to the {@link Offer} corresponding to the returned {@link OfferDefinition}. */\n public readonly offer: Offer;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OfferResponse.js","sourceRoot":"","sources":["../../../../src/client/Offer/OfferResponse.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKjD,MAAM,OAAO,aAAc,SAAQ,gBAA4C;IAC7E,YACE,QAAoC,EACpC,OAAsB,EACtB,UAAkB,EAClB,WAA8B,EAC9B,KAAa;QAEb,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CAGF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { CosmosDiagnostics } from \"../../CosmosDiagnostics\";\nimport type { CosmosHeaders } from \"../../queryExecutionContext\";\nimport { ResourceResponse } from \"../../request\";\nimport type { Resource } from \"../Resource\";\nimport type { Offer } from \"./Offer\";\nimport type { OfferDefinition } from \"./OfferDefinition\";\n\nexport class OfferResponse extends ResourceResponse<OfferDefinition & Resource> {\n constructor(\n resource: OfferDefinition & Resource,\n headers: CosmosHeaders,\n statusCode: number,\n diagnostics: CosmosDiagnostics,\n offer?: Offer,\n ) {\n super(resource, headers, statusCode, diagnostics);\n this.offer = offer;\n }\n /** A reference to the {@link Offer} corresponding to the returned {@link OfferDefinition}. */\n public readonly offer: Offer;\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ClientContext } from "../../ClientContext";
|
|
2
|
-
import { CosmosClient } from "../../CosmosClient";
|
|
3
|
-
import { SqlQuerySpec } from "../../queryExecutionContext";
|
|
1
|
+
import type { ClientContext } from "../../ClientContext";
|
|
2
|
+
import type { CosmosClient } from "../../CosmosClient";
|
|
3
|
+
import type { SqlQuerySpec } from "../../queryExecutionContext";
|
|
4
4
|
import { QueryIterator } from "../../queryIterator";
|
|
5
|
-
import { FeedOptions } from "../../request";
|
|
6
|
-
import { Resource } from "../Resource";
|
|
7
|
-
import { OfferDefinition } from "./OfferDefinition";
|
|
5
|
+
import type { FeedOptions } from "../../request";
|
|
6
|
+
import type { Resource } from "../Resource";
|
|
7
|
+
import type { OfferDefinition } from "./OfferDefinition";
|
|
8
8
|
/**
|
|
9
9
|
* Use to query or read all Offers.
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Offers.d.ts","sourceRoot":"","sources":["../../../../src/client/Offer/Offers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Offers.d.ts","sourceRoot":"","sources":["../../../../src/client/Offer/Offers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;GAIG;AACH,qBAAa,MAAM;aAMC,MAAM,EAAE,YAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,aAAa;IANhC;;;OAGG;gBAEe,MAAM,EAAE,YAAY,EACnB,aAAa,EAAE,aAAa;IAG/C;;;OAGG;IACI,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC;IAC5E;;;OAGG;IACI,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC;IAe7E;;;;;;OAMG;IACI,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC,eAAe,GAAG,QAAQ,CAAC;CAGjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Offers.js","sourceRoot":"","sources":["../../../../src/client/Offer/Offers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACjB;;;OAGG;IACH,YACkB,MAAoB,EACnB,aAA4B;QAD7B,WAAM,GAAN,MAAM,CAAc;QACnB,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAYG,KAAK,CAAI,KAAmB,EAAE,OAAqB;QACxD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE;YAC5F,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAI;gBACrC,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,YAAY,CAAC,KAAK;gBAChC,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM;gBACnC,KAAK;gBACL,OAAO,EAAE,YAAY;gBACrB,cAAc;aACf,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CAAC,OAAqB;QAClC,OAAO,IAAI,CAAC,KAAK,CAA6B,SAAS,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ClientContext } from \"../../ClientContext\";\nimport { ResourceType } from \"../../common\";\nimport { CosmosClient } from \"../../CosmosClient\";\nimport { SqlQuerySpec } from \"../../queryExecutionContext\";\nimport { QueryIterator } from \"../../queryIterator\";\nimport { FeedOptions } from \"../../request\";\nimport { Resource } from \"../Resource\";\nimport { OfferDefinition } from \"./OfferDefinition\";\n\n/**\n * Use to query or read all Offers.\n *\n * @see {@link Offer} to read or replace an existing {@link Offer} by id.\n */\nexport class Offers {\n /**\n * @hidden\n * @param client - The parent {@link CosmosClient} for the offers.\n */\n constructor(\n public readonly client: CosmosClient,\n private readonly clientContext: ClientContext,\n ) {}\n\n /**\n * Query all offers.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n */\n public query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;\n /**\n * Query all offers.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n */\n public query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;\n public query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T> {\n return new QueryIterator(this.clientContext, query, options, (diagnosticNode, innerOptions) => {\n return this.clientContext.queryFeed<T>({\n path: \"/offers\",\n resourceType: ResourceType.offer,\n resourceId: \"\",\n resultFn: (result) => result.Offers,\n query,\n options: innerOptions,\n diagnosticNode,\n });\n });\n }\n\n /**\n * Read all offers.\n * @example Read all offers to array.\n * ```typescript\n * const {body: offerList} = await client.offers.readAll().fetchAll();\n * ```\n */\n public readAll(options?: FeedOptions): QueryIterator<OfferDefinition & Resource> {\n return this.query<OfferDefinition & Resource>(undefined, options);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Offers.js","sourceRoot":"","sources":["../../../../src/client/Offer/Offers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACjB;;;OAGG;IACH,YACkB,MAAoB,EACnB,aAA4B;QAD7B,WAAM,GAAN,MAAM,CAAc;QACnB,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAYG,KAAK,CAAI,KAAmB,EAAE,OAAqB;QACxD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE;YAC5F,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAI;gBACrC,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,YAAY,CAAC,KAAK;gBAChC,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM;gBACnC,KAAK;gBACL,OAAO,EAAE,YAAY;gBACrB,cAAc;aACf,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CAAC,OAAqB;QAClC,OAAO,IAAI,CAAC,KAAK,CAA6B,SAAS,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ClientContext } from \"../../ClientContext\";\nimport { ResourceType } from \"../../common\";\nimport type { CosmosClient } from \"../../CosmosClient\";\nimport type { SqlQuerySpec } from \"../../queryExecutionContext\";\nimport { QueryIterator } from \"../../queryIterator\";\nimport type { FeedOptions } from \"../../request\";\nimport type { Resource } from \"../Resource\";\nimport type { OfferDefinition } from \"./OfferDefinition\";\n\n/**\n * Use to query or read all Offers.\n *\n * @see {@link Offer} to read or replace an existing {@link Offer} by id.\n */\nexport class Offers {\n /**\n * @hidden\n * @param client - The parent {@link CosmosClient} for the offers.\n */\n constructor(\n public readonly client: CosmosClient,\n private readonly clientContext: ClientContext,\n ) {}\n\n /**\n * Query all offers.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n */\n public query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;\n /**\n * Query all offers.\n * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.\n */\n public query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;\n public query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T> {\n return new QueryIterator(this.clientContext, query, options, (diagnosticNode, innerOptions) => {\n return this.clientContext.queryFeed<T>({\n path: \"/offers\",\n resourceType: ResourceType.offer,\n resourceId: \"\",\n resultFn: (result) => result.Offers,\n query,\n options: innerOptions,\n diagnosticNode,\n });\n });\n }\n\n /**\n * Read all offers.\n * @example Read all offers to array.\n * ```typescript\n * const {body: offerList} = await client.offers.readAll().fetchAll();\n * ```\n */\n public readAll(options?: FeedOptions): QueryIterator<OfferDefinition & Resource> {\n return this.query<OfferDefinition & Resource>(undefined, options);\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClientContext } from "../../ClientContext";
|
|
2
|
-
import { RequestOptions } from "../../request/RequestOptions";
|
|
3
|
-
import { User } from "../User";
|
|
4
|
-
import { PermissionDefinition } from "./PermissionDefinition";
|
|
1
|
+
import type { ClientContext } from "../../ClientContext";
|
|
2
|
+
import type { RequestOptions } from "../../request/RequestOptions";
|
|
3
|
+
import type { User } from "../User";
|
|
4
|
+
import type { PermissionDefinition } from "./PermissionDefinition";
|
|
5
5
|
import { PermissionResponse } from "./PermissionResponse";
|
|
6
6
|
/**
|
|
7
7
|
* Use to read, replace, or delete a given {@link Permission} by id.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Permission.d.ts","sourceRoot":"","sources":["../../../../src/client/Permission/Permission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Permission.d.ts","sourceRoot":"","sources":["../../../../src/client/Permission/Permission.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D;;;;GAIG;AACH,qBAAa,UAAU;aAaH,IAAI,EAAE,IAAI;aACV,EAAE,EAAE,MAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAdhC;;OAEG;IACH,IAAW,GAAG,IAAI,MAAM,CAEvB;IACD;;;;OAIG;gBAEe,IAAI,EAA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AC,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM,CAAC,OAAwB;QAC1C,OAAO,eAAe,CAAC,KAAK,EAAE,cAAsC,EAAE,EAAE;YACtE,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAwC;gBACtF,IAAI;gBACJ,YAAY,EAAE,YAAY,CAAC,UAAU;gBACrC,UAAU,EAAE,EAAE;gBACd,OAAO;gBACP,cAAc;aACf,CAAC,CAAC;YACH,OAAO,IAAI,kBAAkB,CAC3B,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,IAAI,EACJ,yBAAyB,EAAE,CAC5B,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ClientContext } from \"../../ClientContext\";\nimport { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport {\n createPermissionUri,\n getIdFromLink,\n getPathFromLink,\n isResourceValid,\n ResourceType,\n} from \"../../common\";\nimport { RequestOptions } from \"../../request/RequestOptions\";\nimport { User } from \"../User\";\nimport { PermissionBody } from \"./PermissionBody\";\nimport { PermissionDefinition } from \"./PermissionDefinition\";\nimport { PermissionResponse } from \"./PermissionResponse\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"../../utils/diagnostics\";\n\n/**\n * Use to read, replace, or delete a given {@link Permission} by id.\n *\n * @see {@link Permissions} to create, upsert, query, or read all Permissions.\n */\nexport class Permission {\n /**\n * Returns a reference URL to the resource. Used for linking in Permissions.\n */\n public get url(): string {\n return createPermissionUri(this.user.database.id, this.user.id, this.id);\n }\n /**\n * @hidden\n * @param user - The parent {@link User}.\n * @param id - The id of the given {@link Permission}.\n */\n constructor(\n public readonly user: User,\n public readonly id: string,\n private readonly clientContext: ClientContext,\n ) {}\n\n /**\n * Read the {@link PermissionDefinition} of the given {@link Permission}.\n */\n public async read(options?: RequestOptions): Promise<PermissionResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.read<PermissionDefinition & PermissionBody>({\n path,\n resourceType: ResourceType.permission,\n resourceId: id,\n options,\n diagnosticNode,\n });\n return new PermissionResponse(\n response.result,\n response.headers,\n response.code,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Replace the given {@link Permission} with the specified {@link PermissionDefinition}.\n * @param body - The specified {@link PermissionDefinition}.\n */\n public async replace(\n body: PermissionDefinition,\n options?: RequestOptions,\n ): Promise<PermissionResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const err = {};\n if (!isResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n const response = await this.clientContext.replace<PermissionDefinition & PermissionBody>({\n body,\n path,\n resourceType: ResourceType.permission,\n resourceId: id,\n options,\n diagnosticNode,\n });\n return new PermissionResponse(\n response.result,\n response.headers,\n response.code,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Delete the given {@link Permission}.\n */\n public async delete(options?: RequestOptions): Promise<PermissionResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n const response = await this.clientContext.delete<PermissionDefinition & PermissionBody>({\n path,\n resourceType: ResourceType.permission,\n resourceId: id,\n options,\n diagnosticNode,\n });\n return new PermissionResponse(\n response.result,\n response.headers,\n response.code,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Permission.js","sourceRoot":"","sources":["../../../../src/client/Permission/Permission.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAErF;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACrB;;OAEG;IACH,IAAW,GAAG;QACZ,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD;;;;OAIG;IACH,YACkB,IAAU,EACV,EAAU,EACT,aAA4B;QAF7B,SAAI,GAAJ,IAAI,CAAM;QACV,OAAE,GAAF,EAAE,CAAQ;QACT,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ;;OAEG;IACI,KAAK,CAAC,IAAI,CAAC,OAAwB;QACxC,OAAO,eAAe,CAAC,KAAK,EAAE,cAAsC,EAAE,EAAE;YACtE,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAwC;gBACpF,IAAI;gBACJ,YAAY,EAAE,YAAY,CAAC,UAAU;gBACrC,UAAU,EAAE,EAAE;gBACd,OAAO;gBACP,cAAc;aACf,CAAC,CAAC;YACH,OAAO,IAAI,kBAAkB,CAC3B,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IA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,EAAE,YAAY,CAAC,UAAU;gBACrC,UAAU,EAAE,EAAE;gBACd,OAAO;gBACP,cAAc;aACf,CAAC,CAAC;YACH,OAAO,IAAI,kBAAkB,CAC3B,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,IAAI,EACJ,yBAAyB,EAAE,CAC5B,CAAC;QACJ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ClientContext } from \"../../ClientContext\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal\";\nimport {\n createPermissionUri,\n getIdFromLink,\n getPathFromLink,\n isResourceValid,\n ResourceType,\n} from \"../../common\";\nimport type { RequestOptions } from \"../../request/RequestOptions\";\nimport type { User } from \"../User\";\nimport type { PermissionBody } from \"./PermissionBody\";\nimport type { PermissionDefinition } from \"./PermissionDefinition\";\nimport { PermissionResponse } from \"./PermissionResponse\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"../../utils/diagnostics\";\n\n/**\n * Use to read, replace, or delete a given {@link Permission} by id.\n *\n * @see {@link Permissions} to create, upsert, query, or read all Permissions.\n */\nexport class Permission {\n /**\n * Returns a reference URL to the resource. Used for linking in Permissions.\n */\n public get url(): string {\n return createPermissionUri(this.user.database.id, this.user.id, this.id);\n }\n /**\n * @hidden\n * @param user - The parent {@link User}.\n * @param id - The id of the given {@link Permission}.\n */\n constructor(\n public readonly user: User,\n public readonly id: string,\n private readonly clientContext: ClientContext,\n ) {}\n\n /**\n * Read the {@link PermissionDefinition} of the given {@link Permission}.\n */\n public async read(options?: RequestOptions): Promise<PermissionResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n\n const response = await this.clientContext.read<PermissionDefinition & PermissionBody>({\n path,\n resourceType: ResourceType.permission,\n resourceId: id,\n options,\n diagnosticNode,\n });\n return new PermissionResponse(\n response.result,\n response.headers,\n response.code,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Replace the given {@link Permission} with the specified {@link PermissionDefinition}.\n * @param body - The specified {@link PermissionDefinition}.\n */\n public async replace(\n body: PermissionDefinition,\n options?: RequestOptions,\n ): Promise<PermissionResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const err = {};\n if (!isResourceValid(body, err)) {\n throw err;\n }\n\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n const response = await this.clientContext.replace<PermissionDefinition & PermissionBody>({\n body,\n path,\n resourceType: ResourceType.permission,\n resourceId: id,\n options,\n diagnosticNode,\n });\n return new PermissionResponse(\n response.result,\n response.headers,\n response.code,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n\n /**\n * Delete the given {@link Permission}.\n */\n public async delete(options?: RequestOptions): Promise<PermissionResponse> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const path = getPathFromLink(this.url);\n const id = getIdFromLink(this.url);\n const response = await this.clientContext.delete<PermissionDefinition & PermissionBody>({\n path,\n resourceType: ResourceType.permission,\n resourceId: id,\n options,\n diagnosticNode,\n });\n return new PermissionResponse(\n response.result,\n response.headers,\n response.code,\n this,\n getEmptyCosmosDiagnostics(),\n );\n }, this.clientContext);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/client/Permission/PermissionDefinition.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"PermissionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/client/Permission/PermissionDefinition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,cAAc,EAAE,cAAc,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;CACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionDefinition.js","sourceRoot":"","sources":["../../../../src/client/Permission/PermissionDefinition.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { PermissionMode } from \"../../documents\";\n\nexport interface PermissionDefinition {\n /** The id of the permission */\n id: string;\n /** The mode of the permission, must be a value of {@link PermissionMode} */\n permissionMode: PermissionMode;\n /** The link of the resource that the permission will be applied to. */\n resource: string;\n resourcePartitionKey?: string | any[]; // TODO: what's allowed here?\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PermissionDefinition.js","sourceRoot":"","sources":["../../../../src/client/Permission/PermissionDefinition.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { PermissionMode } from \"../../documents\";\n\nexport interface PermissionDefinition {\n /** The id of the permission */\n id: string;\n /** The mode of the permission, must be a value of {@link PermissionMode} */\n permissionMode: PermissionMode;\n /** The link of the resource that the permission will be applied to. */\n resource: string;\n resourcePartitionKey?: string | any[]; // TODO: what's allowed here?\n}\n"]}
|