@azure/storage-blob 12.31.0 → 12.32.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/BatchUtils.d.ts +1 -1
- package/dist/browser/BatchUtils.d.ts.map +1 -0
- package/dist/browser/BatchUtils.js +1 -1
- package/dist/browser/BatchUtils.js.map +1 -0
- package/dist/browser/BlobDownloadResponse.d.ts +5 -2
- package/dist/browser/BlobDownloadResponse.d.ts.map +1 -0
- package/dist/browser/BlobDownloadResponse.js +9 -5
- package/dist/browser/BlobDownloadResponse.js.map +1 -0
- package/dist/browser/BlobQueryResponse.d.ts +1 -1
- package/dist/browser/BlobQueryResponse.d.ts.map +1 -0
- package/dist/browser/BlobQueryResponse.js +1 -1
- package/dist/browser/BlobQueryResponse.js.map +1 -0
- package/dist/browser/BlobServiceClient.d.ts +36 -5
- package/dist/browser/BlobServiceClient.d.ts.map +1 -1
- package/dist/browser/BlobServiceClient.js +29 -17
- package/dist/browser/BlobServiceClient.js.map +1 -1
- package/dist/browser/Clients.d.ts +68 -14
- package/dist/browser/Clients.d.ts.map +1 -1
- package/dist/browser/Clients.js +97 -28
- package/dist/browser/Clients.js.map +1 -1
- package/dist/browser/ContainerClient.d.ts +6 -4
- package/dist/browser/ContainerClient.d.ts.map +1 -1
- package/dist/browser/ContainerClient.js +8 -6
- package/dist/browser/ContainerClient.js.map +1 -1
- package/dist/browser/Pipeline.d.ts +2 -3
- package/dist/browser/Pipeline.d.ts.map +1 -1
- package/dist/browser/Pipeline.js.map +1 -1
- package/dist/browser/generated/src/models/index.d.ts +59 -4
- package/dist/browser/generated/src/models/index.d.ts.map +1 -1
- package/dist/browser/generated/src/models/index.js +2 -2
- package/dist/browser/generated/src/models/index.js.map +1 -1
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/models/mappers.js +65 -0
- package/dist/browser/generated/src/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/models/parameters.d.ts +7 -0
- package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/models/parameters.js +71 -1
- package/dist/browser/generated/src/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/operations/appendBlob.js +5 -0
- package/dist/browser/generated/src/operations/appendBlob.js.map +1 -1
- package/dist/browser/generated/src/operations/blob.js +3 -0
- package/dist/browser/generated/src/operations/blob.js.map +1 -1
- package/dist/browser/generated/src/operations/blockBlob.js +10 -0
- package/dist/browser/generated/src/operations/blockBlob.js.map +1 -1
- package/dist/browser/generated/src/operations/pageBlob.js +5 -0
- package/dist/browser/generated/src/operations/pageBlob.js.map +1 -1
- package/dist/browser/generated/src/storageClient.js +2 -2
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/generatedModels.d.ts +4 -4
- package/dist/browser/generatedModels.d.ts.map +1 -1
- package/dist/browser/generatedModels.js.map +1 -1
- package/dist/browser/index.d.ts +9 -9
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +1 -2
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/internal-avro/index.d.ts +9 -2
- package/dist/browser/internal-avro/index.d.ts.map +1 -0
- package/dist/browser/internal-avro/index.js +14 -1
- package/dist/browser/internal-avro/index.js.map +1 -0
- package/dist/browser/models.d.ts +43 -0
- package/dist/browser/models.d.ts.map +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/sas/BlobSASSignatureValues.d.ts +11 -1
- package/dist/browser/sas/BlobSASSignatureValues.d.ts.map +1 -1
- package/dist/browser/sas/BlobSASSignatureValues.js +133 -2
- package/dist/browser/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/SASQueryParameters.d.ts +23 -2
- package/dist/browser/sas/SASQueryParameters.d.ts.map +1 -1
- package/dist/browser/sas/SASQueryParameters.js +34 -2
- package/dist/browser/sas/SASQueryParameters.js.map +1 -1
- package/dist/browser/utils/RetriableReadableStream.d.ts.map +1 -1
- package/dist/browser/utils/RetriableReadableStream.js +1 -0
- package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
- package/dist/browser/utils/constants.d.ts.map +1 -1
- package/dist/browser/utils/constants.js +2 -2
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/utils.common.d.ts +16 -1
- package/dist/browser/utils/utils.common.d.ts.map +1 -1
- package/dist/browser/utils/utils.common.js +26 -0
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/browser/utils/utils.d.ts +12 -6
- package/dist/browser/utils/utils.d.ts.map +1 -0
- package/dist/browser/utils/utils.js +11 -11
- package/dist/browser/utils/utils.js.map +1 -0
- package/dist/commonjs/BatchResponse.js +15 -5
- package/dist/commonjs/BatchResponse.js.map +7 -1
- package/dist/commonjs/BatchResponseParser.js +127 -136
- package/dist/commonjs/BatchResponseParser.js.map +7 -1
- package/dist/commonjs/BatchUtils.js +38 -15
- package/dist/commonjs/BatchUtils.js.map +7 -1
- package/dist/commonjs/BlobBatch.js +280 -258
- package/dist/commonjs/BlobBatch.js.map +7 -1
- package/dist/commonjs/BlobBatchClient.js +188 -169
- package/dist/commonjs/BlobBatchClient.js.map +7 -1
- package/dist/commonjs/BlobDownloadResponse.d.ts +2 -1
- package/dist/commonjs/BlobDownloadResponse.d.ts.map +1 -1
- package/dist/commonjs/BlobDownloadResponse.js +487 -467
- package/dist/commonjs/BlobDownloadResponse.js.map +7 -1
- package/dist/commonjs/BlobLeaseClient.js +226 -196
- package/dist/commonjs/BlobLeaseClient.js.map +7 -1
- package/dist/commonjs/BlobQueryResponse.common.js +378 -365
- package/dist/commonjs/BlobQueryResponse.common.js.map +7 -1
- package/dist/commonjs/BlobQueryResponse.js +387 -371
- package/dist/commonjs/BlobQueryResponse.js.map +7 -1
- package/dist/commonjs/BlobServiceClient.d.ts +36 -5
- package/dist/commonjs/BlobServiceClient.d.ts.map +1 -1
- package/dist/commonjs/BlobServiceClient.js +784 -684
- package/dist/commonjs/BlobServiceClient.js.map +7 -1
- package/dist/commonjs/Clients.d.ts +68 -14
- package/dist/commonjs/Clients.d.ts.map +1 -1
- package/dist/commonjs/Clients.js +3120 -2804
- package/dist/commonjs/Clients.js.map +7 -1
- package/dist/commonjs/ContainerClient.d.ts +6 -4
- package/dist/commonjs/ContainerClient.d.ts.map +1 -1
- package/dist/commonjs/ContainerClient.js +1348 -1253
- package/dist/commonjs/ContainerClient.js.map +7 -1
- package/dist/commonjs/PageBlobRangeResponse.js +45 -31
- package/dist/commonjs/PageBlobRangeResponse.js.map +7 -1
- package/dist/commonjs/Pipeline.d.ts +2 -3
- package/dist/commonjs/Pipeline.d.ts.map +1 -1
- package/dist/commonjs/Pipeline.js +244 -244
- package/dist/commonjs/Pipeline.js.map +7 -1
- package/dist/commonjs/Range.js +35 -22
- package/dist/commonjs/Range.js.map +7 -1
- package/dist/commonjs/StorageClient.js +67 -54
- package/dist/commonjs/StorageClient.js.map +7 -1
- package/dist/commonjs/StorageContextClient.js +34 -19
- package/dist/commonjs/StorageContextClient.js.map +7 -1
- package/dist/commonjs/generated/src/index.js +32 -16
- package/dist/commonjs/generated/src/index.js.map +7 -1
- package/dist/commonjs/generated/src/models/index.d.ts +59 -4
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/index.js +164 -267
- package/dist/commonjs/generated/src/models/index.js.map +7 -1
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +8767 -8334
- package/dist/commonjs/generated/src/models/mappers.js.map +7 -1
- package/dist/commonjs/generated/src/models/parameters.d.ts +7 -0
- package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.js +2074 -1679
- package/dist/commonjs/generated/src/models/parameters.js.map +7 -1
- package/dist/commonjs/generated/src/operations/appendBlob.js +253 -214
- package/dist/commonjs/generated/src/operations/appendBlob.js.map +7 -1
- package/dist/commonjs/generated/src/operations/blob.js +1043 -961
- package/dist/commonjs/generated/src/operations/blob.js.map +7 -1
- package/dist/commonjs/generated/src/operations/blockBlob.js +406 -353
- package/dist/commonjs/generated/src/operations/blockBlob.js.map +7 -1
- package/dist/commonjs/generated/src/operations/container.js +735 -665
- package/dist/commonjs/generated/src/operations/container.js.map +7 -1
- package/dist/commonjs/generated/src/operations/index.js +31 -17
- package/dist/commonjs/generated/src/operations/index.js.map +7 -1
- package/dist/commonjs/generated/src/operations/pageBlob.js +491 -434
- package/dist/commonjs/generated/src/operations/pageBlob.js.map +7 -1
- package/dist/commonjs/generated/src/operations/service.js +352 -303
- package/dist/commonjs/generated/src/operations/service.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/blob.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/blob.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/container.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/container.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js +31 -17
- package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/service.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +7 -1
- package/dist/commonjs/generated/src/storageClient.js +81 -63
- package/dist/commonjs/generated/src/storageClient.js.map +7 -1
- package/dist/commonjs/generatedModels.d.ts +4 -4
- package/dist/commonjs/generatedModels.d.ts.map +1 -1
- package/dist/commonjs/generatedModels.js +30 -11
- package/dist/commonjs/generatedModels.js.map +7 -1
- package/dist/commonjs/index.d.ts +14 -14
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +106 -52
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/internal-avro/AvroConstants.js +36 -10
- package/dist/commonjs/internal-avro/AvroConstants.js.map +7 -1
- package/dist/commonjs/internal-avro/AvroParser.js +307 -297
- package/dist/commonjs/internal-avro/AvroParser.js.map +7 -1
- package/dist/commonjs/internal-avro/AvroReadable.js +26 -7
- package/dist/commonjs/internal-avro/AvroReadable.js.map +7 -1
- package/dist/commonjs/internal-avro/AvroReadableFromBlob.js +69 -50
- package/dist/commonjs/internal-avro/AvroReadableFromBlob.js.map +7 -1
- package/dist/commonjs/internal-avro/AvroReadableFromStream.js +96 -84
- package/dist/commonjs/internal-avro/AvroReadableFromStream.js.map +7 -1
- package/dist/commonjs/internal-avro/AvroReader.js +118 -110
- package/dist/commonjs/internal-avro/AvroReader.js.map +7 -1
- package/dist/commonjs/internal-avro/index.d.ts +1 -1
- package/dist/commonjs/internal-avro/index.d.ts.map +1 -1
- package/dist/commonjs/internal-avro/index.js +33 -12
- package/dist/commonjs/internal-avro/index.js.map +7 -1
- package/dist/commonjs/internal-avro/utils/utils.common.js +33 -17
- package/dist/commonjs/internal-avro/utils/utils.common.js.map +7 -1
- package/dist/commonjs/log.js +28 -11
- package/dist/commonjs/log.js.map +7 -1
- package/dist/commonjs/models.d.ts +43 -0
- package/dist/commonjs/models.d.ts.map +1 -1
- package/dist/commonjs/models.js +74 -115
- package/dist/commonjs/models.js.map +7 -1
- package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js +116 -126
- package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js.map +7 -1
- package/dist/commonjs/sas/AccountSASPermissions.js +233 -226
- package/dist/commonjs/sas/AccountSASPermissions.js.map +7 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.js +80 -70
- package/dist/commonjs/sas/AccountSASResourceTypes.js.map +7 -1
- package/dist/commonjs/sas/AccountSASServices.js +88 -78
- package/dist/commonjs/sas/AccountSASServices.js.map +7 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.js +119 -100
- package/dist/commonjs/sas/AccountSASSignatureValues.js.map +7 -1
- package/dist/commonjs/sas/BlobSASPermissions.js +204 -194
- package/dist/commonjs/sas/BlobSASPermissions.js.map +7 -1
- package/dist/commonjs/sas/BlobSASSignatureValues.d.ts +11 -1
- package/dist/commonjs/sas/BlobSASSignatureValues.d.ts.map +1 -1
- package/dist/commonjs/sas/BlobSASSignatureValues.js +822 -641
- package/dist/commonjs/sas/BlobSASSignatureValues.js.map +7 -1
- package/dist/commonjs/sas/ContainerSASPermissions.js +232 -220
- package/dist/commonjs/sas/ContainerSASPermissions.js.map +7 -1
- package/dist/commonjs/sas/SASQueryParameters.d.ts +23 -2
- package/dist/commonjs/sas/SASQueryParameters.d.ts.map +1 -1
- package/dist/commonjs/sas/SASQueryParameters.js +423 -361
- package/dist/commonjs/sas/SASQueryParameters.js.map +7 -1
- package/dist/commonjs/sas/SasIPRange.js +27 -14
- package/dist/commonjs/sas/SasIPRange.js.map +7 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils/Batch.js +134 -127
- package/dist/commonjs/utils/Batch.js.map +7 -1
- package/dist/commonjs/utils/BlobQuickQueryStream.js +129 -115
- package/dist/commonjs/utils/BlobQuickQueryStream.js.map +7 -1
- package/dist/commonjs/utils/Mutex.js +78 -64
- package/dist/commonjs/utils/Mutex.js.map +7 -1
- package/dist/commonjs/utils/RetriableReadableStream.d.ts.map +1 -1
- package/dist/commonjs/utils/RetriableReadableStream.js +128 -125
- package/dist/commonjs/utils/RetriableReadableStream.js.map +7 -1
- package/dist/commonjs/utils/SharedKeyComparator.js +437 -65
- package/dist/commonjs/utils/SharedKeyComparator.js.map +7 -1
- package/dist/commonjs/utils/constants.d.ts.map +1 -1
- package/dist/commonjs/utils/constants.js +290 -223
- package/dist/commonjs/utils/constants.js.map +7 -1
- package/dist/commonjs/utils/tracing.js +32 -16
- package/dist/commonjs/utils/tracing.js.map +7 -1
- package/dist/commonjs/utils/utils.common.d.ts +16 -1
- package/dist/commonjs/utils/utils.common.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.common.js +566 -740
- package/dist/commonjs/utils/utils.common.js.map +7 -1
- package/dist/commonjs/utils/utils.js +131 -128
- package/dist/commonjs/utils/utils.js.map +7 -1
- package/dist/esm/BlobDownloadResponse.d.ts +2 -1
- package/dist/esm/BlobDownloadResponse.d.ts.map +1 -1
- package/dist/esm/BlobDownloadResponse.js +8 -1
- package/dist/esm/BlobDownloadResponse.js.map +1 -1
- package/dist/esm/BlobServiceClient.d.ts +36 -5
- package/dist/esm/BlobServiceClient.d.ts.map +1 -1
- package/dist/esm/BlobServiceClient.js +29 -17
- package/dist/esm/BlobServiceClient.js.map +1 -1
- package/dist/esm/Clients.d.ts +68 -14
- package/dist/esm/Clients.d.ts.map +1 -1
- package/dist/esm/Clients.js +97 -28
- package/dist/esm/Clients.js.map +1 -1
- package/dist/esm/ContainerClient.d.ts +6 -4
- package/dist/esm/ContainerClient.d.ts.map +1 -1
- package/dist/esm/ContainerClient.js +8 -6
- package/dist/esm/ContainerClient.js.map +1 -1
- package/dist/esm/Pipeline.d.ts +2 -3
- package/dist/esm/Pipeline.d.ts.map +1 -1
- package/dist/esm/Pipeline.js.map +1 -1
- package/dist/esm/generated/src/models/index.d.ts +59 -4
- package/dist/esm/generated/src/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/models/index.js +2 -2
- package/dist/esm/generated/src/models/index.js.map +1 -1
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/models/mappers.js +65 -0
- package/dist/esm/generated/src/models/mappers.js.map +1 -1
- package/dist/esm/generated/src/models/parameters.d.ts +7 -0
- package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/models/parameters.js +71 -1
- package/dist/esm/generated/src/models/parameters.js.map +1 -1
- package/dist/esm/generated/src/operations/appendBlob.js +5 -0
- package/dist/esm/generated/src/operations/appendBlob.js.map +1 -1
- package/dist/esm/generated/src/operations/blob.js +3 -0
- package/dist/esm/generated/src/operations/blob.js.map +1 -1
- package/dist/esm/generated/src/operations/blockBlob.js +10 -0
- package/dist/esm/generated/src/operations/blockBlob.js.map +1 -1
- package/dist/esm/generated/src/operations/pageBlob.js +5 -0
- package/dist/esm/generated/src/operations/pageBlob.js.map +1 -1
- package/dist/esm/generated/src/storageClient.js +2 -2
- package/dist/esm/generated/src/storageClient.js.map +1 -1
- package/dist/esm/generatedModels.d.ts +4 -4
- package/dist/esm/generatedModels.d.ts.map +1 -1
- package/dist/esm/generatedModels.js.map +1 -1
- package/dist/esm/index.d.ts +14 -14
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal-avro/index.d.ts +1 -1
- package/dist/esm/internal-avro/index.d.ts.map +1 -1
- package/dist/esm/internal-avro/index.js.map +1 -1
- package/dist/esm/models.d.ts +43 -0
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/sas/BlobSASSignatureValues.d.ts +11 -1
- package/dist/esm/sas/BlobSASSignatureValues.d.ts.map +1 -1
- package/dist/esm/sas/BlobSASSignatureValues.js +133 -2
- package/dist/esm/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/SASQueryParameters.d.ts +23 -2
- package/dist/esm/sas/SASQueryParameters.d.ts.map +1 -1
- package/dist/esm/sas/SASQueryParameters.js +34 -2
- package/dist/esm/sas/SASQueryParameters.js.map +1 -1
- package/dist/esm/utils/RetriableReadableStream.d.ts.map +1 -1
- package/dist/esm/utils/RetriableReadableStream.js +1 -0
- package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +2 -2
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/utils.common.d.ts +16 -1
- package/dist/esm/utils/utils.common.d.ts.map +1 -1
- package/dist/esm/utils/utils.common.js +26 -0
- package/dist/esm/utils/utils.common.js.map +1 -1
- package/dist/react-native/BlobDownloadResponse.d.ts +5 -2
- package/dist/react-native/BlobDownloadResponse.d.ts.map +1 -0
- package/dist/react-native/BlobDownloadResponse.js +9 -5
- package/dist/react-native/BlobDownloadResponse.js.map +1 -0
- package/dist/react-native/BlobQueryResponse.d.ts +1 -1
- package/dist/react-native/BlobQueryResponse.d.ts.map +1 -0
- package/dist/react-native/BlobQueryResponse.js +1 -1
- package/dist/react-native/BlobQueryResponse.js.map +1 -0
- package/dist/react-native/BlobServiceClient.d.ts +36 -5
- package/dist/react-native/BlobServiceClient.d.ts.map +1 -1
- package/dist/react-native/BlobServiceClient.js +29 -17
- package/dist/react-native/BlobServiceClient.js.map +1 -1
- package/dist/react-native/Clients.d.ts +68 -14
- package/dist/react-native/Clients.d.ts.map +1 -1
- package/dist/react-native/Clients.js +97 -28
- package/dist/react-native/Clients.js.map +1 -1
- package/dist/react-native/ContainerClient.d.ts +6 -4
- package/dist/react-native/ContainerClient.d.ts.map +1 -1
- package/dist/react-native/ContainerClient.js +8 -6
- package/dist/react-native/ContainerClient.js.map +1 -1
- package/dist/react-native/Pipeline.d.ts +2 -3
- package/dist/react-native/Pipeline.d.ts.map +1 -1
- package/dist/react-native/Pipeline.js.map +1 -1
- package/dist/react-native/generated/src/models/index.d.ts +59 -4
- package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/index.js +2 -2
- package/dist/react-native/generated/src/models/index.js.map +1 -1
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/mappers.js +65 -0
- package/dist/react-native/generated/src/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/models/parameters.d.ts +7 -0
- package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/parameters.js +71 -1
- package/dist/react-native/generated/src/models/parameters.js.map +1 -1
- package/dist/react-native/generated/src/operations/appendBlob.js +5 -0
- package/dist/react-native/generated/src/operations/appendBlob.js.map +1 -1
- package/dist/react-native/generated/src/operations/blob.js +3 -0
- package/dist/react-native/generated/src/operations/blob.js.map +1 -1
- package/dist/react-native/generated/src/operations/blockBlob.js +10 -0
- package/dist/react-native/generated/src/operations/blockBlob.js.map +1 -1
- package/dist/react-native/generated/src/operations/pageBlob.js +5 -0
- package/dist/react-native/generated/src/operations/pageBlob.js.map +1 -1
- package/dist/react-native/generated/src/storageClient.js +2 -2
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/generatedModels.d.ts +4 -4
- package/dist/react-native/generatedModels.d.ts.map +1 -1
- package/dist/react-native/generatedModels.js.map +1 -1
- package/dist/react-native/index.d.ts +14 -14
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +0 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/internal-avro/index.d.ts +1 -1
- package/dist/react-native/internal-avro/index.d.ts.map +1 -1
- package/dist/react-native/internal-avro/index.js.map +1 -1
- package/dist/react-native/models.d.ts +43 -0
- package/dist/react-native/models.d.ts.map +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/sas/BlobSASSignatureValues.d.ts +11 -1
- package/dist/react-native/sas/BlobSASSignatureValues.d.ts.map +1 -1
- package/dist/react-native/sas/BlobSASSignatureValues.js +133 -2
- package/dist/react-native/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/SASQueryParameters.d.ts +23 -2
- package/dist/react-native/sas/SASQueryParameters.d.ts.map +1 -1
- package/dist/react-native/sas/SASQueryParameters.js +34 -2
- package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
- package/dist/react-native/utils/RetriableReadableStream.d.ts.map +1 -1
- package/dist/react-native/utils/RetriableReadableStream.js +1 -0
- package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
- package/dist/react-native/utils/constants.d.ts.map +1 -1
- package/dist/react-native/utils/constants.js +2 -2
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/utils.common.d.ts +16 -1
- package/dist/react-native/utils/utils.common.d.ts.map +1 -1
- package/dist/react-native/utils/utils.common.js +26 -0
- package/dist/react-native/utils/utils.common.js.map +1 -1
- package/dist/react-native/utils/utils.d.ts +12 -6
- package/dist/react-native/utils/utils.d.ts.map +1 -0
- package/dist/react-native/utils/utils.js +11 -11
- package/dist/react-native/utils/utils.js.map +1 -0
- package/package.json +3 -20
- package/dist/browser/BatchUtils-browser.d.mts.map +0 -1
- package/dist/browser/BatchUtils-browser.mjs.map +0 -1
- package/dist/browser/BlobDownloadResponse-browser.d.mts.map +0 -1
- package/dist/browser/BlobDownloadResponse-browser.mjs.map +0 -1
- package/dist/browser/BlobQueryResponse-browser.d.mts.map +0 -1
- package/dist/browser/BlobQueryResponse-browser.mjs.map +0 -1
- package/dist/browser/credentials/StorageSharedKeyCredential-react-native.d.mts +0 -3
- package/dist/browser/credentials/StorageSharedKeyCredential-react-native.d.mts.map +0 -1
- package/dist/browser/credentials/StorageSharedKeyCredential-react-native.mjs +0 -5
- package/dist/browser/credentials/StorageSharedKeyCredential-react-native.mjs.map +0 -1
- package/dist/browser/index-browser.d.mts.map +0 -1
- package/dist/browser/index-browser.mjs.map +0 -1
- package/dist/browser/internal-avro/index-browser.d.mts.map +0 -1
- package/dist/browser/internal-avro/index-browser.mjs.map +0 -1
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +0 -17
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +0 -1
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +0 -18
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +0 -1
- package/dist/browser/utils/utils-browser.d.mts.map +0 -1
- package/dist/browser/utils/utils-browser.mjs.map +0 -1
- package/dist/esm/credentials/StorageSharedKeyCredential-react-native.d.mts +0 -3
- package/dist/esm/credentials/StorageSharedKeyCredential-react-native.d.mts.map +0 -1
- package/dist/esm/credentials/StorageSharedKeyCredential-react-native.mjs +0 -5
- package/dist/esm/credentials/StorageSharedKeyCredential-react-native.mjs.map +0 -1
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +0 -17
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +0 -1
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +0 -18
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +0 -1
- package/dist/react-native/BlobDownloadResponse-react-native.d.mts.map +0 -1
- package/dist/react-native/BlobDownloadResponse-react-native.mjs.map +0 -1
- package/dist/react-native/BlobQueryResponse-react-native.d.mts.map +0 -1
- package/dist/react-native/BlobQueryResponse-react-native.mjs.map +0 -1
- package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts +0 -3
- package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts.map +0 -1
- package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs +0 -5
- package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs.map +0 -1
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +0 -17
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +0 -1
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +0 -18
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +0 -1
- package/dist/react-native/utils/utils-react-native.d.mts.map +0 -1
- package/dist/react-native/utils/utils-react-native.mjs.map +0 -1
|
@@ -1,278 +1,300 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var BlobBatch_exports = {};
|
|
19
|
+
__export(BlobBatch_exports, {
|
|
20
|
+
BlobBatch: () => BlobBatch
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(BlobBatch_exports);
|
|
23
|
+
var import_core_util = require("@azure/core-util");
|
|
24
|
+
var import_core_auth = require("@azure/core-auth");
|
|
25
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
26
|
+
var import_core_util2 = require("@azure/core-util");
|
|
27
|
+
var import_storage_common = require("@azure/storage-common");
|
|
28
|
+
var import_Clients = require("./Clients.js");
|
|
29
|
+
var import_Mutex = require("./utils/Mutex.js");
|
|
30
|
+
var import_Pipeline = require("./Pipeline.js");
|
|
31
|
+
var import_utils_common = require("./utils/utils.common.js");
|
|
32
|
+
var import_core_xml = require("@azure/core-xml");
|
|
33
|
+
var import_constants = require("./utils/constants.js");
|
|
34
|
+
var import_tracing = require("./utils/tracing.js");
|
|
35
|
+
var import_core_client = require("@azure/core-client");
|
|
23
36
|
class BlobBatch {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
batchRequest;
|
|
38
|
+
batch = "batch";
|
|
39
|
+
batchType;
|
|
40
|
+
constructor() {
|
|
41
|
+
this.batchRequest = new InnerBatchRequest();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the value of Content-Type for a batch request.
|
|
45
|
+
* The value must be multipart/mixed with a batch boundary.
|
|
46
|
+
* Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252
|
|
47
|
+
*/
|
|
48
|
+
getMultiPartContentType() {
|
|
49
|
+
return this.batchRequest.getMultipartContentType();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get assembled HTTP request body for sub requests.
|
|
53
|
+
*/
|
|
54
|
+
getHttpRequestBody() {
|
|
55
|
+
return this.batchRequest.getHttpRequestBody();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get sub requests that are added into the batch request.
|
|
59
|
+
*/
|
|
60
|
+
getSubRequests() {
|
|
61
|
+
return this.batchRequest.getSubRequests();
|
|
62
|
+
}
|
|
63
|
+
async addSubRequestInternal(subRequest, assembleSubRequestFunc) {
|
|
64
|
+
await import_Mutex.Mutex.lock(this.batch);
|
|
65
|
+
try {
|
|
66
|
+
this.batchRequest.preAddSubRequest(subRequest);
|
|
67
|
+
await assembleSubRequestFunc();
|
|
68
|
+
this.batchRequest.postAddSubRequest(subRequest);
|
|
69
|
+
} finally {
|
|
70
|
+
await import_Mutex.Mutex.unlock(this.batch);
|
|
29
71
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
getMultiPartContentType() {
|
|
36
|
-
return this.batchRequest.getMultipartContentType();
|
|
72
|
+
}
|
|
73
|
+
setBatchType(batchType) {
|
|
74
|
+
if (!this.batchType) {
|
|
75
|
+
this.batchType = batchType;
|
|
37
76
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return this.batchRequest.getHttpRequestBody();
|
|
77
|
+
if (this.batchType !== batchType) {
|
|
78
|
+
throw new RangeError(
|
|
79
|
+
`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`
|
|
80
|
+
);
|
|
43
81
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
82
|
+
}
|
|
83
|
+
async deleteBlob(urlOrBlobClient, credentialOrOptions, options) {
|
|
84
|
+
let url;
|
|
85
|
+
let credential;
|
|
86
|
+
if (typeof urlOrBlobClient === "string" && (import_core_util2.isNodeLike && credentialOrOptions instanceof import_storage_common.StorageSharedKeyCredential || credentialOrOptions instanceof import_storage_common.AnonymousCredential || (0, import_core_auth.isTokenCredential)(credentialOrOptions))) {
|
|
87
|
+
url = urlOrBlobClient;
|
|
88
|
+
credential = credentialOrOptions;
|
|
89
|
+
} else if (urlOrBlobClient instanceof import_Clients.BlobClient) {
|
|
90
|
+
url = urlOrBlobClient.url;
|
|
91
|
+
credential = urlOrBlobClient.credential;
|
|
92
|
+
options = credentialOrOptions;
|
|
93
|
+
} else {
|
|
94
|
+
throw new RangeError(
|
|
95
|
+
"Invalid arguments. Either url and credential, or BlobClient need be provided."
|
|
96
|
+
);
|
|
49
97
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
this.batchRequest.preAddSubRequest(subRequest);
|
|
54
|
-
await assembleSubRequestFunc();
|
|
55
|
-
this.batchRequest.postAddSubRequest(subRequest);
|
|
56
|
-
}
|
|
57
|
-
finally {
|
|
58
|
-
await Mutex_js_1.Mutex.unlock(this.batch);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
setBatchType(batchType) {
|
|
62
|
-
if (!this.batchType) {
|
|
63
|
-
this.batchType = batchType;
|
|
64
|
-
}
|
|
65
|
-
if (this.batchType !== batchType) {
|
|
66
|
-
throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`);
|
|
67
|
-
}
|
|
98
|
+
if (!options) {
|
|
99
|
+
options = {};
|
|
68
100
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
return import_tracing.tracingClient.withSpan(
|
|
102
|
+
"BatchDeleteRequest-addSubRequest",
|
|
103
|
+
options,
|
|
104
|
+
async (updatedOptions) => {
|
|
105
|
+
this.setBatchType("delete");
|
|
106
|
+
await this.addSubRequestInternal(
|
|
107
|
+
{
|
|
108
|
+
url,
|
|
109
|
+
credential
|
|
110
|
+
},
|
|
111
|
+
async () => {
|
|
112
|
+
await new import_Clients.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(
|
|
113
|
+
updatedOptions
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) {
|
|
121
|
+
let url;
|
|
122
|
+
let credential;
|
|
123
|
+
let tier;
|
|
124
|
+
if (typeof urlOrBlobClient === "string" && (import_core_util2.isNodeLike && credentialOrTier instanceof import_storage_common.StorageSharedKeyCredential || credentialOrTier instanceof import_storage_common.AnonymousCredential || (0, import_core_auth.isTokenCredential)(credentialOrTier))) {
|
|
125
|
+
url = urlOrBlobClient;
|
|
126
|
+
credential = credentialOrTier;
|
|
127
|
+
tier = tierOrOptions;
|
|
128
|
+
} else if (urlOrBlobClient instanceof import_Clients.BlobClient) {
|
|
129
|
+
url = urlOrBlobClient.url;
|
|
130
|
+
credential = urlOrBlobClient.credential;
|
|
131
|
+
tier = credentialOrTier;
|
|
132
|
+
options = tierOrOptions;
|
|
133
|
+
} else {
|
|
134
|
+
throw new RangeError(
|
|
135
|
+
"Invalid arguments. Either url and credential, or BlobClient need be provided."
|
|
136
|
+
);
|
|
101
137
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
let credential;
|
|
105
|
-
let tier;
|
|
106
|
-
if (typeof urlOrBlobClient === "string" &&
|
|
107
|
-
((core_util_2.isNodeLike && credentialOrTier instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
108
|
-
credentialOrTier instanceof storage_common_1.AnonymousCredential ||
|
|
109
|
-
(0, core_auth_1.isTokenCredential)(credentialOrTier))) {
|
|
110
|
-
// First overload
|
|
111
|
-
url = urlOrBlobClient;
|
|
112
|
-
credential = credentialOrTier;
|
|
113
|
-
tier = tierOrOptions;
|
|
114
|
-
}
|
|
115
|
-
else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) {
|
|
116
|
-
// Second overload
|
|
117
|
-
url = urlOrBlobClient.url;
|
|
118
|
-
credential = urlOrBlobClient.credential;
|
|
119
|
-
tier = credentialOrTier;
|
|
120
|
-
options = tierOrOptions;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.");
|
|
124
|
-
}
|
|
125
|
-
if (!options) {
|
|
126
|
-
options = {};
|
|
127
|
-
}
|
|
128
|
-
return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => {
|
|
129
|
-
this.setBatchType("setAccessTier");
|
|
130
|
-
await this.addSubRequestInternal({
|
|
131
|
-
url: url,
|
|
132
|
-
credential: credential,
|
|
133
|
-
}, async () => {
|
|
134
|
-
await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions);
|
|
135
|
-
});
|
|
136
|
-
});
|
|
138
|
+
if (!options) {
|
|
139
|
+
options = {};
|
|
137
140
|
}
|
|
141
|
+
return import_tracing.tracingClient.withSpan(
|
|
142
|
+
"BatchSetTierRequest-addSubRequest",
|
|
143
|
+
options,
|
|
144
|
+
async (updatedOptions) => {
|
|
145
|
+
this.setBatchType("setAccessTier");
|
|
146
|
+
await this.addSubRequestInternal(
|
|
147
|
+
{
|
|
148
|
+
url,
|
|
149
|
+
credential
|
|
150
|
+
},
|
|
151
|
+
async () => {
|
|
152
|
+
await new import_Clients.BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(
|
|
153
|
+
tier,
|
|
154
|
+
updatedOptions
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
138
161
|
}
|
|
139
|
-
exports.BlobBatch = BlobBatch;
|
|
140
|
-
/**
|
|
141
|
-
* Inner batch request class which is responsible for assembling and serializing sub requests.
|
|
142
|
-
* See https://learn.microsoft.com/rest/api/storageservices/blob-batch#request-body for how requests are assembled.
|
|
143
|
-
*/
|
|
144
162
|
class InnerBatchRequest {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
stringifyXML: core_xml_1.stringifyXML,
|
|
179
|
-
serializerOptions: {
|
|
180
|
-
xml: {
|
|
181
|
-
xmlCharKey: "#",
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
}), { phase: "Serialize" });
|
|
185
|
-
// Use batch header filter policy to exclude unnecessary headers
|
|
186
|
-
corePipeline.addPolicy(batchHeaderFilterPolicy());
|
|
187
|
-
// Use batch assemble policy to assemble request and intercept request from going to wire
|
|
188
|
-
corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" });
|
|
189
|
-
if ((0, core_auth_1.isTokenCredential)(credential)) {
|
|
190
|
-
corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({
|
|
191
|
-
credential,
|
|
192
|
-
scopes: constants_js_1.StorageOAuthScopes,
|
|
193
|
-
challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge },
|
|
194
|
-
}), { phase: "Sign" });
|
|
195
|
-
}
|
|
196
|
-
else if (credential instanceof storage_common_1.StorageSharedKeyCredential) {
|
|
197
|
-
corePipeline.addPolicy((0, storage_common_1.storageSharedKeyCredentialPolicy)({
|
|
198
|
-
accountName: credential.accountName,
|
|
199
|
-
accountKey: credential.accountKey,
|
|
200
|
-
}), { phase: "Sign" });
|
|
201
|
-
}
|
|
202
|
-
const pipeline = new Pipeline_js_1.Pipeline([]);
|
|
203
|
-
// attach the v2 pipeline to this one
|
|
204
|
-
pipeline._credential = credential;
|
|
205
|
-
pipeline._corePipeline = corePipeline;
|
|
206
|
-
return pipeline;
|
|
207
|
-
}
|
|
208
|
-
appendSubRequestToBody(request) {
|
|
209
|
-
// Start to assemble sub request
|
|
210
|
-
this.body += [
|
|
211
|
-
this.subRequestPrefix, // sub request constant prefix
|
|
212
|
-
`${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID
|
|
213
|
-
"", // empty line after sub request's content ID
|
|
214
|
-
`${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}`, // sub request start line with method
|
|
215
|
-
].join(constants_js_1.HTTP_LINE_ENDING);
|
|
216
|
-
for (const [name, value] of request.headers) {
|
|
217
|
-
this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`;
|
|
218
|
-
}
|
|
219
|
-
this.body += constants_js_1.HTTP_LINE_ENDING; // sub request's headers need be ending with an empty line
|
|
220
|
-
// No body to assemble for current batch request support
|
|
221
|
-
// End to assemble sub request
|
|
222
|
-
}
|
|
223
|
-
preAddSubRequest(subRequest) {
|
|
224
|
-
if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) {
|
|
225
|
-
throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`);
|
|
226
|
-
}
|
|
227
|
-
// Fast fail if url for sub request is invalid
|
|
228
|
-
const path = (0, utils_common_js_1.getURLPath)(subRequest.url);
|
|
229
|
-
if (!path || path === "") {
|
|
230
|
-
throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`);
|
|
163
|
+
operationCount;
|
|
164
|
+
body;
|
|
165
|
+
subRequests;
|
|
166
|
+
boundary;
|
|
167
|
+
subRequestPrefix;
|
|
168
|
+
multipartContentType;
|
|
169
|
+
batchRequestEnding;
|
|
170
|
+
constructor() {
|
|
171
|
+
this.operationCount = 0;
|
|
172
|
+
this.body = "";
|
|
173
|
+
const tempGuid = (0, import_core_util.randomUUID)();
|
|
174
|
+
this.boundary = `batch_${tempGuid}`;
|
|
175
|
+
this.subRequestPrefix = `--${this.boundary}${import_constants.HTTP_LINE_ENDING}${import_constants.HeaderConstants.CONTENT_TYPE}: application/http${import_constants.HTTP_LINE_ENDING}${import_constants.HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`;
|
|
176
|
+
this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`;
|
|
177
|
+
this.batchRequestEnding = `--${this.boundary}--`;
|
|
178
|
+
this.subRequests = /* @__PURE__ */ new Map();
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Create pipeline to assemble sub requests. The idea here is to use existing
|
|
182
|
+
* credential and serialization/deserialization components, with additional policies to
|
|
183
|
+
* filter unnecessary headers, assemble sub requests into request's body
|
|
184
|
+
* and intercept request from going to wire.
|
|
185
|
+
* @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
|
|
186
|
+
*/
|
|
187
|
+
createPipeline(credential) {
|
|
188
|
+
const corePipeline = (0, import_core_rest_pipeline.createEmptyPipeline)();
|
|
189
|
+
corePipeline.addPolicy(
|
|
190
|
+
(0, import_core_client.serializationPolicy)({
|
|
191
|
+
stringifyXML: import_core_xml.stringifyXML,
|
|
192
|
+
serializerOptions: {
|
|
193
|
+
xml: {
|
|
194
|
+
xmlCharKey: "#"
|
|
195
|
+
}
|
|
231
196
|
}
|
|
197
|
+
}),
|
|
198
|
+
{ phase: "Serialize" }
|
|
199
|
+
);
|
|
200
|
+
corePipeline.addPolicy(batchHeaderFilterPolicy());
|
|
201
|
+
corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" });
|
|
202
|
+
if ((0, import_core_auth.isTokenCredential)(credential)) {
|
|
203
|
+
corePipeline.addPolicy(
|
|
204
|
+
(0, import_core_rest_pipeline.bearerTokenAuthenticationPolicy)({
|
|
205
|
+
credential,
|
|
206
|
+
scopes: import_constants.StorageOAuthScopes,
|
|
207
|
+
challengeCallbacks: { authorizeRequestOnChallenge: import_core_client.authorizeRequestOnTenantChallenge }
|
|
208
|
+
}),
|
|
209
|
+
{ phase: "Sign" }
|
|
210
|
+
);
|
|
211
|
+
} else if (credential instanceof import_storage_common.StorageSharedKeyCredential) {
|
|
212
|
+
corePipeline.addPolicy(
|
|
213
|
+
(0, import_storage_common.storageSharedKeyCredentialPolicy)({
|
|
214
|
+
accountName: credential.accountName,
|
|
215
|
+
accountKey: credential.accountKey
|
|
216
|
+
}),
|
|
217
|
+
{ phase: "Sign" }
|
|
218
|
+
);
|
|
232
219
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
220
|
+
const pipeline = new import_Pipeline.Pipeline([]);
|
|
221
|
+
pipeline._credential = credential;
|
|
222
|
+
pipeline._corePipeline = corePipeline;
|
|
223
|
+
return pipeline;
|
|
224
|
+
}
|
|
225
|
+
appendSubRequestToBody(request) {
|
|
226
|
+
this.body += [
|
|
227
|
+
this.subRequestPrefix,
|
|
228
|
+
// sub request constant prefix
|
|
229
|
+
`${import_constants.HeaderConstants.CONTENT_ID}: ${this.operationCount}`,
|
|
230
|
+
// sub request's content ID
|
|
231
|
+
"",
|
|
232
|
+
// empty line after sub request's content ID
|
|
233
|
+
`${request.method.toString()} ${(0, import_utils_common.getURLPathAndQuery)(
|
|
234
|
+
request.url
|
|
235
|
+
)} ${import_constants.HTTP_VERSION_1_1}${import_constants.HTTP_LINE_ENDING}`
|
|
236
|
+
// sub request start line with method
|
|
237
|
+
].join(import_constants.HTTP_LINE_ENDING);
|
|
238
|
+
for (const [name, value] of request.headers) {
|
|
239
|
+
this.body += `${name}: ${value}${import_constants.HTTP_LINE_ENDING}`;
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
this.body += import_constants.HTTP_LINE_ENDING;
|
|
242
|
+
}
|
|
243
|
+
preAddSubRequest(subRequest) {
|
|
244
|
+
if (this.operationCount >= import_constants.BATCH_MAX_REQUEST) {
|
|
245
|
+
throw new RangeError(`Cannot exceed ${import_constants.BATCH_MAX_REQUEST} sub requests in a single batch`);
|
|
243
246
|
}
|
|
244
|
-
|
|
245
|
-
|
|
247
|
+
const path = (0, import_utils_common.getURLPath)(subRequest.url);
|
|
248
|
+
if (!path || path === "") {
|
|
249
|
+
throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`);
|
|
246
250
|
}
|
|
251
|
+
}
|
|
252
|
+
postAddSubRequest(subRequest) {
|
|
253
|
+
this.subRequests.set(this.operationCount, subRequest);
|
|
254
|
+
this.operationCount++;
|
|
255
|
+
}
|
|
256
|
+
// Return the http request body with assembling the ending line to the sub request body.
|
|
257
|
+
getHttpRequestBody() {
|
|
258
|
+
return `${this.body}${this.batchRequestEnding}${import_constants.HTTP_LINE_ENDING}`;
|
|
259
|
+
}
|
|
260
|
+
getMultipartContentType() {
|
|
261
|
+
return this.multipartContentType;
|
|
262
|
+
}
|
|
263
|
+
getSubRequests() {
|
|
264
|
+
return this.subRequests;
|
|
265
|
+
}
|
|
247
266
|
}
|
|
248
267
|
function batchRequestAssemblePolicy(batchRequest) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
268
|
+
return {
|
|
269
|
+
name: "batchRequestAssemblePolicy",
|
|
270
|
+
async sendRequest(request) {
|
|
271
|
+
batchRequest.appendSubRequestToBody(request);
|
|
272
|
+
return {
|
|
273
|
+
request,
|
|
274
|
+
status: 200,
|
|
275
|
+
headers: (0, import_core_rest_pipeline.createHttpHeaders)()
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
};
|
|
260
279
|
}
|
|
261
280
|
function batchHeaderFilterPolicy() {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
281
|
+
return {
|
|
282
|
+
name: "batchHeaderFilterPolicy",
|
|
283
|
+
async sendRequest(request, next) {
|
|
284
|
+
let xMsHeaderName = "";
|
|
285
|
+
for (const [name] of request.headers) {
|
|
286
|
+
if ((0, import_utils_common.iEqual)(name, import_constants.HeaderConstants.X_MS_VERSION)) {
|
|
287
|
+
xMsHeaderName = name;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (xMsHeaderName !== "") {
|
|
291
|
+
request.headers.delete(xMsHeaderName);
|
|
292
|
+
}
|
|
293
|
+
return next(request);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
277
296
|
}
|
|
278
|
-
|
|
297
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
298
|
+
0 && (module.exports = {
|
|
299
|
+
BlobBatch
|
|
300
|
+
});
|