@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,706 +1,806 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
else if ((core_util_1.isNodeLike && credentialOrPipeline instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
75
|
-
credentialOrPipeline instanceof storage_common_1.AnonymousCredential ||
|
|
76
|
-
(0, core_auth_1.isTokenCredential)(credentialOrPipeline)) {
|
|
77
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
// The second parameter is undefined. Use anonymous credential
|
|
81
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
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 BlobServiceClient_exports = {};
|
|
19
|
+
__export(BlobServiceClient_exports, {
|
|
20
|
+
BlobServiceClient: () => BlobServiceClient
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(BlobServiceClient_exports);
|
|
23
|
+
var import_core_auth = require("@azure/core-auth");
|
|
24
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
25
|
+
var import_core_util = require("@azure/core-util");
|
|
26
|
+
var import_Pipeline = require("./Pipeline.js");
|
|
27
|
+
var import_ContainerClient = require("./ContainerClient.js");
|
|
28
|
+
var import_utils_common = require("./utils/utils.common.js");
|
|
29
|
+
var import_storage_common = require("@azure/storage-common");
|
|
30
|
+
var import_utils_common2 = require("./utils/utils.common.js");
|
|
31
|
+
var import_tracing = require("./utils/tracing.js");
|
|
32
|
+
var import_BlobBatchClient = require("./BlobBatchClient.js");
|
|
33
|
+
var import_StorageClient = require("./StorageClient.js");
|
|
34
|
+
var import_AccountSASPermissions = require("./sas/AccountSASPermissions.js");
|
|
35
|
+
var import_AccountSASSignatureValues = require("./sas/AccountSASSignatureValues.js");
|
|
36
|
+
var import_AccountSASServices = require("./sas/AccountSASServices.js");
|
|
37
|
+
function isBlobGetUserDelegationKeyParameters(parameter) {
|
|
38
|
+
if (!parameter || typeof parameter !== "object") {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const castParameter = parameter;
|
|
42
|
+
return castParameter.expiresOn instanceof Date;
|
|
43
|
+
}
|
|
44
|
+
class BlobServiceClient extends import_StorageClient.StorageClient {
|
|
45
|
+
/**
|
|
46
|
+
* serviceContext provided by protocol layer.
|
|
47
|
+
*/
|
|
48
|
+
serviceContext;
|
|
49
|
+
blobClientConfig;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* Creates an instance of BlobServiceClient from connection string.
|
|
53
|
+
*
|
|
54
|
+
* @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
|
|
55
|
+
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
|
|
56
|
+
* Account connection string example -
|
|
57
|
+
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
|
|
58
|
+
* SAS connection string example -
|
|
59
|
+
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
|
|
60
|
+
* @param options - Optional. Options to configure the HTTP pipeline.
|
|
61
|
+
*/
|
|
62
|
+
static fromConnectionString(connectionString, options) {
|
|
63
|
+
options = options || {};
|
|
64
|
+
const extractedCreds = (0, import_utils_common.extractConnectionStringParts)(connectionString);
|
|
65
|
+
if (extractedCreds.kind === "AccountConnString") {
|
|
66
|
+
if (import_core_util.isNodeLike) {
|
|
67
|
+
const sharedKeyCredential = new import_storage_common.StorageSharedKeyCredential(
|
|
68
|
+
extractedCreds.accountName,
|
|
69
|
+
extractedCreds.accountKey
|
|
70
|
+
);
|
|
71
|
+
if (!options.proxyOptions) {
|
|
72
|
+
options.proxyOptions = (0, import_core_rest_pipeline.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
82
73
|
}
|
|
83
|
-
|
|
84
|
-
|
|
74
|
+
const pipeline = (0, import_Pipeline.newPipeline)(sharedKeyCredential, options);
|
|
75
|
+
return new BlobServiceClient(extractedCreds.url, pipeline);
|
|
76
|
+
} else {
|
|
77
|
+
throw new Error("Account connection string is only supported in Node.js environment");
|
|
78
|
+
}
|
|
79
|
+
} else if (extractedCreds.kind === "SASConnString") {
|
|
80
|
+
const pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common.AnonymousCredential(), options);
|
|
81
|
+
return new BlobServiceClient(
|
|
82
|
+
extractedCreds.url + "?" + extractedCreds.accountSas,
|
|
83
|
+
pipeline,
|
|
84
|
+
options
|
|
85
|
+
);
|
|
86
|
+
} else {
|
|
87
|
+
throw new Error(
|
|
88
|
+
"Connection string must be either an Account connection string or a SAS connection string"
|
|
89
|
+
);
|
|
85
90
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
97
|
-
*
|
|
98
|
-
* const account = "<account>";
|
|
99
|
-
* const blobServiceClient = new BlobServiceClient(
|
|
100
|
-
* `https://${account}.blob.core.windows.net`,
|
|
101
|
-
* new DefaultAzureCredential(),
|
|
102
|
-
* );
|
|
103
|
-
*
|
|
104
|
-
* const containerClient = blobServiceClient.getContainerClient("<container name>");
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
getContainerClient(containerName) {
|
|
108
|
-
return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline);
|
|
91
|
+
}
|
|
92
|
+
constructor(url, credentialOrPipeline, options) {
|
|
93
|
+
options = options ?? {};
|
|
94
|
+
let pipeline;
|
|
95
|
+
if ((0, import_Pipeline.isPipelineLike)(credentialOrPipeline)) {
|
|
96
|
+
pipeline = credentialOrPipeline;
|
|
97
|
+
} else if (import_core_util.isNodeLike && credentialOrPipeline instanceof import_storage_common.StorageSharedKeyCredential || credentialOrPipeline instanceof import_storage_common.AnonymousCredential || (0, import_core_auth.isTokenCredential)(credentialOrPipeline)) {
|
|
98
|
+
pipeline = (0, import_Pipeline.newPipeline)(credentialOrPipeline, options);
|
|
99
|
+
} else {
|
|
100
|
+
pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common.AnonymousCredential(), options);
|
|
109
101
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
102
|
+
super(url, pipeline);
|
|
103
|
+
this.serviceContext = this.storageClientContext.service;
|
|
104
|
+
this.blobClientConfig = options;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates a {@link ContainerClient} object
|
|
108
|
+
*
|
|
109
|
+
* @param containerName - A container name
|
|
110
|
+
* @returns A new ContainerClient object for the given container name.
|
|
111
|
+
*
|
|
112
|
+
* Example usage:
|
|
113
|
+
*
|
|
114
|
+
* ```ts snippet:BlobServiceClientGetContainerClient
|
|
115
|
+
* import { BlobServiceClient } from "@azure/storage-blob";
|
|
116
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
117
|
+
*
|
|
118
|
+
* const account = "<account>";
|
|
119
|
+
* const blobServiceClient = new BlobServiceClient(
|
|
120
|
+
* `https://${account}.blob.core.windows.net`,
|
|
121
|
+
* new DefaultAzureCredential(),
|
|
122
|
+
* );
|
|
123
|
+
*
|
|
124
|
+
* const containerClient = blobServiceClient.getContainerClient("<container name>");
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
getContainerClient(containerName) {
|
|
128
|
+
return new import_ContainerClient.ContainerClient(
|
|
129
|
+
(0, import_utils_common.appendToURLPath)(this.url, encodeURIComponent(containerName)),
|
|
130
|
+
this.pipeline,
|
|
131
|
+
this.blobClientConfig
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container
|
|
136
|
+
*
|
|
137
|
+
* @param containerName - Name of the container to create.
|
|
138
|
+
* @param options - Options to configure Container Create operation.
|
|
139
|
+
* @returns Container creation response and the corresponding container client.
|
|
140
|
+
*/
|
|
141
|
+
async createContainer(containerName, options = {}) {
|
|
142
|
+
return import_tracing.tracingClient.withSpan(
|
|
143
|
+
"BlobServiceClient-createContainer",
|
|
144
|
+
options,
|
|
145
|
+
async (updatedOptions) => {
|
|
146
|
+
const containerClient = this.getContainerClient(containerName);
|
|
147
|
+
const containerCreateResponse = await containerClient.create(updatedOptions);
|
|
148
|
+
return {
|
|
149
|
+
containerClient,
|
|
150
|
+
containerCreateResponse
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Deletes a Blob container.
|
|
157
|
+
*
|
|
158
|
+
* @param containerName - Name of the container to delete.
|
|
159
|
+
* @param options - Options to configure Container Delete operation.
|
|
160
|
+
* @returns Container deletion response.
|
|
161
|
+
*/
|
|
162
|
+
async deleteContainer(containerName, options = {}) {
|
|
163
|
+
return import_tracing.tracingClient.withSpan(
|
|
164
|
+
"BlobServiceClient-deleteContainer",
|
|
165
|
+
options,
|
|
166
|
+
async (updatedOptions) => {
|
|
167
|
+
const containerClient = this.getContainerClient(containerName);
|
|
168
|
+
return containerClient.delete(updatedOptions);
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Restore a previously deleted Blob container.
|
|
174
|
+
* This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.
|
|
175
|
+
*
|
|
176
|
+
* @param deletedContainerName - Name of the previously deleted container.
|
|
177
|
+
* @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container.
|
|
178
|
+
* @param options - Options to configure Container Restore operation.
|
|
179
|
+
* @returns Container deletion response.
|
|
180
|
+
*/
|
|
181
|
+
async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) {
|
|
182
|
+
return import_tracing.tracingClient.withSpan(
|
|
183
|
+
"BlobServiceClient-undeleteContainer",
|
|
184
|
+
options,
|
|
185
|
+
async (updatedOptions) => {
|
|
186
|
+
const containerClient = this.getContainerClient(
|
|
187
|
+
options.destinationContainerName || deletedContainerName
|
|
188
|
+
);
|
|
189
|
+
const containerContext = containerClient["storageClientContext"].container;
|
|
190
|
+
const containerUndeleteResponse = (0, import_utils_common2.assertResponse)(
|
|
191
|
+
await containerContext.restore({
|
|
192
|
+
deletedContainerName,
|
|
193
|
+
deletedContainerVersion,
|
|
194
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
return { containerClient, containerUndeleteResponse };
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Gets the properties of a storage account’s Blob service, including properties
|
|
203
|
+
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
|
|
204
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
|
205
|
+
*
|
|
206
|
+
* @param options - Options to the Service Get Properties operation.
|
|
207
|
+
* @returns Response data for the Service Get Properties operation.
|
|
208
|
+
*/
|
|
209
|
+
async getProperties(options = {}) {
|
|
210
|
+
return import_tracing.tracingClient.withSpan(
|
|
211
|
+
"BlobServiceClient-getProperties",
|
|
212
|
+
options,
|
|
213
|
+
async (updatedOptions) => {
|
|
214
|
+
return (0, import_utils_common2.assertResponse)(
|
|
215
|
+
await this.serviceContext.getProperties({
|
|
216
|
+
abortSignal: options.abortSignal,
|
|
217
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
218
|
+
})
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Sets properties for a storage account’s Blob service endpoint, including properties
|
|
225
|
+
* for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
|
|
226
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties
|
|
227
|
+
*
|
|
228
|
+
* @param properties -
|
|
229
|
+
* @param options - Options to the Service Set Properties operation.
|
|
230
|
+
* @returns Response data for the Service Set Properties operation.
|
|
231
|
+
*/
|
|
232
|
+
async setProperties(properties, options = {}) {
|
|
233
|
+
return import_tracing.tracingClient.withSpan(
|
|
234
|
+
"BlobServiceClient-setProperties",
|
|
235
|
+
options,
|
|
236
|
+
async (updatedOptions) => {
|
|
237
|
+
return (0, import_utils_common2.assertResponse)(
|
|
238
|
+
await this.serviceContext.setProperties(properties, {
|
|
239
|
+
abortSignal: options.abortSignal,
|
|
240
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
241
|
+
})
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Retrieves statistics related to replication for the Blob service. It is only
|
|
248
|
+
* available on the secondary location endpoint when read-access geo-redundant
|
|
249
|
+
* replication is enabled for the storage account.
|
|
250
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
|
|
251
|
+
*
|
|
252
|
+
* @param options - Options to the Service Get Statistics operation.
|
|
253
|
+
* @returns Response data for the Service Get Statistics operation.
|
|
254
|
+
*/
|
|
255
|
+
async getStatistics(options = {}) {
|
|
256
|
+
return import_tracing.tracingClient.withSpan(
|
|
257
|
+
"BlobServiceClient-getStatistics",
|
|
258
|
+
options,
|
|
259
|
+
async (updatedOptions) => {
|
|
260
|
+
return (0, import_utils_common2.assertResponse)(
|
|
261
|
+
await this.serviceContext.getStatistics({
|
|
262
|
+
abortSignal: options.abortSignal,
|
|
263
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
264
|
+
})
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The Get Account Information operation returns the sku name and account kind
|
|
271
|
+
* for the specified account.
|
|
272
|
+
* The Get Account Information operation is available on service versions beginning
|
|
273
|
+
* with version 2018-03-28.
|
|
274
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
|
|
275
|
+
*
|
|
276
|
+
* @param options - Options to the Service Get Account Info operation.
|
|
277
|
+
* @returns Response data for the Service Get Account Info operation.
|
|
278
|
+
*/
|
|
279
|
+
async getAccountInfo(options = {}) {
|
|
280
|
+
return import_tracing.tracingClient.withSpan(
|
|
281
|
+
"BlobServiceClient-getAccountInfo",
|
|
282
|
+
options,
|
|
283
|
+
async (updatedOptions) => {
|
|
284
|
+
return (0, import_utils_common2.assertResponse)(
|
|
285
|
+
await this.serviceContext.getAccountInfo({
|
|
286
|
+
abortSignal: options.abortSignal,
|
|
287
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
288
|
+
})
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Returns a list of the containers under the specified account.
|
|
295
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
|
|
296
|
+
*
|
|
297
|
+
* @param marker - A string value that identifies the portion of
|
|
298
|
+
* the list of containers to be returned with the next listing operation. The
|
|
299
|
+
* operation returns the continuationToken value within the response body if the
|
|
300
|
+
* listing operation did not return all containers remaining to be listed
|
|
301
|
+
* with the current page. The continuationToken value can be used as the value for
|
|
302
|
+
* the marker parameter in a subsequent call to request the next page of list
|
|
303
|
+
* items. The marker value is opaque to the client.
|
|
304
|
+
* @param options - Options to the Service List Container Segment operation.
|
|
305
|
+
* @returns Response data for the Service List Container Segment operation.
|
|
306
|
+
*/
|
|
307
|
+
async listContainersSegment(marker, options = {}) {
|
|
308
|
+
return import_tracing.tracingClient.withSpan(
|
|
309
|
+
"BlobServiceClient-listContainersSegment",
|
|
310
|
+
options,
|
|
311
|
+
async (updatedOptions) => {
|
|
312
|
+
return (0, import_utils_common2.assertResponse)(
|
|
313
|
+
await this.serviceContext.listContainersSegment({
|
|
314
|
+
abortSignal: options.abortSignal,
|
|
315
|
+
marker,
|
|
316
|
+
...options,
|
|
317
|
+
include: typeof options.include === "string" ? [options.include] : options.include,
|
|
318
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
319
|
+
})
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* The Filter Blobs operation enables callers to list blobs across all containers whose tags
|
|
326
|
+
* match a given search expression. Filter blobs searches across all containers within a
|
|
327
|
+
* storage account but can be scoped within the expression to a single container.
|
|
328
|
+
*
|
|
329
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
|
330
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
|
331
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
|
332
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
|
333
|
+
* @param marker - A string value that identifies the portion of
|
|
334
|
+
* the list of blobs to be returned with the next listing operation. The
|
|
335
|
+
* operation returns the continuationToken value within the response body if the
|
|
336
|
+
* listing operation did not return all blobs remaining to be listed
|
|
337
|
+
* with the current page. The continuationToken value can be used as the value for
|
|
338
|
+
* the marker parameter in a subsequent call to request the next page of list
|
|
339
|
+
* items. The marker value is opaque to the client.
|
|
340
|
+
* @param options - Options to find blobs by tags.
|
|
341
|
+
*/
|
|
342
|
+
async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
|
|
343
|
+
return import_tracing.tracingClient.withSpan(
|
|
344
|
+
"BlobServiceClient-findBlobsByTagsSegment",
|
|
345
|
+
options,
|
|
346
|
+
async (updatedOptions) => {
|
|
347
|
+
const response = (0, import_utils_common2.assertResponse)(
|
|
348
|
+
await this.serviceContext.filterBlobs({
|
|
349
|
+
abortSignal: options.abortSignal,
|
|
350
|
+
where: tagFilterSqlExpression,
|
|
351
|
+
marker,
|
|
352
|
+
maxPageSize: options.maxPageSize,
|
|
353
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
354
|
+
})
|
|
355
|
+
);
|
|
356
|
+
const wrappedResponse = {
|
|
357
|
+
...response,
|
|
358
|
+
_response: response._response,
|
|
359
|
+
// _response is made non-enumerable
|
|
360
|
+
blobs: response.blobs.map((blob) => {
|
|
361
|
+
let tagValue = "";
|
|
362
|
+
if (blob.tags?.blobTagSet.length === 1) {
|
|
363
|
+
tagValue = blob.tags.blobTagSet[0].value;
|
|
364
|
+
}
|
|
365
|
+
return { ...blob, tags: (0, import_utils_common.toTags)(blob.tags), tagValue };
|
|
366
|
+
})
|
|
367
|
+
};
|
|
368
|
+
return wrappedResponse;
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse.
|
|
374
|
+
*
|
|
375
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
|
376
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
|
377
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
|
378
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
|
379
|
+
* @param marker - A string value that identifies the portion of
|
|
380
|
+
* the list of blobs to be returned with the next listing operation. The
|
|
381
|
+
* operation returns the continuationToken value within the response body if the
|
|
382
|
+
* listing operation did not return all blobs remaining to be listed
|
|
383
|
+
* with the current page. The continuationToken value can be used as the value for
|
|
384
|
+
* the marker parameter in a subsequent call to request the next page of list
|
|
385
|
+
* items. The marker value is opaque to the client.
|
|
386
|
+
* @param options - Options to find blobs by tags.
|
|
387
|
+
*/
|
|
388
|
+
async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
|
|
389
|
+
let response;
|
|
390
|
+
if (!!marker || marker === void 0) {
|
|
391
|
+
do {
|
|
392
|
+
response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
|
|
393
|
+
response.blobs = response.blobs || [];
|
|
394
|
+
marker = response.continuationToken;
|
|
395
|
+
yield response;
|
|
396
|
+
} while (marker);
|
|
126
397
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Returns an AsyncIterableIterator for blobs.
|
|
401
|
+
*
|
|
402
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
|
403
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
|
404
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
|
405
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
|
406
|
+
* @param options - Options to findBlobsByTagsItems.
|
|
407
|
+
*/
|
|
408
|
+
async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
|
|
409
|
+
let marker;
|
|
410
|
+
for await (const segment of this.findBlobsByTagsSegments(
|
|
411
|
+
tagFilterSqlExpression,
|
|
412
|
+
marker,
|
|
413
|
+
options
|
|
414
|
+
)) {
|
|
415
|
+
yield* segment.blobs;
|
|
139
416
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Returns an async iterable iterator to find all blobs with specified tag
|
|
420
|
+
* under the specified account.
|
|
421
|
+
*
|
|
422
|
+
* .byPage() returns an async iterable iterator to list the blobs in pages.
|
|
423
|
+
*
|
|
424
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
|
425
|
+
*
|
|
426
|
+
* ```ts snippet:BlobServiceClientFindBlobsByTags
|
|
427
|
+
* import { BlobServiceClient } from "@azure/storage-blob";
|
|
428
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
429
|
+
*
|
|
430
|
+
* const account = "<account>";
|
|
431
|
+
* const blobServiceClient = new BlobServiceClient(
|
|
432
|
+
* `https://${account}.blob.core.windows.net`,
|
|
433
|
+
* new DefaultAzureCredential(),
|
|
434
|
+
* );
|
|
435
|
+
*
|
|
436
|
+
* // Use for await to iterate the blobs
|
|
437
|
+
* let i = 1;
|
|
438
|
+
* for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) {
|
|
439
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
440
|
+
* }
|
|
441
|
+
*
|
|
442
|
+
* // Use iter.next() to iterate the blobs
|
|
443
|
+
* i = 1;
|
|
444
|
+
* const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'");
|
|
445
|
+
* let { value, done } = await iter.next();
|
|
446
|
+
* while (!done) {
|
|
447
|
+
* console.log(`Blob ${i++}: ${value.name}`);
|
|
448
|
+
* ({ value, done } = await iter.next());
|
|
449
|
+
* }
|
|
450
|
+
*
|
|
451
|
+
* // Use byPage() to iterate the blobs
|
|
452
|
+
* i = 1;
|
|
453
|
+
* for await (const page of blobServiceClient
|
|
454
|
+
* .findBlobsByTags("tagkey='tagvalue'")
|
|
455
|
+
* .byPage({ maxPageSize: 20 })) {
|
|
456
|
+
* for (const blob of page.blobs) {
|
|
457
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
458
|
+
* }
|
|
459
|
+
* }
|
|
460
|
+
*
|
|
461
|
+
* // Use paging with a marker
|
|
462
|
+
* i = 1;
|
|
463
|
+
* let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
|
|
464
|
+
* let response = (await iterator.next()).value;
|
|
465
|
+
* // Prints 2 blob names
|
|
466
|
+
* if (response.blobs) {
|
|
467
|
+
* for (const blob of response.blobs) {
|
|
468
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
469
|
+
* }
|
|
470
|
+
* }
|
|
471
|
+
* // Gets next marker
|
|
472
|
+
* let marker = response.continuationToken;
|
|
473
|
+
* // Passing next marker as continuationToken
|
|
474
|
+
* iterator = blobServiceClient
|
|
475
|
+
* .findBlobsByTags("tagkey='tagvalue'")
|
|
476
|
+
* .byPage({ continuationToken: marker, maxPageSize: 10 });
|
|
477
|
+
* response = (await iterator.next()).value;
|
|
478
|
+
*
|
|
479
|
+
* // Prints blob names
|
|
480
|
+
* if (response.blobs) {
|
|
481
|
+
* for (const blob of response.blobs) {
|
|
482
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
483
|
+
* }
|
|
484
|
+
* }
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
487
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
|
488
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
|
489
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
|
490
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
|
491
|
+
* @param options - Options to find blobs by tags.
|
|
492
|
+
*/
|
|
493
|
+
findBlobsByTags(tagFilterSqlExpression, options = {}) {
|
|
494
|
+
const listSegmentOptions = {
|
|
495
|
+
...options
|
|
496
|
+
};
|
|
497
|
+
const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
|
|
498
|
+
return {
|
|
499
|
+
/**
|
|
500
|
+
* The next method, part of the iteration protocol
|
|
501
|
+
*/
|
|
502
|
+
next() {
|
|
503
|
+
return iter.next();
|
|
504
|
+
},
|
|
505
|
+
/**
|
|
506
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
507
|
+
*/
|
|
508
|
+
[Symbol.asyncIterator]() {
|
|
509
|
+
return this;
|
|
510
|
+
},
|
|
511
|
+
/**
|
|
512
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
513
|
+
*/
|
|
514
|
+
byPage: (settings = {}) => {
|
|
515
|
+
return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
|
|
516
|
+
maxPageSize: settings.maxPageSize,
|
|
517
|
+
...listSegmentOptions
|
|
160
518
|
});
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses
|
|
524
|
+
*
|
|
525
|
+
* @param marker - A string value that identifies the portion of
|
|
526
|
+
* the list of containers to be returned with the next listing operation. The
|
|
527
|
+
* operation returns the continuationToken value within the response body if the
|
|
528
|
+
* listing operation did not return all containers remaining to be listed
|
|
529
|
+
* with the current page. The continuationToken value can be used as the value for
|
|
530
|
+
* the marker parameter in a subsequent call to request the next page of list
|
|
531
|
+
* items. The marker value is opaque to the client.
|
|
532
|
+
* @param options - Options to list containers operation.
|
|
533
|
+
*/
|
|
534
|
+
async *listSegments(marker, options = {}) {
|
|
535
|
+
let listContainersSegmentResponse;
|
|
536
|
+
if (!!marker || marker === void 0) {
|
|
537
|
+
do {
|
|
538
|
+
listContainersSegmentResponse = await this.listContainersSegment(marker, options);
|
|
539
|
+
listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || [];
|
|
540
|
+
marker = listContainersSegmentResponse.continuationToken;
|
|
541
|
+
yield await listContainersSegmentResponse;
|
|
542
|
+
} while (marker);
|
|
161
543
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getProperties({
|
|
173
|
-
abortSignal: options.abortSignal,
|
|
174
|
-
tracingOptions: updatedOptions.tracingOptions,
|
|
175
|
-
}));
|
|
176
|
-
});
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Returns an AsyncIterableIterator for Container Items
|
|
547
|
+
*
|
|
548
|
+
* @param options - Options to list containers operation.
|
|
549
|
+
*/
|
|
550
|
+
async *listItems(options = {}) {
|
|
551
|
+
let marker;
|
|
552
|
+
for await (const segment of this.listSegments(marker, options)) {
|
|
553
|
+
yield* segment.containerItems;
|
|
177
554
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Returns an async iterable iterator to list all the containers
|
|
558
|
+
* under the specified account.
|
|
559
|
+
*
|
|
560
|
+
* .byPage() returns an async iterable iterator to list the containers in pages.
|
|
561
|
+
*
|
|
562
|
+
* ```ts snippet:BlobServiceClientListContainers
|
|
563
|
+
* import { BlobServiceClient } from "@azure/storage-blob";
|
|
564
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
565
|
+
*
|
|
566
|
+
* const account = "<account>";
|
|
567
|
+
* const blobServiceClient = new BlobServiceClient(
|
|
568
|
+
* `https://${account}.blob.core.windows.net`,
|
|
569
|
+
* new DefaultAzureCredential(),
|
|
570
|
+
* );
|
|
571
|
+
*
|
|
572
|
+
* // Use for await to iterate the containers
|
|
573
|
+
* let i = 1;
|
|
574
|
+
* for await (const container of blobServiceClient.listContainers()) {
|
|
575
|
+
* console.log(`Container ${i++}: ${container.name}`);
|
|
576
|
+
* }
|
|
577
|
+
*
|
|
578
|
+
* // Use iter.next() to iterate the containers
|
|
579
|
+
* i = 1;
|
|
580
|
+
* const iter = blobServiceClient.listContainers();
|
|
581
|
+
* let { value, done } = await iter.next();
|
|
582
|
+
* while (!done) {
|
|
583
|
+
* console.log(`Container ${i++}: ${value.name}`);
|
|
584
|
+
* ({ value, done } = await iter.next());
|
|
585
|
+
* }
|
|
586
|
+
*
|
|
587
|
+
* // Use byPage() to iterate the containers
|
|
588
|
+
* i = 1;
|
|
589
|
+
* for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) {
|
|
590
|
+
* for (const container of page.containerItems) {
|
|
591
|
+
* console.log(`Container ${i++}: ${container.name}`);
|
|
592
|
+
* }
|
|
593
|
+
* }
|
|
594
|
+
*
|
|
595
|
+
* // Use paging with a marker
|
|
596
|
+
* i = 1;
|
|
597
|
+
* let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 });
|
|
598
|
+
* let response = (await iterator.next()).value;
|
|
599
|
+
*
|
|
600
|
+
* // Prints 2 container names
|
|
601
|
+
* if (response.containerItems) {
|
|
602
|
+
* for (const container of response.containerItems) {
|
|
603
|
+
* console.log(`Container ${i++}: ${container.name}`);
|
|
604
|
+
* }
|
|
605
|
+
* }
|
|
606
|
+
*
|
|
607
|
+
* // Gets next marker
|
|
608
|
+
* let marker = response.continuationToken;
|
|
609
|
+
* // Passing next marker as continuationToken
|
|
610
|
+
* iterator = blobServiceClient
|
|
611
|
+
* .listContainers()
|
|
612
|
+
* .byPage({ continuationToken: marker, maxPageSize: 10 });
|
|
613
|
+
* response = (await iterator.next()).value;
|
|
614
|
+
*
|
|
615
|
+
* // Prints 10 container names
|
|
616
|
+
* if (response.containerItems) {
|
|
617
|
+
* for (const container of response.containerItems) {
|
|
618
|
+
* console.log(`Container ${i++}: ${container.name}`);
|
|
619
|
+
* }
|
|
620
|
+
* }
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* @param options - Options to list containers.
|
|
624
|
+
* @returns An asyncIterableIterator that supports paging.
|
|
625
|
+
*/
|
|
626
|
+
listContainers(options = {}) {
|
|
627
|
+
if (options.prefix === "") {
|
|
628
|
+
options.prefix = void 0;
|
|
194
629
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
* replication is enabled for the storage account.
|
|
199
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
|
|
200
|
-
*
|
|
201
|
-
* @param options - Options to the Service Get Statistics operation.
|
|
202
|
-
* @returns Response data for the Service Get Statistics operation.
|
|
203
|
-
*/
|
|
204
|
-
async getStatistics(options = {}) {
|
|
205
|
-
return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => {
|
|
206
|
-
return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getStatistics({
|
|
207
|
-
abortSignal: options.abortSignal,
|
|
208
|
-
tracingOptions: updatedOptions.tracingOptions,
|
|
209
|
-
}));
|
|
210
|
-
});
|
|
630
|
+
const include = [];
|
|
631
|
+
if (options.includeDeleted) {
|
|
632
|
+
include.push("deleted");
|
|
211
633
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* for the specified account.
|
|
215
|
-
* The Get Account Information operation is available on service versions beginning
|
|
216
|
-
* with version 2018-03-28.
|
|
217
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
|
|
218
|
-
*
|
|
219
|
-
* @param options - Options to the Service Get Account Info operation.
|
|
220
|
-
* @returns Response data for the Service Get Account Info operation.
|
|
221
|
-
*/
|
|
222
|
-
async getAccountInfo(options = {}) {
|
|
223
|
-
return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => {
|
|
224
|
-
return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getAccountInfo({
|
|
225
|
-
abortSignal: options.abortSignal,
|
|
226
|
-
tracingOptions: updatedOptions.tracingOptions,
|
|
227
|
-
}));
|
|
228
|
-
});
|
|
634
|
+
if (options.includeMetadata) {
|
|
635
|
+
include.push("metadata");
|
|
229
636
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
|
|
233
|
-
*
|
|
234
|
-
* @param marker - A string value that identifies the portion of
|
|
235
|
-
* the list of containers to be returned with the next listing operation. The
|
|
236
|
-
* operation returns the continuationToken value within the response body if the
|
|
237
|
-
* listing operation did not return all containers remaining to be listed
|
|
238
|
-
* with the current page. The continuationToken value can be used as the value for
|
|
239
|
-
* the marker parameter in a subsequent call to request the next page of list
|
|
240
|
-
* items. The marker value is opaque to the client.
|
|
241
|
-
* @param options - Options to the Service List Container Segment operation.
|
|
242
|
-
* @returns Response data for the Service List Container Segment operation.
|
|
243
|
-
*/
|
|
244
|
-
async listContainersSegment(marker, options = {}) {
|
|
245
|
-
return tracing_js_1.tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => {
|
|
246
|
-
return (0, utils_common_js_2.assertResponse)(await this.serviceContext.listContainersSegment({
|
|
247
|
-
abortSignal: options.abortSignal,
|
|
248
|
-
marker,
|
|
249
|
-
...options,
|
|
250
|
-
include: typeof options.include === "string" ? [options.include] : options.include,
|
|
251
|
-
tracingOptions: updatedOptions.tracingOptions,
|
|
252
|
-
}));
|
|
253
|
-
});
|
|
637
|
+
if (options.includeSystem) {
|
|
638
|
+
include.push("system");
|
|
254
639
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
tracingOptions: updatedOptions.tracingOptions,
|
|
281
|
-
}));
|
|
282
|
-
const wrappedResponse = {
|
|
283
|
-
...response,
|
|
284
|
-
_response: response._response, // _response is made non-enumerable
|
|
285
|
-
blobs: response.blobs.map((blob) => {
|
|
286
|
-
let tagValue = "";
|
|
287
|
-
if (blob.tags?.blobTagSet.length === 1) {
|
|
288
|
-
tagValue = blob.tags.blobTagSet[0].value;
|
|
289
|
-
}
|
|
290
|
-
return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue };
|
|
291
|
-
}),
|
|
292
|
-
};
|
|
293
|
-
return wrappedResponse;
|
|
640
|
+
const listSegmentOptions = {
|
|
641
|
+
...options,
|
|
642
|
+
...include.length > 0 ? { include } : {}
|
|
643
|
+
};
|
|
644
|
+
const iter = this.listItems(listSegmentOptions);
|
|
645
|
+
return {
|
|
646
|
+
/**
|
|
647
|
+
* The next method, part of the iteration protocol
|
|
648
|
+
*/
|
|
649
|
+
next() {
|
|
650
|
+
return iter.next();
|
|
651
|
+
},
|
|
652
|
+
/**
|
|
653
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
654
|
+
*/
|
|
655
|
+
[Symbol.asyncIterator]() {
|
|
656
|
+
return this;
|
|
657
|
+
},
|
|
658
|
+
/**
|
|
659
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
660
|
+
*/
|
|
661
|
+
byPage: (settings = {}) => {
|
|
662
|
+
return this.listSegments(settings.continuationToken, {
|
|
663
|
+
maxPageSize: settings.maxPageSize,
|
|
664
|
+
...listSegmentOptions
|
|
294
665
|
});
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
async getUserDelegationKey(startsOnOrParam, expiresOnOrOption, options = {}) {
|
|
670
|
+
let startsOn = startsOnOrParam;
|
|
671
|
+
let expiresOn = expiresOnOrOption;
|
|
672
|
+
let userDelegationTid = void 0;
|
|
673
|
+
let getUserDelegationKeyOptions = options;
|
|
674
|
+
if (isBlobGetUserDelegationKeyParameters(startsOnOrParam)) {
|
|
675
|
+
startsOn = startsOnOrParam.startsOn;
|
|
676
|
+
expiresOn = startsOnOrParam.expiresOn;
|
|
677
|
+
userDelegationTid = startsOnOrParam.delegatedUserTenantId;
|
|
678
|
+
getUserDelegationKeyOptions = expiresOnOrOption;
|
|
679
|
+
getUserDelegationKeyOptions = getUserDelegationKeyOptions ?? {};
|
|
295
680
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
* listing operation did not return all blobs remaining to be listed
|
|
307
|
-
* with the current page. The continuationToken value can be used as the value for
|
|
308
|
-
* the marker parameter in a subsequent call to request the next page of list
|
|
309
|
-
* items. The marker value is opaque to the client.
|
|
310
|
-
* @param options - Options to find blobs by tags.
|
|
311
|
-
*/
|
|
312
|
-
async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
|
|
313
|
-
let response;
|
|
314
|
-
if (!!marker || marker === undefined) {
|
|
315
|
-
do {
|
|
316
|
-
response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
|
|
317
|
-
response.blobs = response.blobs || [];
|
|
318
|
-
marker = response.continuationToken;
|
|
319
|
-
yield response;
|
|
320
|
-
} while (marker);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Returns an AsyncIterableIterator for blobs.
|
|
325
|
-
*
|
|
326
|
-
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
|
327
|
-
* The given expression must evaluate to true for a blob to be returned in the results.
|
|
328
|
-
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
|
329
|
-
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
|
330
|
-
* @param options - Options to findBlobsByTagsItems.
|
|
331
|
-
*/
|
|
332
|
-
async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
|
|
333
|
-
let marker;
|
|
334
|
-
for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
|
|
335
|
-
yield* segment.blobs;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Returns an async iterable iterator to find all blobs with specified tag
|
|
340
|
-
* under the specified account.
|
|
341
|
-
*
|
|
342
|
-
* .byPage() returns an async iterable iterator to list the blobs in pages.
|
|
343
|
-
*
|
|
344
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
|
345
|
-
*
|
|
346
|
-
* ```ts snippet:BlobServiceClientFindBlobsByTags
|
|
347
|
-
* import { BlobServiceClient } from "@azure/storage-blob";
|
|
348
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
349
|
-
*
|
|
350
|
-
* const account = "<account>";
|
|
351
|
-
* const blobServiceClient = new BlobServiceClient(
|
|
352
|
-
* `https://${account}.blob.core.windows.net`,
|
|
353
|
-
* new DefaultAzureCredential(),
|
|
354
|
-
* );
|
|
355
|
-
*
|
|
356
|
-
* // Use for await to iterate the blobs
|
|
357
|
-
* let i = 1;
|
|
358
|
-
* for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) {
|
|
359
|
-
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
360
|
-
* }
|
|
361
|
-
*
|
|
362
|
-
* // Use iter.next() to iterate the blobs
|
|
363
|
-
* i = 1;
|
|
364
|
-
* const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'");
|
|
365
|
-
* let { value, done } = await iter.next();
|
|
366
|
-
* while (!done) {
|
|
367
|
-
* console.log(`Blob ${i++}: ${value.name}`);
|
|
368
|
-
* ({ value, done } = await iter.next());
|
|
369
|
-
* }
|
|
370
|
-
*
|
|
371
|
-
* // Use byPage() to iterate the blobs
|
|
372
|
-
* i = 1;
|
|
373
|
-
* for await (const page of blobServiceClient
|
|
374
|
-
* .findBlobsByTags("tagkey='tagvalue'")
|
|
375
|
-
* .byPage({ maxPageSize: 20 })) {
|
|
376
|
-
* for (const blob of page.blobs) {
|
|
377
|
-
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
378
|
-
* }
|
|
379
|
-
* }
|
|
380
|
-
*
|
|
381
|
-
* // Use paging with a marker
|
|
382
|
-
* i = 1;
|
|
383
|
-
* let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
|
|
384
|
-
* let response = (await iterator.next()).value;
|
|
385
|
-
* // Prints 2 blob names
|
|
386
|
-
* if (response.blobs) {
|
|
387
|
-
* for (const blob of response.blobs) {
|
|
388
|
-
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
389
|
-
* }
|
|
390
|
-
* }
|
|
391
|
-
* // Gets next marker
|
|
392
|
-
* let marker = response.continuationToken;
|
|
393
|
-
* // Passing next marker as continuationToken
|
|
394
|
-
* iterator = blobServiceClient
|
|
395
|
-
* .findBlobsByTags("tagkey='tagvalue'")
|
|
396
|
-
* .byPage({ continuationToken: marker, maxPageSize: 10 });
|
|
397
|
-
* response = (await iterator.next()).value;
|
|
398
|
-
*
|
|
399
|
-
* // Prints blob names
|
|
400
|
-
* if (response.blobs) {
|
|
401
|
-
* for (const blob of response.blobs) {
|
|
402
|
-
* console.log(`Blob ${i++}: ${blob.name}`);
|
|
403
|
-
* }
|
|
404
|
-
* }
|
|
405
|
-
* ```
|
|
406
|
-
*
|
|
407
|
-
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
|
408
|
-
* The given expression must evaluate to true for a blob to be returned in the results.
|
|
409
|
-
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
|
410
|
-
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
|
411
|
-
* @param options - Options to find blobs by tags.
|
|
412
|
-
*/
|
|
413
|
-
findBlobsByTags(tagFilterSqlExpression, options = {}) {
|
|
414
|
-
// AsyncIterableIterator to iterate over blobs
|
|
415
|
-
const listSegmentOptions = {
|
|
416
|
-
...options,
|
|
417
|
-
};
|
|
418
|
-
const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
|
|
419
|
-
return {
|
|
420
|
-
/**
|
|
421
|
-
* The next method, part of the iteration protocol
|
|
422
|
-
*/
|
|
423
|
-
next() {
|
|
424
|
-
return iter.next();
|
|
425
|
-
},
|
|
426
|
-
/**
|
|
427
|
-
* The connection to the async iterator, part of the iteration protocol
|
|
428
|
-
*/
|
|
429
|
-
[Symbol.asyncIterator]() {
|
|
430
|
-
return this;
|
|
681
|
+
return import_tracing.tracingClient.withSpan(
|
|
682
|
+
"BlobServiceClient-getUserDelegationKey",
|
|
683
|
+
getUserDelegationKeyOptions,
|
|
684
|
+
async (updatedOptions) => {
|
|
685
|
+
const response = (0, import_utils_common2.assertResponse)(
|
|
686
|
+
await this.serviceContext.getUserDelegationKey(
|
|
687
|
+
{
|
|
688
|
+
startsOn: (0, import_utils_common2.truncatedISO8061Date)(startsOn, false),
|
|
689
|
+
expiresOn: (0, import_utils_common2.truncatedISO8061Date)(expiresOn, false),
|
|
690
|
+
delegatedUserTid: userDelegationTid
|
|
431
691
|
},
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
* the list of containers to be returned with the next listing operation. The
|
|
448
|
-
* operation returns the continuationToken value within the response body if the
|
|
449
|
-
* listing operation did not return all containers remaining to be listed
|
|
450
|
-
* with the current page. The continuationToken value can be used as the value for
|
|
451
|
-
* the marker parameter in a subsequent call to request the next page of list
|
|
452
|
-
* items. The marker value is opaque to the client.
|
|
453
|
-
* @param options - Options to list containers operation.
|
|
454
|
-
*/
|
|
455
|
-
async *listSegments(marker, options = {}) {
|
|
456
|
-
let listContainersSegmentResponse;
|
|
457
|
-
if (!!marker || marker === undefined) {
|
|
458
|
-
do {
|
|
459
|
-
listContainersSegmentResponse = await this.listContainersSegment(marker, options);
|
|
460
|
-
listContainersSegmentResponse.containerItems =
|
|
461
|
-
listContainersSegmentResponse.containerItems || [];
|
|
462
|
-
marker = listContainersSegmentResponse.continuationToken;
|
|
463
|
-
yield await listContainersSegmentResponse;
|
|
464
|
-
} while (marker);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Returns an AsyncIterableIterator for Container Items
|
|
469
|
-
*
|
|
470
|
-
* @param options - Options to list containers operation.
|
|
471
|
-
*/
|
|
472
|
-
async *listItems(options = {}) {
|
|
473
|
-
let marker;
|
|
474
|
-
for await (const segment of this.listSegments(marker, options)) {
|
|
475
|
-
yield* segment.containerItems;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Returns an async iterable iterator to list all the containers
|
|
480
|
-
* under the specified account.
|
|
481
|
-
*
|
|
482
|
-
* .byPage() returns an async iterable iterator to list the containers in pages.
|
|
483
|
-
*
|
|
484
|
-
* ```ts snippet:BlobServiceClientListContainers
|
|
485
|
-
* import { BlobServiceClient } from "@azure/storage-blob";
|
|
486
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
487
|
-
*
|
|
488
|
-
* const account = "<account>";
|
|
489
|
-
* const blobServiceClient = new BlobServiceClient(
|
|
490
|
-
* `https://${account}.blob.core.windows.net`,
|
|
491
|
-
* new DefaultAzureCredential(),
|
|
492
|
-
* );
|
|
493
|
-
*
|
|
494
|
-
* // Use for await to iterate the containers
|
|
495
|
-
* let i = 1;
|
|
496
|
-
* for await (const container of blobServiceClient.listContainers()) {
|
|
497
|
-
* console.log(`Container ${i++}: ${container.name}`);
|
|
498
|
-
* }
|
|
499
|
-
*
|
|
500
|
-
* // Use iter.next() to iterate the containers
|
|
501
|
-
* i = 1;
|
|
502
|
-
* const iter = blobServiceClient.listContainers();
|
|
503
|
-
* let { value, done } = await iter.next();
|
|
504
|
-
* while (!done) {
|
|
505
|
-
* console.log(`Container ${i++}: ${value.name}`);
|
|
506
|
-
* ({ value, done } = await iter.next());
|
|
507
|
-
* }
|
|
508
|
-
*
|
|
509
|
-
* // Use byPage() to iterate the containers
|
|
510
|
-
* i = 1;
|
|
511
|
-
* for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) {
|
|
512
|
-
* for (const container of page.containerItems) {
|
|
513
|
-
* console.log(`Container ${i++}: ${container.name}`);
|
|
514
|
-
* }
|
|
515
|
-
* }
|
|
516
|
-
*
|
|
517
|
-
* // Use paging with a marker
|
|
518
|
-
* i = 1;
|
|
519
|
-
* let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 });
|
|
520
|
-
* let response = (await iterator.next()).value;
|
|
521
|
-
*
|
|
522
|
-
* // Prints 2 container names
|
|
523
|
-
* if (response.containerItems) {
|
|
524
|
-
* for (const container of response.containerItems) {
|
|
525
|
-
* console.log(`Container ${i++}: ${container.name}`);
|
|
526
|
-
* }
|
|
527
|
-
* }
|
|
528
|
-
*
|
|
529
|
-
* // Gets next marker
|
|
530
|
-
* let marker = response.continuationToken;
|
|
531
|
-
* // Passing next marker as continuationToken
|
|
532
|
-
* iterator = blobServiceClient
|
|
533
|
-
* .listContainers()
|
|
534
|
-
* .byPage({ continuationToken: marker, maxPageSize: 10 });
|
|
535
|
-
* response = (await iterator.next()).value;
|
|
536
|
-
*
|
|
537
|
-
* // Prints 10 container names
|
|
538
|
-
* if (response.containerItems) {
|
|
539
|
-
* for (const container of response.containerItems) {
|
|
540
|
-
* console.log(`Container ${i++}: ${container.name}`);
|
|
541
|
-
* }
|
|
542
|
-
* }
|
|
543
|
-
* ```
|
|
544
|
-
*
|
|
545
|
-
* @param options - Options to list containers.
|
|
546
|
-
* @returns An asyncIterableIterator that supports paging.
|
|
547
|
-
*/
|
|
548
|
-
listContainers(options = {}) {
|
|
549
|
-
if (options.prefix === "") {
|
|
550
|
-
options.prefix = undefined;
|
|
551
|
-
}
|
|
552
|
-
const include = [];
|
|
553
|
-
if (options.includeDeleted) {
|
|
554
|
-
include.push("deleted");
|
|
555
|
-
}
|
|
556
|
-
if (options.includeMetadata) {
|
|
557
|
-
include.push("metadata");
|
|
558
|
-
}
|
|
559
|
-
if (options.includeSystem) {
|
|
560
|
-
include.push("system");
|
|
561
|
-
}
|
|
562
|
-
// AsyncIterableIterator to iterate over containers
|
|
563
|
-
const listSegmentOptions = {
|
|
564
|
-
...options,
|
|
565
|
-
...(include.length > 0 ? { include } : {}),
|
|
692
|
+
{
|
|
693
|
+
abortSignal: getUserDelegationKeyOptions.abortSignal,
|
|
694
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
695
|
+
}
|
|
696
|
+
)
|
|
697
|
+
);
|
|
698
|
+
const userDelegationKey = {
|
|
699
|
+
signedObjectId: response.signedObjectId,
|
|
700
|
+
signedTenantId: response.signedTenantId,
|
|
701
|
+
signedStartsOn: new Date(response.signedStartsOn),
|
|
702
|
+
signedExpiresOn: new Date(response.signedExpiresOn),
|
|
703
|
+
signedService: response.signedService,
|
|
704
|
+
signedVersion: response.signedVersion,
|
|
705
|
+
signedDelegatedUserTenantId: response.signedDelegatedUserTenantId,
|
|
706
|
+
value: response.value
|
|
566
707
|
};
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* The connection to the async iterator, part of the iteration protocol
|
|
577
|
-
*/
|
|
578
|
-
[Symbol.asyncIterator]() {
|
|
579
|
-
return this;
|
|
580
|
-
},
|
|
581
|
-
/**
|
|
582
|
-
* Return an AsyncIterableIterator that works a page at a time
|
|
583
|
-
*/
|
|
584
|
-
byPage: (settings = {}) => {
|
|
585
|
-
return this.listSegments(settings.continuationToken, {
|
|
586
|
-
maxPageSize: settings.maxPageSize,
|
|
587
|
-
...listSegmentOptions,
|
|
588
|
-
});
|
|
589
|
-
},
|
|
708
|
+
const res = {
|
|
709
|
+
_response: response._response,
|
|
710
|
+
requestId: response.requestId,
|
|
711
|
+
clientRequestId: response.clientRequestId,
|
|
712
|
+
version: response.version,
|
|
713
|
+
date: response.date,
|
|
714
|
+
errorCode: response.errorCode,
|
|
715
|
+
...userDelegationKey
|
|
590
716
|
};
|
|
717
|
+
return res;
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Creates a BlobBatchClient object to conduct batch operations.
|
|
723
|
+
*
|
|
724
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
|
725
|
+
*
|
|
726
|
+
* @returns A new BlobBatchClient object for this service.
|
|
727
|
+
*/
|
|
728
|
+
getBlobBatchClient() {
|
|
729
|
+
return new import_BlobBatchClient.BlobBatchClient(this.url, this.pipeline);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Only available for BlobServiceClient constructed with a shared key credential.
|
|
733
|
+
*
|
|
734
|
+
* Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
|
|
735
|
+
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
736
|
+
*
|
|
737
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
738
|
+
*
|
|
739
|
+
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
|
740
|
+
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
741
|
+
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
742
|
+
* @param options - Optional parameters.
|
|
743
|
+
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
744
|
+
*/
|
|
745
|
+
generateAccountSasUrl(expiresOn, permissions = import_AccountSASPermissions.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
746
|
+
if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
|
|
747
|
+
throw RangeError(
|
|
748
|
+
"Can only generate the account SAS when the client is initialized with a shared key credential"
|
|
749
|
+
);
|
|
591
750
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
* Retrieves a user delegation key for the Blob service. This is only a valid operation when using
|
|
596
|
-
* bearer token authentication.
|
|
597
|
-
*
|
|
598
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key
|
|
599
|
-
*
|
|
600
|
-
* @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time
|
|
601
|
-
* @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time
|
|
602
|
-
*/
|
|
603
|
-
async getUserDelegationKey(startsOn, expiresOn, options = {}) {
|
|
604
|
-
return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => {
|
|
605
|
-
const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.getUserDelegationKey({
|
|
606
|
-
startsOn: (0, utils_common_js_2.truncatedISO8061Date)(startsOn, false),
|
|
607
|
-
expiresOn: (0, utils_common_js_2.truncatedISO8061Date)(expiresOn, false),
|
|
608
|
-
}, {
|
|
609
|
-
abortSignal: options.abortSignal,
|
|
610
|
-
tracingOptions: updatedOptions.tracingOptions,
|
|
611
|
-
}));
|
|
612
|
-
const userDelegationKey = {
|
|
613
|
-
signedObjectId: response.signedObjectId,
|
|
614
|
-
signedTenantId: response.signedTenantId,
|
|
615
|
-
signedStartsOn: new Date(response.signedStartsOn),
|
|
616
|
-
signedExpiresOn: new Date(response.signedExpiresOn),
|
|
617
|
-
signedService: response.signedService,
|
|
618
|
-
signedVersion: response.signedVersion,
|
|
619
|
-
value: response.value,
|
|
620
|
-
};
|
|
621
|
-
const res = {
|
|
622
|
-
_response: response._response,
|
|
623
|
-
requestId: response.requestId,
|
|
624
|
-
clientRequestId: response.clientRequestId,
|
|
625
|
-
version: response.version,
|
|
626
|
-
date: response.date,
|
|
627
|
-
errorCode: response.errorCode,
|
|
628
|
-
...userDelegationKey,
|
|
629
|
-
};
|
|
630
|
-
return res;
|
|
631
|
-
});
|
|
751
|
+
if (expiresOn === void 0) {
|
|
752
|
+
const now = /* @__PURE__ */ new Date();
|
|
753
|
+
expiresOn = new Date(now.getTime() + 3600 * 1e3);
|
|
632
754
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
755
|
+
const sas = (0, import_AccountSASSignatureValues.generateAccountSASQueryParameters)(
|
|
756
|
+
{
|
|
757
|
+
permissions,
|
|
758
|
+
expiresOn,
|
|
759
|
+
resourceTypes,
|
|
760
|
+
services: import_AccountSASServices.AccountSASServices.parse("b").toString(),
|
|
761
|
+
...options
|
|
762
|
+
},
|
|
763
|
+
this.credential
|
|
764
|
+
).toString();
|
|
765
|
+
return (0, import_utils_common.appendToURLQuery)(this.url, sas);
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Only available for BlobServiceClient constructed with a shared key credential.
|
|
769
|
+
*
|
|
770
|
+
* Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
|
|
771
|
+
* the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
772
|
+
*
|
|
773
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
774
|
+
*
|
|
775
|
+
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
|
776
|
+
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
777
|
+
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
778
|
+
* @param options - Optional parameters.
|
|
779
|
+
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
780
|
+
*/
|
|
781
|
+
generateSasStringToSign(expiresOn, permissions = import_AccountSASPermissions.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
782
|
+
if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
|
|
783
|
+
throw RangeError(
|
|
784
|
+
"Can only generate the account SAS when the client is initialized with a shared key credential"
|
|
785
|
+
);
|
|
642
786
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
* Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
|
|
647
|
-
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
648
|
-
*
|
|
649
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
650
|
-
*
|
|
651
|
-
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
|
652
|
-
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
653
|
-
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
654
|
-
* @param options - Optional parameters.
|
|
655
|
-
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
656
|
-
*/
|
|
657
|
-
generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
658
|
-
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
659
|
-
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
660
|
-
}
|
|
661
|
-
if (expiresOn === undefined) {
|
|
662
|
-
const now = new Date();
|
|
663
|
-
expiresOn = new Date(now.getTime() + 3600 * 1000);
|
|
664
|
-
}
|
|
665
|
-
const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({
|
|
666
|
-
permissions,
|
|
667
|
-
expiresOn,
|
|
668
|
-
resourceTypes,
|
|
669
|
-
services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(),
|
|
670
|
-
...options,
|
|
671
|
-
}, this.credential).toString();
|
|
672
|
-
return (0, utils_common_js_1.appendToURLQuery)(this.url, sas);
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* Only available for BlobServiceClient constructed with a shared key credential.
|
|
676
|
-
*
|
|
677
|
-
* Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
|
|
678
|
-
* the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
679
|
-
*
|
|
680
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
681
|
-
*
|
|
682
|
-
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
|
683
|
-
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
684
|
-
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
685
|
-
* @param options - Optional parameters.
|
|
686
|
-
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
687
|
-
*/
|
|
688
|
-
generateSasStringToSign(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
689
|
-
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
690
|
-
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
691
|
-
}
|
|
692
|
-
if (expiresOn === undefined) {
|
|
693
|
-
const now = new Date();
|
|
694
|
-
expiresOn = new Date(now.getTime() + 3600 * 1000);
|
|
695
|
-
}
|
|
696
|
-
return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({
|
|
697
|
-
permissions,
|
|
698
|
-
expiresOn,
|
|
699
|
-
resourceTypes,
|
|
700
|
-
services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(),
|
|
701
|
-
...options,
|
|
702
|
-
}, this.credential).stringToSign;
|
|
787
|
+
if (expiresOn === void 0) {
|
|
788
|
+
const now = /* @__PURE__ */ new Date();
|
|
789
|
+
expiresOn = new Date(now.getTime() + 3600 * 1e3);
|
|
703
790
|
}
|
|
791
|
+
return (0, import_AccountSASSignatureValues.generateAccountSASQueryParametersInternal)(
|
|
792
|
+
{
|
|
793
|
+
permissions,
|
|
794
|
+
expiresOn,
|
|
795
|
+
resourceTypes,
|
|
796
|
+
services: import_AccountSASServices.AccountSASServices.parse("b").toString(),
|
|
797
|
+
...options
|
|
798
|
+
},
|
|
799
|
+
this.credential
|
|
800
|
+
).stringToSign;
|
|
801
|
+
}
|
|
704
802
|
}
|
|
705
|
-
|
|
706
|
-
|
|
803
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
804
|
+
0 && (module.exports = {
|
|
805
|
+
BlobServiceClient
|
|
806
|
+
});
|