@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,807 +1,633 @@
|
|
|
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
|
-
* If customer URL string is "http://account.blob.core.windows.net/con/blob%3Fname", a blob named "blob%3Fname" will be created.
|
|
64
|
-
* V2 SDK doesn't have this issue because it doesn't allow customer pass in a full URL, it accepts a separate blob name and encodeURIComponent for it.
|
|
65
|
-
* We cannot accept a SDK cannot create a blob name with "?". So we implement strategy two:
|
|
66
|
-
*
|
|
67
|
-
* ### Strategy Two: SDK doesn't assume the URL has been encoded or not. It will just escape the special characters.
|
|
68
|
-
*
|
|
69
|
-
* This is what V10 Blob Go SDK does. It accepts a URL type in Go, and call url.EscapedPath() to escape the special chars unescaped.
|
|
70
|
-
* - When customer URL string is "http://account.blob.core.windows.net/con/b:",
|
|
71
|
-
* SDK will escape ":" like "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created.
|
|
72
|
-
* - When customer URL string is "http://account.blob.core.windows.net/con/b%3A",
|
|
73
|
-
* There is no special characters, so send "http://account.blob.core.windows.net/con/b%3A" to server. A blob named "b:" will be created.
|
|
74
|
-
* - When customer URL string is "http://account.blob.core.windows.net/con/b%253A",
|
|
75
|
-
* There is no special characters, so send "http://account.blob.core.windows.net/con/b%253A" to server. A blob named "b%3A" will be created.
|
|
76
|
-
*
|
|
77
|
-
* This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string
|
|
78
|
-
* is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL.
|
|
79
|
-
* If customer needs to create a blob with "%" in it's blob name, use "%25" instead of "%". Just like above 3rd sample.
|
|
80
|
-
* And following URL strings are invalid:
|
|
81
|
-
* - "http://account.blob.core.windows.net/con/b%"
|
|
82
|
-
* - "http://account.blob.core.windows.net/con/b%2"
|
|
83
|
-
* - "http://account.blob.core.windows.net/con/b%G"
|
|
84
|
-
*
|
|
85
|
-
* Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string.
|
|
86
|
-
*
|
|
87
|
-
* ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `containerClient.getBlobClient(blobName)`
|
|
88
|
-
*
|
|
89
|
-
* We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
|
|
90
|
-
*
|
|
91
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
|
|
92
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata
|
|
93
|
-
*
|
|
94
|
-
* @param url -
|
|
95
|
-
*/
|
|
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 utils_common_exports = {};
|
|
19
|
+
__export(utils_common_exports, {
|
|
20
|
+
BlobNameToString: () => BlobNameToString,
|
|
21
|
+
ConvertInternalResponseOfListBlobFlat: () => ConvertInternalResponseOfListBlobFlat,
|
|
22
|
+
ConvertInternalResponseOfListBlobHierarchy: () => ConvertInternalResponseOfListBlobHierarchy,
|
|
23
|
+
EscapePath: () => EscapePath,
|
|
24
|
+
ExtractPageRangeInfoItems: () => ExtractPageRangeInfoItems,
|
|
25
|
+
appendToURLPath: () => appendToURLPath,
|
|
26
|
+
appendToURLQuery: () => appendToURLQuery,
|
|
27
|
+
assertResponse: () => assertResponse,
|
|
28
|
+
attachCredential: () => attachCredential,
|
|
29
|
+
base64decode: () => base64decode,
|
|
30
|
+
base64encode: () => base64encode,
|
|
31
|
+
delay: () => delay,
|
|
32
|
+
escapeURLPath: () => escapeURLPath,
|
|
33
|
+
extractConnectionStringParts: () => extractConnectionStringParts,
|
|
34
|
+
generateBlockID: () => generateBlockID,
|
|
35
|
+
getAccountNameFromUrl: () => getAccountNameFromUrl,
|
|
36
|
+
getURLParameter: () => getURLParameter,
|
|
37
|
+
getURLPath: () => getURLPath,
|
|
38
|
+
getURLPathAndQuery: () => getURLPathAndQuery,
|
|
39
|
+
getURLQueries: () => getURLQueries,
|
|
40
|
+
getURLScheme: () => getURLScheme,
|
|
41
|
+
getValueInConnString: () => getValueInConnString,
|
|
42
|
+
httpAuthorizationToString: () => httpAuthorizationToString,
|
|
43
|
+
iEqual: () => iEqual,
|
|
44
|
+
isIpEndpointStyle: () => isIpEndpointStyle,
|
|
45
|
+
padStart: () => padStart,
|
|
46
|
+
parseObjectReplicationRecord: () => parseObjectReplicationRecord,
|
|
47
|
+
sanitizeHeaders: () => sanitizeHeaders,
|
|
48
|
+
sanitizeURL: () => sanitizeURL,
|
|
49
|
+
setURLHost: () => setURLHost,
|
|
50
|
+
setURLParameter: () => setURLParameter,
|
|
51
|
+
setUploadChecksumParameters: () => setUploadChecksumParameters,
|
|
52
|
+
toBlobTags: () => toBlobTags,
|
|
53
|
+
toBlobTagsString: () => toBlobTagsString,
|
|
54
|
+
toQuerySerialization: () => toQuerySerialization,
|
|
55
|
+
toTags: () => toTags,
|
|
56
|
+
truncatedISO8061Date: () => truncatedISO8061Date
|
|
57
|
+
});
|
|
58
|
+
module.exports = __toCommonJS(utils_common_exports);
|
|
59
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
60
|
+
var import_core_util = require("@azure/core-util");
|
|
61
|
+
var import_constants = require("./constants.js");
|
|
62
|
+
var import_storage_common = require("@azure/storage-common");
|
|
96
63
|
function escapeURLPath(url) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
64
|
+
const urlParsed = new URL(url);
|
|
65
|
+
let path = urlParsed.pathname;
|
|
66
|
+
path = path || "/";
|
|
67
|
+
path = escape(path);
|
|
68
|
+
urlParsed.pathname = path;
|
|
69
|
+
return urlParsed.toString();
|
|
103
70
|
}
|
|
104
71
|
function getProxyUriFromDevConnString(connectionString) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
|
|
113
|
-
proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
72
|
+
let proxyUri = "";
|
|
73
|
+
if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
|
|
74
|
+
const matchCredentials = connectionString.split(";");
|
|
75
|
+
for (const element of matchCredentials) {
|
|
76
|
+
if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
|
|
77
|
+
proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
|
|
78
|
+
}
|
|
116
79
|
}
|
|
117
|
-
|
|
80
|
+
}
|
|
81
|
+
return proxyUri;
|
|
118
82
|
}
|
|
119
83
|
function getValueInConnString(connectionString, argument) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
84
|
+
const elements = connectionString.split(";");
|
|
85
|
+
for (const element of elements) {
|
|
86
|
+
if (element.trim().startsWith(argument)) {
|
|
87
|
+
return element.trim().match(argument + "=(.*)")[1];
|
|
125
88
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* Extracts the parts of an Azure Storage account connection string.
|
|
130
|
-
*
|
|
131
|
-
* @param connectionString - Connection string.
|
|
132
|
-
* @returns String key value pairs of the storage account's url and credentials.
|
|
133
|
-
*/
|
|
89
|
+
}
|
|
90
|
+
return "";
|
|
91
|
+
}
|
|
134
92
|
function extractConnectionStringParts(connectionString) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
93
|
+
let proxyUri = "";
|
|
94
|
+
if (connectionString.startsWith("UseDevelopmentStorage=true")) {
|
|
95
|
+
proxyUri = getProxyUriFromDevConnString(connectionString);
|
|
96
|
+
connectionString = import_constants.DevelopmentConnectionString;
|
|
97
|
+
}
|
|
98
|
+
let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint");
|
|
99
|
+
blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint;
|
|
100
|
+
if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && connectionString.search("AccountKey=") !== -1) {
|
|
101
|
+
let defaultEndpointsProtocol = "";
|
|
102
|
+
let accountName = "";
|
|
103
|
+
let accountKey = Buffer.from("accountKey", "base64");
|
|
104
|
+
let endpointSuffix = "";
|
|
105
|
+
accountName = getValueInConnString(connectionString, "AccountName");
|
|
106
|
+
accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64");
|
|
107
|
+
if (!blobEndpoint) {
|
|
108
|
+
defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol");
|
|
109
|
+
const protocol = defaultEndpointsProtocol.toLowerCase();
|
|
110
|
+
if (protocol !== "https" && protocol !== "http") {
|
|
111
|
+
throw new Error(
|
|
112
|
+
"Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix");
|
|
116
|
+
if (!endpointSuffix) {
|
|
117
|
+
throw new Error("Invalid EndpointSuffix in the provided Connection String");
|
|
118
|
+
}
|
|
119
|
+
blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;
|
|
120
|
+
}
|
|
121
|
+
if (!accountName) {
|
|
122
|
+
throw new Error("Invalid AccountName in the provided Connection String");
|
|
123
|
+
} else if (accountKey.length === 0) {
|
|
124
|
+
throw new Error("Invalid AccountKey in the provided Connection String");
|
|
140
125
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// Get account name and key
|
|
154
|
-
accountName = getValueInConnString(connectionString, "AccountName");
|
|
155
|
-
accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64");
|
|
156
|
-
if (!blobEndpoint) {
|
|
157
|
-
// BlobEndpoint is not present in the Account connection string
|
|
158
|
-
// Can be obtained from `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`
|
|
159
|
-
defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol");
|
|
160
|
-
const protocol = defaultEndpointsProtocol.toLowerCase();
|
|
161
|
-
if (protocol !== "https" && protocol !== "http") {
|
|
162
|
-
throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
|
|
163
|
-
}
|
|
164
|
-
endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix");
|
|
165
|
-
if (!endpointSuffix) {
|
|
166
|
-
throw new Error("Invalid EndpointSuffix in the provided Connection String");
|
|
167
|
-
}
|
|
168
|
-
blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;
|
|
169
|
-
}
|
|
170
|
-
if (!accountName) {
|
|
171
|
-
throw new Error("Invalid AccountName in the provided Connection String");
|
|
172
|
-
}
|
|
173
|
-
else if (accountKey.length === 0) {
|
|
174
|
-
throw new Error("Invalid AccountKey in the provided Connection String");
|
|
175
|
-
}
|
|
176
|
-
return {
|
|
177
|
-
kind: "AccountConnString",
|
|
178
|
-
url: blobEndpoint,
|
|
179
|
-
accountName,
|
|
180
|
-
accountKey,
|
|
181
|
-
proxyUri,
|
|
182
|
-
};
|
|
126
|
+
return {
|
|
127
|
+
kind: "AccountConnString",
|
|
128
|
+
url: blobEndpoint,
|
|
129
|
+
accountName,
|
|
130
|
+
accountKey,
|
|
131
|
+
proxyUri
|
|
132
|
+
};
|
|
133
|
+
} else {
|
|
134
|
+
let accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
|
|
135
|
+
let accountName = getValueInConnString(connectionString, "AccountName");
|
|
136
|
+
if (!accountName) {
|
|
137
|
+
accountName = getAccountNameFromUrl(blobEndpoint);
|
|
183
138
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
if (!blobEndpoint) {
|
|
193
|
-
throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");
|
|
194
|
-
}
|
|
195
|
-
else if (!accountSas) {
|
|
196
|
-
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
|
197
|
-
}
|
|
198
|
-
// client constructors assume accountSas does *not* start with ?
|
|
199
|
-
if (accountSas.startsWith("?")) {
|
|
200
|
-
accountSas = accountSas.substring(1);
|
|
201
|
-
}
|
|
202
|
-
return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas };
|
|
139
|
+
if (!blobEndpoint) {
|
|
140
|
+
throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");
|
|
141
|
+
} else if (!accountSas) {
|
|
142
|
+
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
|
143
|
+
}
|
|
144
|
+
if (accountSas.startsWith("?")) {
|
|
145
|
+
accountSas = accountSas.substring(1);
|
|
203
146
|
}
|
|
147
|
+
return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas };
|
|
148
|
+
}
|
|
204
149
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Internal escape method implemented Strategy Two mentioned in escapeURL() description.
|
|
207
|
-
*
|
|
208
|
-
* @param text -
|
|
209
|
-
*/
|
|
210
150
|
function escape(text) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
.replace(/'/g, "%27") // Escape for "'"
|
|
214
|
-
.replace(/\+/g, "%20")
|
|
215
|
-
.replace(/%25/g, "%"); // Revert encoded "%"
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Append a string to URL path. Will remove duplicated "/" in front of the string
|
|
219
|
-
* when URL path ends with a "/".
|
|
220
|
-
*
|
|
221
|
-
* @param url - Source URL string
|
|
222
|
-
* @param name - String to be appended to URL
|
|
223
|
-
* @returns An updated URL string
|
|
224
|
-
*/
|
|
151
|
+
return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%");
|
|
152
|
+
}
|
|
225
153
|
function appendToURLPath(url, name) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Set URL parameter name and value. If name exists in URL parameters, old value
|
|
234
|
-
* will be replaced by name key. If not provide value, the parameter will be deleted.
|
|
235
|
-
*
|
|
236
|
-
* @param url - Source URL string
|
|
237
|
-
* @param name - Parameter name
|
|
238
|
-
* @param value - Parameter value
|
|
239
|
-
* @returns An updated URL string
|
|
240
|
-
*/
|
|
154
|
+
const urlParsed = new URL(url);
|
|
155
|
+
let path = urlParsed.pathname;
|
|
156
|
+
path = path ? path.endsWith("/") ? `${path}${name}` : `${path}/${name}` : name;
|
|
157
|
+
urlParsed.pathname = path;
|
|
158
|
+
return urlParsed.toString();
|
|
159
|
+
}
|
|
241
160
|
function setURLParameter(url, name, value) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Get URL parameter by name.
|
|
264
|
-
*
|
|
265
|
-
* @param url -
|
|
266
|
-
* @param name -
|
|
267
|
-
*/
|
|
161
|
+
const urlParsed = new URL(url);
|
|
162
|
+
const encodedName = encodeURIComponent(name);
|
|
163
|
+
const encodedValue = value ? encodeURIComponent(value) : void 0;
|
|
164
|
+
const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
|
|
165
|
+
const searchPieces = [];
|
|
166
|
+
for (const pair of searchString.slice(1).split("&")) {
|
|
167
|
+
if (pair) {
|
|
168
|
+
const [key] = pair.split("=", 2);
|
|
169
|
+
if (key !== encodedName) {
|
|
170
|
+
searchPieces.push(pair);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (encodedValue) {
|
|
175
|
+
searchPieces.push(`${encodedName}=${encodedValue}`);
|
|
176
|
+
}
|
|
177
|
+
urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
|
|
178
|
+
return urlParsed.toString();
|
|
179
|
+
}
|
|
268
180
|
function getURLParameter(url, name) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Set URL host.
|
|
274
|
-
*
|
|
275
|
-
* @param url - Source URL string
|
|
276
|
-
* @param host - New host string
|
|
277
|
-
* @returns An updated URL string
|
|
278
|
-
*/
|
|
181
|
+
const urlParsed = new URL(url);
|
|
182
|
+
return urlParsed.searchParams.get(name) ?? void 0;
|
|
183
|
+
}
|
|
279
184
|
function setURLHost(url, host) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Get URL path from an URL string.
|
|
286
|
-
*
|
|
287
|
-
* @param url - Source URL string
|
|
288
|
-
*/
|
|
185
|
+
const urlParsed = new URL(url);
|
|
186
|
+
urlParsed.hostname = host;
|
|
187
|
+
return urlParsed.toString();
|
|
188
|
+
}
|
|
289
189
|
function getURLPath(url) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
190
|
+
try {
|
|
191
|
+
const urlParsed = new URL(url);
|
|
192
|
+
return urlParsed.pathname;
|
|
193
|
+
} catch (e) {
|
|
194
|
+
return void 0;
|
|
195
|
+
}
|
|
297
196
|
}
|
|
298
|
-
/**
|
|
299
|
-
* Get URL scheme from an URL string.
|
|
300
|
-
*
|
|
301
|
-
* @param url - Source URL string
|
|
302
|
-
*/
|
|
303
197
|
function getURLScheme(url) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
198
|
+
try {
|
|
199
|
+
const urlParsed = new URL(url);
|
|
200
|
+
return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol;
|
|
201
|
+
} catch (e) {
|
|
202
|
+
return void 0;
|
|
203
|
+
}
|
|
311
204
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Get URL path and query from an URL string.
|
|
314
|
-
*
|
|
315
|
-
* @param url - Source URL string
|
|
316
|
-
*/
|
|
317
205
|
function getURLPathAndQuery(url) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
206
|
+
const urlParsed = new URL(url);
|
|
207
|
+
const pathString = urlParsed.pathname;
|
|
208
|
+
if (!pathString) {
|
|
209
|
+
throw new RangeError("Invalid url without valid path.");
|
|
210
|
+
}
|
|
211
|
+
let queryString = urlParsed.search || "";
|
|
212
|
+
queryString = queryString.trim();
|
|
213
|
+
if (queryString !== "") {
|
|
214
|
+
queryString = queryString.startsWith("?") ? queryString : `?${queryString}`;
|
|
215
|
+
}
|
|
216
|
+
return `${pathString}${queryString}`;
|
|
329
217
|
}
|
|
330
|
-
/**
|
|
331
|
-
* Get URL query key value pairs from an URL string.
|
|
332
|
-
*
|
|
333
|
-
* @param url -
|
|
334
|
-
*/
|
|
335
218
|
function getURLQueries(url) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Append a string to URL query.
|
|
359
|
-
*
|
|
360
|
-
* @param url - Source URL string.
|
|
361
|
-
* @param queryParts - String to be appended to the URL query.
|
|
362
|
-
* @returns An updated URL string.
|
|
363
|
-
*/
|
|
219
|
+
let queryString = new URL(url).search;
|
|
220
|
+
if (!queryString) {
|
|
221
|
+
return {};
|
|
222
|
+
}
|
|
223
|
+
queryString = queryString.trim();
|
|
224
|
+
queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
|
|
225
|
+
let querySubStrings = queryString.split("&");
|
|
226
|
+
querySubStrings = querySubStrings.filter((value) => {
|
|
227
|
+
const indexOfEqual = value.indexOf("=");
|
|
228
|
+
const lastIndexOfEqual = value.lastIndexOf("=");
|
|
229
|
+
return indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1;
|
|
230
|
+
});
|
|
231
|
+
const queries = {};
|
|
232
|
+
for (const querySubString of querySubStrings) {
|
|
233
|
+
const splitResults = querySubString.split("=");
|
|
234
|
+
const key = splitResults[0];
|
|
235
|
+
const value = splitResults[1];
|
|
236
|
+
queries[key] = value;
|
|
237
|
+
}
|
|
238
|
+
return queries;
|
|
239
|
+
}
|
|
364
240
|
function appendToURLQuery(url, queryParts) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Rounds a date off to seconds.
|
|
378
|
-
*
|
|
379
|
-
* @param date -
|
|
380
|
-
* @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned;
|
|
381
|
-
* If false, YYYY-MM-DDThh:mm:ssZ will be returned.
|
|
382
|
-
* @returns Date string in ISO8061 format, with or without 7 milliseconds component
|
|
383
|
-
*/
|
|
241
|
+
const urlParsed = new URL(url);
|
|
242
|
+
let query = urlParsed.search;
|
|
243
|
+
if (query) {
|
|
244
|
+
query += "&" + queryParts;
|
|
245
|
+
} else {
|
|
246
|
+
query = queryParts;
|
|
247
|
+
}
|
|
248
|
+
urlParsed.search = query;
|
|
249
|
+
return urlParsed.toString();
|
|
250
|
+
}
|
|
384
251
|
function truncatedISO8061Date(date, withMilliseconds = true) {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
? dateString.substring(0, dateString.length - 1) + "0000" + "Z"
|
|
389
|
-
: dateString.substring(0, dateString.length - 5) + "Z";
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Base64 encode.
|
|
393
|
-
*
|
|
394
|
-
* @param content -
|
|
395
|
-
*/
|
|
252
|
+
const dateString = date.toISOString();
|
|
253
|
+
return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z";
|
|
254
|
+
}
|
|
396
255
|
function base64encode(content) {
|
|
397
|
-
|
|
256
|
+
return !import_core_util.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64");
|
|
398
257
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Base64 decode.
|
|
401
|
-
*
|
|
402
|
-
* @param encodedString -
|
|
403
|
-
*/
|
|
404
258
|
function base64decode(encodedString) {
|
|
405
|
-
|
|
259
|
+
return !import_core_util.isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString();
|
|
406
260
|
}
|
|
407
|
-
/**
|
|
408
|
-
* Generate a 64 bytes base64 block ID string.
|
|
409
|
-
*
|
|
410
|
-
* @param blockIndex -
|
|
411
|
-
*/
|
|
412
261
|
function generateBlockID(blockIDPrefix, blockIndex) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0");
|
|
423
|
-
return base64encode(res);
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Delay specified time interval.
|
|
427
|
-
*
|
|
428
|
-
* @param timeInMs -
|
|
429
|
-
* @param aborter -
|
|
430
|
-
* @param abortError -
|
|
431
|
-
*/
|
|
262
|
+
const maxSourceStringLength = 48;
|
|
263
|
+
const maxBlockIndexLength = 6;
|
|
264
|
+
const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength;
|
|
265
|
+
if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) {
|
|
266
|
+
blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength);
|
|
267
|
+
}
|
|
268
|
+
const res = blockIDPrefix + padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0");
|
|
269
|
+
return base64encode(res);
|
|
270
|
+
}
|
|
432
271
|
async function delay(timeInMs, aborter, abortError) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
aborter.addEventListener("abort", abortHandler);
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* String.prototype.padStart()
|
|
456
|
-
*
|
|
457
|
-
* @param currentString -
|
|
458
|
-
* @param targetLength -
|
|
459
|
-
* @param padString -
|
|
460
|
-
*/
|
|
461
|
-
function padStart(currentString, targetLength, padString = " ") {
|
|
462
|
-
// @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes
|
|
463
|
-
if (String.prototype.padStart) {
|
|
464
|
-
return currentString.padStart(targetLength, padString);
|
|
465
|
-
}
|
|
466
|
-
padString = padString || " ";
|
|
467
|
-
if (currentString.length > targetLength) {
|
|
468
|
-
return currentString;
|
|
469
|
-
}
|
|
470
|
-
else {
|
|
471
|
-
targetLength = targetLength - currentString.length;
|
|
472
|
-
if (targetLength > padString.length) {
|
|
473
|
-
padString += padString.repeat(targetLength / padString.length);
|
|
474
|
-
}
|
|
475
|
-
return padString.slice(0, targetLength) + currentString;
|
|
272
|
+
return new Promise((resolve, reject) => {
|
|
273
|
+
let timeout;
|
|
274
|
+
const abortHandler = () => {
|
|
275
|
+
if (timeout !== void 0) {
|
|
276
|
+
clearTimeout(timeout);
|
|
277
|
+
}
|
|
278
|
+
reject(abortError);
|
|
279
|
+
};
|
|
280
|
+
const resolveHandler = () => {
|
|
281
|
+
if (aborter !== void 0) {
|
|
282
|
+
aborter.removeEventListener("abort", abortHandler);
|
|
283
|
+
}
|
|
284
|
+
resolve();
|
|
285
|
+
};
|
|
286
|
+
timeout = setTimeout(resolveHandler, timeInMs);
|
|
287
|
+
if (aborter !== void 0) {
|
|
288
|
+
aborter.addEventListener("abort", abortHandler);
|
|
476
289
|
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
function padStart(currentString, targetLength, padString = " ") {
|
|
293
|
+
if (String.prototype.padStart) {
|
|
294
|
+
return currentString.padStart(targetLength, padString);
|
|
295
|
+
}
|
|
296
|
+
padString = padString || " ";
|
|
297
|
+
if (currentString.length > targetLength) {
|
|
298
|
+
return currentString;
|
|
299
|
+
} else {
|
|
300
|
+
targetLength = targetLength - currentString.length;
|
|
301
|
+
if (targetLength > padString.length) {
|
|
302
|
+
padString += padString.repeat(targetLength / padString.length);
|
|
303
|
+
}
|
|
304
|
+
return padString.slice(0, targetLength) + currentString;
|
|
305
|
+
}
|
|
477
306
|
}
|
|
478
307
|
function sanitizeURL(url) {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
308
|
+
let safeURL = url;
|
|
309
|
+
if (getURLParameter(safeURL, import_constants.URLConstants.Parameters.SIGNATURE)) {
|
|
310
|
+
safeURL = setURLParameter(safeURL, import_constants.URLConstants.Parameters.SIGNATURE, "*****");
|
|
311
|
+
}
|
|
312
|
+
return safeURL;
|
|
484
313
|
}
|
|
485
314
|
function sanitizeHeaders(originalHeader) {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return headers;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* If two strings are equal when compared case insensitive.
|
|
502
|
-
*
|
|
503
|
-
* @param str1 -
|
|
504
|
-
* @param str2 -
|
|
505
|
-
*/
|
|
315
|
+
const headers = (0, import_core_rest_pipeline.createHttpHeaders)();
|
|
316
|
+
for (const [name, value] of originalHeader) {
|
|
317
|
+
if (name.toLowerCase() === import_constants.HeaderConstants.AUTHORIZATION.toLowerCase()) {
|
|
318
|
+
headers.set(name, "*****");
|
|
319
|
+
} else if (name.toLowerCase() === import_constants.HeaderConstants.X_MS_COPY_SOURCE) {
|
|
320
|
+
headers.set(name, sanitizeURL(value));
|
|
321
|
+
} else {
|
|
322
|
+
headers.set(name, value);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return headers;
|
|
326
|
+
}
|
|
506
327
|
function iEqual(str1, str2) {
|
|
507
|
-
|
|
328
|
+
return str1.toLocaleLowerCase() === str2.toLocaleLowerCase();
|
|
508
329
|
}
|
|
509
|
-
/**
|
|
510
|
-
* Extracts account name from the url
|
|
511
|
-
* @param url - url to extract the account name from
|
|
512
|
-
* @returns with the account name
|
|
513
|
-
*/
|
|
514
330
|
function getAccountNameFromUrl(url) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
// Custom domain case: "https://customdomain.com/containername/blob".
|
|
530
|
-
accountName = "";
|
|
531
|
-
}
|
|
532
|
-
return accountName;
|
|
533
|
-
}
|
|
534
|
-
catch (error) {
|
|
535
|
-
throw new Error("Unable to extract accountName with provided information.");
|
|
536
|
-
}
|
|
331
|
+
const parsedUrl = new URL(url);
|
|
332
|
+
let accountName;
|
|
333
|
+
try {
|
|
334
|
+
if (parsedUrl.hostname.split(".")[1] === "blob") {
|
|
335
|
+
accountName = parsedUrl.hostname.split(".")[0];
|
|
336
|
+
} else if (isIpEndpointStyle(parsedUrl)) {
|
|
337
|
+
accountName = parsedUrl.pathname.split("/")[1];
|
|
338
|
+
} else {
|
|
339
|
+
accountName = "";
|
|
340
|
+
}
|
|
341
|
+
return accountName;
|
|
342
|
+
} catch (error) {
|
|
343
|
+
throw new Error("Unable to extract accountName with provided information.");
|
|
344
|
+
}
|
|
537
345
|
}
|
|
538
346
|
function isIpEndpointStyle(parsedUrl) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
|
|
545
|
-
(Boolean(parsedUrl.port) && constants_js_1.PathStylePorts.includes(parsedUrl.port)));
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* Convert Tags to encoded string.
|
|
549
|
-
*
|
|
550
|
-
* @param tags -
|
|
551
|
-
*/
|
|
347
|
+
const host = parsedUrl.host;
|
|
348
|
+
return /^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(
|
|
349
|
+
host
|
|
350
|
+
) || Boolean(parsedUrl.port) && import_constants.PathStylePorts.includes(parsedUrl.port);
|
|
351
|
+
}
|
|
552
352
|
function toBlobTagsString(tags) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
353
|
+
if (tags === void 0) {
|
|
354
|
+
return void 0;
|
|
355
|
+
}
|
|
356
|
+
const tagPairs = [];
|
|
357
|
+
for (const key in tags) {
|
|
358
|
+
if (Object.prototype.hasOwnProperty.call(tags, key)) {
|
|
359
|
+
const value = tags[key];
|
|
360
|
+
tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return tagPairs.join("&");
|
|
564
364
|
}
|
|
565
|
-
/**
|
|
566
|
-
* Convert Tags type to BlobTags.
|
|
567
|
-
*
|
|
568
|
-
* @param tags -
|
|
569
|
-
*/
|
|
570
365
|
function toBlobTags(tags) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
366
|
+
if (tags === void 0) {
|
|
367
|
+
return void 0;
|
|
368
|
+
}
|
|
369
|
+
const res = {
|
|
370
|
+
blobTagSet: []
|
|
371
|
+
};
|
|
372
|
+
for (const key in tags) {
|
|
373
|
+
if (Object.prototype.hasOwnProperty.call(tags, key)) {
|
|
374
|
+
const value = tags[key];
|
|
375
|
+
res.blobTagSet.push({
|
|
376
|
+
key,
|
|
377
|
+
value
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return res;
|
|
587
382
|
}
|
|
588
|
-
/**
|
|
589
|
-
* Covert BlobTags to Tags type.
|
|
590
|
-
*
|
|
591
|
-
* @param tags -
|
|
592
|
-
*/
|
|
593
383
|
function toTags(tags) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
384
|
+
if (tags === void 0) {
|
|
385
|
+
return void 0;
|
|
386
|
+
}
|
|
387
|
+
const res = {};
|
|
388
|
+
for (const blobTag of tags.blobTagSet) {
|
|
389
|
+
res[blobTag.key] = blobTag.value;
|
|
390
|
+
}
|
|
391
|
+
return res;
|
|
602
392
|
}
|
|
603
|
-
/**
|
|
604
|
-
* Convert BlobQueryTextConfiguration to QuerySerialization type.
|
|
605
|
-
*
|
|
606
|
-
* @param textConfiguration -
|
|
607
|
-
*/
|
|
608
393
|
function toQuerySerialization(textConfiguration) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
},
|
|
625
|
-
};
|
|
626
|
-
case "json":
|
|
627
|
-
return {
|
|
628
|
-
format: {
|
|
629
|
-
type: "json",
|
|
630
|
-
jsonTextConfiguration: {
|
|
631
|
-
recordSeparator: textConfiguration.recordSeparator,
|
|
632
|
-
},
|
|
633
|
-
},
|
|
634
|
-
};
|
|
635
|
-
case "arrow":
|
|
636
|
-
return {
|
|
637
|
-
format: {
|
|
638
|
-
type: "arrow",
|
|
639
|
-
arrowConfiguration: {
|
|
640
|
-
schema: textConfiguration.schema,
|
|
641
|
-
},
|
|
642
|
-
},
|
|
643
|
-
};
|
|
644
|
-
case "parquet":
|
|
645
|
-
return {
|
|
646
|
-
format: {
|
|
647
|
-
type: "parquet",
|
|
648
|
-
},
|
|
649
|
-
};
|
|
650
|
-
default:
|
|
651
|
-
throw Error("Invalid BlobQueryTextConfiguration.");
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
function parseObjectReplicationRecord(objectReplicationRecord) {
|
|
655
|
-
if (!objectReplicationRecord) {
|
|
656
|
-
return undefined;
|
|
657
|
-
}
|
|
658
|
-
if ("policy-id" in objectReplicationRecord) {
|
|
659
|
-
// If the dictionary contains a key with policy id, we are not required to do any parsing since
|
|
660
|
-
// the policy id should already be stored in the ObjectReplicationDestinationPolicyId.
|
|
661
|
-
return undefined;
|
|
662
|
-
}
|
|
663
|
-
const orProperties = [];
|
|
664
|
-
for (const key in objectReplicationRecord) {
|
|
665
|
-
const ids = key.split("_");
|
|
666
|
-
const policyPrefix = "or-";
|
|
667
|
-
if (ids[0].startsWith(policyPrefix)) {
|
|
668
|
-
ids[0] = ids[0].substring(policyPrefix.length);
|
|
394
|
+
if (textConfiguration === void 0) {
|
|
395
|
+
return void 0;
|
|
396
|
+
}
|
|
397
|
+
switch (textConfiguration.kind) {
|
|
398
|
+
case "csv":
|
|
399
|
+
return {
|
|
400
|
+
format: {
|
|
401
|
+
type: "delimited",
|
|
402
|
+
delimitedTextConfiguration: {
|
|
403
|
+
columnSeparator: textConfiguration.columnSeparator || ",",
|
|
404
|
+
fieldQuote: textConfiguration.fieldQuote || "",
|
|
405
|
+
recordSeparator: textConfiguration.recordSeparator,
|
|
406
|
+
escapeChar: textConfiguration.escapeCharacter || "",
|
|
407
|
+
headersPresent: textConfiguration.hasHeaders || false
|
|
408
|
+
}
|
|
669
409
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
410
|
+
};
|
|
411
|
+
case "json":
|
|
412
|
+
return {
|
|
413
|
+
format: {
|
|
414
|
+
type: "json",
|
|
415
|
+
jsonTextConfiguration: {
|
|
416
|
+
recordSeparator: textConfiguration.recordSeparator
|
|
417
|
+
}
|
|
677
418
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
419
|
+
};
|
|
420
|
+
case "arrow":
|
|
421
|
+
return {
|
|
422
|
+
format: {
|
|
423
|
+
type: "arrow",
|
|
424
|
+
arrowConfiguration: {
|
|
425
|
+
schema: textConfiguration.schema
|
|
426
|
+
}
|
|
683
427
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
428
|
+
};
|
|
429
|
+
case "parquet":
|
|
430
|
+
return {
|
|
431
|
+
format: {
|
|
432
|
+
type: "parquet"
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
default:
|
|
436
|
+
throw Error("Invalid BlobQueryTextConfiguration.");
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function parseObjectReplicationRecord(objectReplicationRecord) {
|
|
440
|
+
if (!objectReplicationRecord) {
|
|
441
|
+
return void 0;
|
|
442
|
+
}
|
|
443
|
+
if ("policy-id" in objectReplicationRecord) {
|
|
444
|
+
return void 0;
|
|
445
|
+
}
|
|
446
|
+
const orProperties = [];
|
|
447
|
+
for (const key in objectReplicationRecord) {
|
|
448
|
+
const ids = key.split("_");
|
|
449
|
+
const policyPrefix = "or-";
|
|
450
|
+
if (ids[0].startsWith(policyPrefix)) {
|
|
451
|
+
ids[0] = ids[0].substring(policyPrefix.length);
|
|
452
|
+
}
|
|
453
|
+
const rule = {
|
|
454
|
+
ruleId: ids[1],
|
|
455
|
+
replicationStatus: objectReplicationRecord[key]
|
|
456
|
+
};
|
|
457
|
+
const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]);
|
|
458
|
+
if (policyIndex > -1) {
|
|
459
|
+
orProperties[policyIndex].rules.push(rule);
|
|
460
|
+
} else {
|
|
461
|
+
orProperties.push({
|
|
462
|
+
policyId: ids[0],
|
|
463
|
+
rules: [rule]
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return orProperties;
|
|
468
|
+
}
|
|
693
469
|
function attachCredential(thing, credential) {
|
|
694
|
-
|
|
695
|
-
|
|
470
|
+
thing.credential = credential;
|
|
471
|
+
return thing;
|
|
696
472
|
}
|
|
697
473
|
function httpAuthorizationToString(httpAuthorization) {
|
|
698
|
-
|
|
474
|
+
return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0;
|
|
699
475
|
}
|
|
700
476
|
function BlobNameToString(name) {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
477
|
+
if (name.encoded) {
|
|
478
|
+
return decodeURIComponent(name.content);
|
|
479
|
+
} else {
|
|
480
|
+
return name.content;
|
|
481
|
+
}
|
|
707
482
|
}
|
|
708
483
|
function ConvertInternalResponseOfListBlobFlat(internalResponse) {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
484
|
+
return {
|
|
485
|
+
...internalResponse,
|
|
486
|
+
segment: {
|
|
487
|
+
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
|
|
488
|
+
const blobItem = {
|
|
489
|
+
...blobItemInteral,
|
|
490
|
+
name: BlobNameToString(blobItemInteral.name)
|
|
491
|
+
};
|
|
492
|
+
return blobItem;
|
|
493
|
+
})
|
|
494
|
+
}
|
|
495
|
+
};
|
|
721
496
|
}
|
|
722
497
|
function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
};
|
|
731
|
-
return blobPrefix;
|
|
732
|
-
}),
|
|
733
|
-
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
|
|
734
|
-
const blobItem = {
|
|
735
|
-
...blobItemInteral,
|
|
736
|
-
name: BlobNameToString(blobItemInteral.name),
|
|
737
|
-
};
|
|
738
|
-
return blobItem;
|
|
739
|
-
}),
|
|
740
|
-
},
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
function* ExtractPageRangeInfoItems(getPageRangesSegment) {
|
|
744
|
-
let pageRange = [];
|
|
745
|
-
let clearRange = [];
|
|
746
|
-
if (getPageRangesSegment.pageRange)
|
|
747
|
-
pageRange = getPageRangesSegment.pageRange;
|
|
748
|
-
if (getPageRangesSegment.clearRange)
|
|
749
|
-
clearRange = getPageRangesSegment.clearRange;
|
|
750
|
-
let pageRangeIndex = 0;
|
|
751
|
-
let clearRangeIndex = 0;
|
|
752
|
-
while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) {
|
|
753
|
-
if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) {
|
|
754
|
-
yield {
|
|
755
|
-
start: pageRange[pageRangeIndex].start,
|
|
756
|
-
end: pageRange[pageRangeIndex].end,
|
|
757
|
-
isClear: false,
|
|
758
|
-
};
|
|
759
|
-
++pageRangeIndex;
|
|
760
|
-
}
|
|
761
|
-
else {
|
|
762
|
-
yield {
|
|
763
|
-
start: clearRange[clearRangeIndex].start,
|
|
764
|
-
end: clearRange[clearRangeIndex].end,
|
|
765
|
-
isClear: true,
|
|
766
|
-
};
|
|
767
|
-
++clearRangeIndex;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) {
|
|
771
|
-
yield {
|
|
772
|
-
start: pageRange[pageRangeIndex].start,
|
|
773
|
-
end: pageRange[pageRangeIndex].end,
|
|
774
|
-
isClear: false,
|
|
498
|
+
return {
|
|
499
|
+
...internalResponse,
|
|
500
|
+
segment: {
|
|
501
|
+
blobPrefixes: internalResponse.segment.blobPrefixes?.map((blobPrefixInternal) => {
|
|
502
|
+
const blobPrefix = {
|
|
503
|
+
...blobPrefixInternal,
|
|
504
|
+
name: BlobNameToString(blobPrefixInternal.name)
|
|
775
505
|
};
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
506
|
+
return blobPrefix;
|
|
507
|
+
}),
|
|
508
|
+
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
|
|
509
|
+
const blobItem = {
|
|
510
|
+
...blobItemInteral,
|
|
511
|
+
name: BlobNameToString(blobItemInteral.name)
|
|
782
512
|
};
|
|
513
|
+
return blobItem;
|
|
514
|
+
})
|
|
783
515
|
}
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
function* ExtractPageRangeInfoItems(getPageRangesSegment) {
|
|
519
|
+
let pageRange = [];
|
|
520
|
+
let clearRange = [];
|
|
521
|
+
if (getPageRangesSegment.pageRange) pageRange = getPageRangesSegment.pageRange;
|
|
522
|
+
if (getPageRangesSegment.clearRange) clearRange = getPageRangesSegment.clearRange;
|
|
523
|
+
let pageRangeIndex = 0;
|
|
524
|
+
let clearRangeIndex = 0;
|
|
525
|
+
while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) {
|
|
526
|
+
if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) {
|
|
527
|
+
yield {
|
|
528
|
+
start: pageRange[pageRangeIndex].start,
|
|
529
|
+
end: pageRange[pageRangeIndex].end,
|
|
530
|
+
isClear: false
|
|
531
|
+
};
|
|
532
|
+
++pageRangeIndex;
|
|
533
|
+
} else {
|
|
534
|
+
yield {
|
|
535
|
+
start: clearRange[clearRangeIndex].start,
|
|
536
|
+
end: clearRange[clearRangeIndex].end,
|
|
537
|
+
isClear: true
|
|
538
|
+
};
|
|
539
|
+
++clearRangeIndex;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) {
|
|
543
|
+
yield {
|
|
544
|
+
start: pageRange[pageRangeIndex].start,
|
|
545
|
+
end: pageRange[pageRangeIndex].end,
|
|
546
|
+
isClear: false
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) {
|
|
550
|
+
yield {
|
|
551
|
+
start: clearRange[clearRangeIndex].start,
|
|
552
|
+
end: clearRange[clearRangeIndex].end,
|
|
553
|
+
isClear: true
|
|
554
|
+
};
|
|
555
|
+
}
|
|
784
556
|
}
|
|
785
|
-
/**
|
|
786
|
-
* Escape the blobName but keep path separator ('/').
|
|
787
|
-
*/
|
|
788
557
|
function EscapePath(blobName) {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
795
|
-
/**
|
|
796
|
-
* A typesafe helper for ensuring that a given response object has
|
|
797
|
-
* the original _response attached.
|
|
798
|
-
* @param response - A response object from calling a client operation
|
|
799
|
-
* @returns The same object, but with known _response property
|
|
800
|
-
*/
|
|
801
|
-
function assertResponse(response) {
|
|
802
|
-
if (`_response` in response) {
|
|
803
|
-
return response;
|
|
804
|
-
}
|
|
805
|
-
throw new TypeError(`Unexpected response object ${response}`);
|
|
558
|
+
const split = blobName.split("/");
|
|
559
|
+
for (let i = 0; i < split.length; i++) {
|
|
560
|
+
split[i] = encodeURIComponent(split[i]);
|
|
561
|
+
}
|
|
562
|
+
return split.join("/");
|
|
806
563
|
}
|
|
807
|
-
|
|
564
|
+
function assertResponse(response) {
|
|
565
|
+
if (`_response` in response) {
|
|
566
|
+
return response;
|
|
567
|
+
}
|
|
568
|
+
throw new TypeError(`Unexpected response object ${response}`);
|
|
569
|
+
}
|
|
570
|
+
async function setUploadChecksumParameters(body, contentLength, parameters, uploadOptions, configContentChecksumAlgorithm) {
|
|
571
|
+
let contentChecksumAlgorithm = uploadOptions.contentChecksumAlgorithm ?? configContentChecksumAlgorithm;
|
|
572
|
+
if (contentChecksumAlgorithm === void 0) {
|
|
573
|
+
contentChecksumAlgorithm = "Customized";
|
|
574
|
+
}
|
|
575
|
+
if (contentChecksumAlgorithm === "Auto") {
|
|
576
|
+
contentChecksumAlgorithm = "StorageCrc64";
|
|
577
|
+
}
|
|
578
|
+
let bodyInfo = void 0;
|
|
579
|
+
if (contentChecksumAlgorithm === "Customized") {
|
|
580
|
+
parameters.transactionalContentMD5 = uploadOptions.transactionalContentMD5;
|
|
581
|
+
parameters.transactionalContentCrc64 = uploadOptions.transactionalContentCrc64;
|
|
582
|
+
} else if (contentChecksumAlgorithm === "StorageCrc64") {
|
|
583
|
+
await import_storage_common.StorageCRC64Calculator.init();
|
|
584
|
+
bodyInfo = await (0, import_storage_common.structuredMessageEncoding)(body, contentLength);
|
|
585
|
+
parameters.structuredBodyType = "XSM/1.0; properties=crc64";
|
|
586
|
+
parameters.structuredContentLength = contentLength;
|
|
587
|
+
}
|
|
588
|
+
return {
|
|
589
|
+
body: contentChecksumAlgorithm === "StorageCrc64" ? bodyInfo.body : body,
|
|
590
|
+
contentLength: contentChecksumAlgorithm === "StorageCrc64" ? bodyInfo.encodedContentLength : contentLength,
|
|
591
|
+
contentChecksumAlgorithm
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
595
|
+
0 && (module.exports = {
|
|
596
|
+
BlobNameToString,
|
|
597
|
+
ConvertInternalResponseOfListBlobFlat,
|
|
598
|
+
ConvertInternalResponseOfListBlobHierarchy,
|
|
599
|
+
EscapePath,
|
|
600
|
+
ExtractPageRangeInfoItems,
|
|
601
|
+
appendToURLPath,
|
|
602
|
+
appendToURLQuery,
|
|
603
|
+
assertResponse,
|
|
604
|
+
attachCredential,
|
|
605
|
+
base64decode,
|
|
606
|
+
base64encode,
|
|
607
|
+
delay,
|
|
608
|
+
escapeURLPath,
|
|
609
|
+
extractConnectionStringParts,
|
|
610
|
+
generateBlockID,
|
|
611
|
+
getAccountNameFromUrl,
|
|
612
|
+
getURLParameter,
|
|
613
|
+
getURLPath,
|
|
614
|
+
getURLPathAndQuery,
|
|
615
|
+
getURLQueries,
|
|
616
|
+
getURLScheme,
|
|
617
|
+
getValueInConnString,
|
|
618
|
+
httpAuthorizationToString,
|
|
619
|
+
iEqual,
|
|
620
|
+
isIpEndpointStyle,
|
|
621
|
+
padStart,
|
|
622
|
+
parseObjectReplicationRecord,
|
|
623
|
+
sanitizeHeaders,
|
|
624
|
+
sanitizeURL,
|
|
625
|
+
setURLHost,
|
|
626
|
+
setURLParameter,
|
|
627
|
+
setUploadChecksumParameters,
|
|
628
|
+
toBlobTags,
|
|
629
|
+
toBlobTagsString,
|
|
630
|
+
toQuerySerialization,
|
|
631
|
+
toTags,
|
|
632
|
+
truncatedISO8061Date
|
|
633
|
+
});
|