@azure/storage-file-share 12.28.0-beta.1 → 12.28.1-alpha.20250724.2
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/AccountSASPermissions.d.ts +1 -1
- package/dist/browser/AccountSASPermissions.js +34 -36
- package/dist/browser/AccountSASPermissions.js.map +1 -1
- package/dist/browser/AccountSASResourceTypes.d.ts +1 -1
- package/dist/browser/AccountSASResourceTypes.js +13 -15
- package/dist/browser/AccountSASResourceTypes.js.map +1 -1
- package/dist/browser/AccountSASServices.js +16 -18
- package/dist/browser/AccountSASServices.js.map +1 -1
- package/dist/browser/AccountSASSignatureValues.d.ts +4 -4
- package/dist/browser/AccountSASSignatureValues.d.ts.map +1 -1
- package/dist/browser/AccountSASSignatureValues.js +1 -1
- package/dist/browser/AccountSASSignatureValues.js.map +1 -1
- package/dist/browser/Clients.d.ts +56 -55
- package/dist/browser/Clients.d.ts.map +1 -1
- package/dist/browser/Clients.js +602 -289
- package/dist/browser/Clients.js.map +1 -1
- package/dist/browser/FileSASPermissions.js +16 -18
- package/dist/browser/FileSASPermissions.js.map +1 -1
- package/dist/browser/FileSASSignatureValues.d.ts +2 -2
- package/dist/browser/FileSASSignatureValues.d.ts.map +1 -1
- package/dist/browser/FileSASSignatureValues.js.map +1 -1
- package/dist/browser/FileSystemAttributes.d.ts +1 -1
- package/dist/browser/FileSystemAttributes.js +44 -46
- package/dist/browser/FileSystemAttributes.js.map +1 -1
- package/dist/browser/Pipeline.d.ts +2 -4
- package/dist/browser/Pipeline.d.ts.map +1 -1
- package/dist/browser/Pipeline.js +28 -19
- package/dist/browser/Pipeline.js.map +1 -1
- package/dist/browser/Range.d.ts +1 -1
- package/dist/browser/Range.js.map +1 -1
- package/dist/browser/SASQueryParameters.d.ts +1 -1
- package/dist/browser/SASQueryParameters.js +70 -0
- package/dist/browser/SASQueryParameters.js.map +1 -1
- package/dist/browser/ShareClientInternal.js +1 -0
- package/dist/browser/ShareClientInternal.js.map +1 -1
- package/dist/browser/ShareSASPermissions.d.ts +1 -1
- package/dist/browser/ShareSASPermissions.js +21 -23
- package/dist/browser/ShareSASPermissions.js.map +1 -1
- package/dist/browser/ShareServiceClient.d.ts +5 -5
- package/dist/browser/ShareServiceClient.d.ts.map +1 -1
- package/dist/browser/ShareServiceClient.js +70 -54
- package/dist/browser/ShareServiceClient.js.map +1 -1
- package/dist/browser/StorageClient.d.ts +2 -2
- package/dist/browser/StorageClient.d.ts.map +1 -1
- package/dist/browser/StorageClient.js +23 -0
- package/dist/browser/StorageClient.js.map +1 -1
- package/dist/browser/StorageContextClient.js +1 -1
- package/dist/browser/StorageContextClient.js.map +1 -1
- package/dist/browser/generated/src/operations/directory.js +1 -0
- package/dist/browser/generated/src/operations/directory.js.map +1 -1
- package/dist/browser/generated/src/operations/file.js +1 -0
- package/dist/browser/generated/src/operations/file.js.map +1 -1
- package/dist/browser/generated/src/operations/service.js +1 -0
- package/dist/browser/generated/src/operations/service.js.map +1 -1
- package/dist/browser/generated/src/operations/share.js +1 -0
- package/dist/browser/generated/src/operations/share.js.map +1 -1
- package/dist/browser/generated/src/storageClient.js +15 -4
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/index-browser.d.mts.map +1 -1
- package/dist/browser/index-browser.mjs.map +1 -1
- package/dist/browser/index.d.ts +1 -7
- package/dist/browser/index.js +1 -7
- package/dist/browser/utils/Batch.js +29 -21
- package/dist/browser/utils/Batch.js.map +1 -1
- package/dist/browser/utils/BufferScheduler.js +70 -44
- package/dist/browser/utils/BufferScheduler.js.map +1 -1
- package/dist/browser/utils/RetriableReadableStream.js +70 -62
- 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 +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/utils.common.d.ts +2 -2
- package/dist/browser/utils/utils.common.js +33 -17
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/commonjs/AccountSASPermissions.d.ts +1 -1
- package/dist/commonjs/AccountSASPermissions.js +34 -36
- package/dist/commonjs/AccountSASPermissions.js.map +1 -1
- package/dist/commonjs/AccountSASResourceTypes.d.ts +1 -1
- package/dist/commonjs/AccountSASResourceTypes.js +13 -15
- package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
- package/dist/commonjs/AccountSASServices.js +16 -18
- package/dist/commonjs/AccountSASServices.js.map +1 -1
- package/dist/commonjs/AccountSASSignatureValues.d.ts +4 -4
- package/dist/commonjs/AccountSASSignatureValues.d.ts.map +1 -1
- package/dist/commonjs/AccountSASSignatureValues.js +1 -1
- package/dist/commonjs/AccountSASSignatureValues.js.map +1 -1
- package/dist/commonjs/Clients.d.ts +56 -55
- package/dist/commonjs/Clients.d.ts.map +1 -1
- package/dist/commonjs/Clients.js +614 -301
- package/dist/commonjs/Clients.js.map +1 -1
- package/dist/commonjs/FileDownloadResponse.js +2 -0
- package/dist/commonjs/FileDownloadResponse.js.map +1 -1
- package/dist/commonjs/FileSASPermissions.js +16 -18
- package/dist/commonjs/FileSASPermissions.js.map +1 -1
- package/dist/commonjs/FileSASSignatureValues.d.ts +2 -2
- package/dist/commonjs/FileSASSignatureValues.d.ts.map +1 -1
- package/dist/commonjs/FileSASSignatureValues.js.map +1 -1
- package/dist/commonjs/FileSystemAttributes.d.ts +1 -1
- package/dist/commonjs/FileSystemAttributes.js +44 -46
- package/dist/commonjs/FileSystemAttributes.js.map +1 -1
- package/dist/commonjs/Pipeline.d.ts +2 -4
- package/dist/commonjs/Pipeline.d.ts.map +1 -1
- package/dist/commonjs/Pipeline.js +39 -30
- package/dist/commonjs/Pipeline.js.map +1 -1
- package/dist/commonjs/Range.d.ts +1 -1
- package/dist/commonjs/Range.js.map +1 -1
- package/dist/commonjs/SASQueryParameters.d.ts +1 -1
- package/dist/commonjs/SASQueryParameters.js +70 -0
- package/dist/commonjs/SASQueryParameters.js.map +1 -1
- package/dist/commonjs/ShareClientInternal.js +1 -0
- package/dist/commonjs/ShareClientInternal.js.map +1 -1
- package/dist/commonjs/ShareSASPermissions.d.ts +1 -1
- package/dist/commonjs/ShareSASPermissions.js +21 -23
- package/dist/commonjs/ShareSASPermissions.js.map +1 -1
- package/dist/commonjs/ShareServiceClient.d.ts +5 -5
- package/dist/commonjs/ShareServiceClient.d.ts.map +1 -1
- package/dist/commonjs/ShareServiceClient.js +76 -60
- package/dist/commonjs/ShareServiceClient.js.map +1 -1
- package/dist/commonjs/StorageClient.d.ts +2 -2
- package/dist/commonjs/StorageClient.d.ts.map +1 -1
- package/dist/commonjs/StorageClient.js +23 -0
- package/dist/commonjs/StorageClient.js.map +1 -1
- package/dist/commonjs/StorageContextClient.js +1 -1
- package/dist/commonjs/StorageContextClient.js.map +1 -1
- package/dist/commonjs/generated/src/operations/directory.js +1 -0
- package/dist/commonjs/generated/src/operations/directory.js.map +1 -1
- package/dist/commonjs/generated/src/operations/file.js +1 -0
- package/dist/commonjs/generated/src/operations/file.js.map +1 -1
- package/dist/commonjs/generated/src/operations/service.js +1 -0
- package/dist/commonjs/generated/src/operations/service.js.map +1 -1
- package/dist/commonjs/generated/src/operations/share.js +1 -0
- package/dist/commonjs/generated/src/operations/share.js.map +1 -1
- package/dist/commonjs/generated/src/storageClient.js +15 -4
- package/dist/commonjs/generated/src/storageClient.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -9
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +13 -18
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/Batch.js +29 -21
- package/dist/commonjs/utils/Batch.js.map +1 -1
- package/dist/commonjs/utils/BufferScheduler.js +70 -44
- package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
- package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
- package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
- package/dist/commonjs/utils/constants.d.ts.map +1 -1
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/commonjs/utils/utils.common.d.ts +2 -2
- package/dist/commonjs/utils/utils.common.js +33 -17
- package/dist/commonjs/utils/utils.common.js.map +1 -1
- package/dist/commonjs/utils/utils.d.ts +1 -1
- package/dist/commonjs/utils/utils.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.js +5 -5
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/AccountSASPermissions.d.ts +1 -1
- package/dist/esm/AccountSASPermissions.js +34 -36
- package/dist/esm/AccountSASPermissions.js.map +1 -1
- package/dist/esm/AccountSASResourceTypes.d.ts +1 -1
- package/dist/esm/AccountSASResourceTypes.js +13 -15
- package/dist/esm/AccountSASResourceTypes.js.map +1 -1
- package/dist/esm/AccountSASServices.js +16 -18
- package/dist/esm/AccountSASServices.js.map +1 -1
- package/dist/esm/AccountSASSignatureValues.d.ts +4 -4
- package/dist/esm/AccountSASSignatureValues.d.ts.map +1 -1
- package/dist/esm/AccountSASSignatureValues.js +1 -1
- package/dist/esm/AccountSASSignatureValues.js.map +1 -1
- package/dist/esm/Clients.d.ts +56 -55
- package/dist/esm/Clients.d.ts.map +1 -1
- package/dist/esm/Clients.js +602 -289
- package/dist/esm/Clients.js.map +1 -1
- package/dist/esm/FileDownloadResponse.js +2 -0
- package/dist/esm/FileDownloadResponse.js.map +1 -1
- package/dist/esm/FileSASPermissions.js +16 -18
- package/dist/esm/FileSASPermissions.js.map +1 -1
- package/dist/esm/FileSASSignatureValues.d.ts +2 -2
- package/dist/esm/FileSASSignatureValues.d.ts.map +1 -1
- package/dist/esm/FileSASSignatureValues.js.map +1 -1
- package/dist/esm/FileSystemAttributes.d.ts +1 -1
- package/dist/esm/FileSystemAttributes.js +44 -46
- package/dist/esm/FileSystemAttributes.js.map +1 -1
- package/dist/esm/Pipeline.d.ts +2 -4
- package/dist/esm/Pipeline.d.ts.map +1 -1
- package/dist/esm/Pipeline.js +28 -19
- package/dist/esm/Pipeline.js.map +1 -1
- package/dist/esm/Range.d.ts +1 -1
- package/dist/esm/Range.js.map +1 -1
- package/dist/esm/SASQueryParameters.d.ts +1 -1
- package/dist/esm/SASQueryParameters.js +70 -0
- package/dist/esm/SASQueryParameters.js.map +1 -1
- package/dist/esm/ShareClientInternal.js +1 -0
- package/dist/esm/ShareClientInternal.js.map +1 -1
- package/dist/esm/ShareSASPermissions.d.ts +1 -1
- package/dist/esm/ShareSASPermissions.js +21 -23
- package/dist/esm/ShareSASPermissions.js.map +1 -1
- package/dist/esm/ShareServiceClient.d.ts +5 -5
- package/dist/esm/ShareServiceClient.d.ts.map +1 -1
- package/dist/esm/ShareServiceClient.js +70 -54
- package/dist/esm/ShareServiceClient.js.map +1 -1
- package/dist/esm/StorageClient.d.ts +2 -2
- package/dist/esm/StorageClient.d.ts.map +1 -1
- package/dist/esm/StorageClient.js +23 -0
- package/dist/esm/StorageClient.js.map +1 -1
- package/dist/esm/StorageContextClient.js +1 -1
- package/dist/esm/StorageContextClient.js.map +1 -1
- package/dist/esm/generated/src/operations/directory.js +1 -0
- package/dist/esm/generated/src/operations/directory.js.map +1 -1
- package/dist/esm/generated/src/operations/file.js +1 -0
- package/dist/esm/generated/src/operations/file.js.map +1 -1
- package/dist/esm/generated/src/operations/service.js +1 -0
- package/dist/esm/generated/src/operations/service.js.map +1 -1
- package/dist/esm/generated/src/operations/share.js +1 -0
- package/dist/esm/generated/src/operations/share.js.map +1 -1
- package/dist/esm/generated/src/storageClient.js +15 -4
- package/dist/esm/generated/src/storageClient.js.map +1 -1
- package/dist/esm/index.d.ts +1 -9
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/Batch.js +29 -21
- package/dist/esm/utils/Batch.js.map +1 -1
- package/dist/esm/utils/BufferScheduler.js +70 -44
- package/dist/esm/utils/BufferScheduler.js.map +1 -1
- package/dist/esm/utils/RetriableReadableStream.js +70 -62
- 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 +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/utils.common.d.ts +2 -2
- package/dist/esm/utils/utils.common.js +33 -17
- package/dist/esm/utils/utils.common.js.map +1 -1
- package/dist/esm/utils/utils.d.ts +1 -1
- package/dist/esm/utils/utils.d.ts.map +1 -1
- package/dist/esm/utils/utils.js +2 -2
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/react-native/AccountSASPermissions.d.ts +1 -1
- package/dist/react-native/AccountSASPermissions.js +34 -36
- package/dist/react-native/AccountSASPermissions.js.map +1 -1
- package/dist/react-native/AccountSASResourceTypes.d.ts +1 -1
- package/dist/react-native/AccountSASResourceTypes.js +13 -15
- package/dist/react-native/AccountSASResourceTypes.js.map +1 -1
- package/dist/react-native/AccountSASServices.js +16 -18
- package/dist/react-native/AccountSASServices.js.map +1 -1
- package/dist/react-native/AccountSASSignatureValues.d.ts +4 -4
- package/dist/react-native/AccountSASSignatureValues.d.ts.map +1 -1
- package/dist/react-native/AccountSASSignatureValues.js +1 -1
- package/dist/react-native/AccountSASSignatureValues.js.map +1 -1
- package/dist/react-native/Clients.d.ts +56 -55
- package/dist/react-native/Clients.d.ts.map +1 -1
- package/dist/react-native/Clients.js +602 -289
- package/dist/react-native/Clients.js.map +1 -1
- package/dist/react-native/FileDownloadResponse.js +2 -0
- package/dist/react-native/FileDownloadResponse.js.map +1 -1
- package/dist/react-native/FileSASPermissions.js +16 -18
- package/dist/react-native/FileSASPermissions.js.map +1 -1
- package/dist/react-native/FileSASSignatureValues.d.ts +2 -2
- package/dist/react-native/FileSASSignatureValues.d.ts.map +1 -1
- package/dist/react-native/FileSASSignatureValues.js.map +1 -1
- package/dist/react-native/FileSystemAttributes.d.ts +1 -1
- package/dist/react-native/FileSystemAttributes.js +44 -46
- package/dist/react-native/FileSystemAttributes.js.map +1 -1
- package/dist/react-native/Pipeline.d.ts +2 -4
- package/dist/react-native/Pipeline.d.ts.map +1 -1
- package/dist/react-native/Pipeline.js +28 -19
- package/dist/react-native/Pipeline.js.map +1 -1
- package/dist/react-native/Range.d.ts +1 -1
- package/dist/react-native/Range.js.map +1 -1
- package/dist/react-native/SASQueryParameters.d.ts +1 -1
- package/dist/react-native/SASQueryParameters.js +70 -0
- package/dist/react-native/SASQueryParameters.js.map +1 -1
- package/dist/react-native/ShareClientInternal.js +1 -0
- package/dist/react-native/ShareClientInternal.js.map +1 -1
- package/dist/react-native/ShareSASPermissions.d.ts +1 -1
- package/dist/react-native/ShareSASPermissions.js +21 -23
- package/dist/react-native/ShareSASPermissions.js.map +1 -1
- package/dist/react-native/ShareServiceClient.d.ts +5 -5
- package/dist/react-native/ShareServiceClient.d.ts.map +1 -1
- package/dist/react-native/ShareServiceClient.js +70 -54
- package/dist/react-native/ShareServiceClient.js.map +1 -1
- package/dist/react-native/StorageClient.d.ts +2 -2
- package/dist/react-native/StorageClient.d.ts.map +1 -1
- package/dist/react-native/StorageClient.js +23 -0
- package/dist/react-native/StorageClient.js.map +1 -1
- package/dist/react-native/StorageContextClient.js +1 -1
- package/dist/react-native/StorageContextClient.js.map +1 -1
- package/dist/react-native/generated/src/operations/directory.js +1 -0
- package/dist/react-native/generated/src/operations/directory.js.map +1 -1
- package/dist/react-native/generated/src/operations/file.js +1 -0
- package/dist/react-native/generated/src/operations/file.js.map +1 -1
- package/dist/react-native/generated/src/operations/service.js +1 -0
- package/dist/react-native/generated/src/operations/service.js.map +1 -1
- package/dist/react-native/generated/src/operations/share.js +1 -0
- package/dist/react-native/generated/src/operations/share.js.map +1 -1
- package/dist/react-native/generated/src/storageClient.js +15 -4
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/index.d.ts +1 -9
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +1 -9
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/utils/Batch.js +29 -21
- package/dist/react-native/utils/Batch.js.map +1 -1
- package/dist/react-native/utils/BufferScheduler.js +70 -44
- package/dist/react-native/utils/BufferScheduler.js.map +1 -1
- package/dist/react-native/utils/RetriableReadableStream.js +70 -62
- 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 +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/utils.common.d.ts +2 -2
- package/dist/react-native/utils/utils.common.js +33 -17
- package/dist/react-native/utils/utils.common.js.map +1 -1
- package/dist/react-native/utils/utils.d.ts +1 -1
- package/dist/react-native/utils/utils.d.ts.map +1 -1
- package/dist/react-native/utils/utils.js +2 -2
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +12 -12
- package/dist/browser/StorageRetryPolicyFactory.d.ts +0 -56
- package/dist/browser/StorageRetryPolicyFactory.d.ts.map +0 -1
- package/dist/browser/StorageRetryPolicyFactory.js +0 -26
- package/dist/browser/StorageRetryPolicyFactory.js.map +0 -1
- package/dist/browser/policies/StorageRetryPolicy.d.ts +0 -75
- package/dist/browser/policies/StorageRetryPolicy.d.ts.map +0 -1
- package/dist/browser/policies/StorageRetryPolicy.js +0 -220
- package/dist/browser/policies/StorageRetryPolicy.js.map +0 -1
- package/dist/browser/policies/StorageRetryPolicyV2.d.ts +0 -24
- package/dist/browser/policies/StorageRetryPolicyV2.d.ts.map +0 -1
- package/dist/browser/policies/StorageRetryPolicyV2.js +0 -176
- package/dist/browser/policies/StorageRetryPolicyV2.js.map +0 -1
- package/dist/commonjs/StorageRetryPolicyFactory.d.ts +0 -56
- package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +0 -1
- package/dist/commonjs/StorageRetryPolicyFactory.js +0 -31
- package/dist/commonjs/StorageRetryPolicyFactory.js.map +0 -1
- package/dist/commonjs/policies/StorageRetryPolicy.d.ts +0 -75
- package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/StorageRetryPolicy.js +0 -225
- package/dist/commonjs/policies/StorageRetryPolicy.js.map +0 -1
- package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts +0 -24
- package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts.map +0 -1
- package/dist/commonjs/policies/StorageRetryPolicyV2.js +0 -180
- package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +0 -1
- package/dist/esm/StorageRetryPolicyFactory.d.ts +0 -56
- package/dist/esm/StorageRetryPolicyFactory.d.ts.map +0 -1
- package/dist/esm/StorageRetryPolicyFactory.js +0 -26
- package/dist/esm/StorageRetryPolicyFactory.js.map +0 -1
- package/dist/esm/policies/StorageRetryPolicy.d.ts +0 -75
- package/dist/esm/policies/StorageRetryPolicy.d.ts.map +0 -1
- package/dist/esm/policies/StorageRetryPolicy.js +0 -220
- package/dist/esm/policies/StorageRetryPolicy.js.map +0 -1
- package/dist/esm/policies/StorageRetryPolicyV2.d.ts +0 -24
- package/dist/esm/policies/StorageRetryPolicyV2.d.ts.map +0 -1
- package/dist/esm/policies/StorageRetryPolicyV2.js +0 -176
- package/dist/esm/policies/StorageRetryPolicyV2.js.map +0 -1
- package/dist/react-native/StorageRetryPolicyFactory.d.ts +0 -56
- package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +0 -1
- package/dist/react-native/StorageRetryPolicyFactory.js +0 -26
- package/dist/react-native/StorageRetryPolicyFactory.js.map +0 -1
- package/dist/react-native/policies/StorageRetryPolicy.d.ts +0 -75
- package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/StorageRetryPolicy.js +0 -220
- package/dist/react-native/policies/StorageRetryPolicy.js.map +0 -1
- package/dist/react-native/policies/StorageRetryPolicyV2.d.ts +0 -24
- package/dist/react-native/policies/StorageRetryPolicyV2.d.ts.map +0 -1
- package/dist/react-native/policies/StorageRetryPolicyV2.js +0 -176
- package/dist/react-native/policies/StorageRetryPolicyV2.js.map +0 -1
package/dist/esm/Clients.js
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
import { __asyncGenerator, __asyncValues, __await } from "tslib";
|
4
3
|
import { isTokenCredential } from "@azure/core-auth";
|
5
4
|
import { isNodeLike } from "@azure/core-util";
|
6
5
|
import { isPipelineLike, newPipeline } from "./Pipeline.js";
|
7
6
|
import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants, } from "./utils/constants.js";
|
8
7
|
import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, removeEmptyString, asSharePermission, parseOctalFileMode, toOctalFileMode, } from "./utils/utils.common.js";
|
9
|
-
import { Credential } from "@azure/storage-
|
10
|
-
import { StorageSharedKeyCredential } from "@azure/storage-
|
11
|
-
import { AnonymousCredential } from "@azure/storage-
|
8
|
+
import { Credential } from "@azure/storage-common";
|
9
|
+
import { StorageSharedKeyCredential } from "@azure/storage-common";
|
10
|
+
import { AnonymousCredential } from "@azure/storage-common";
|
12
11
|
import { tracingClient } from "./utils/tracing.js";
|
13
12
|
import { StorageClient } from "./StorageClient.js";
|
14
13
|
import { FileDownloadResponse } from "./FileDownloadResponse.js";
|
@@ -23,6 +22,12 @@ import { generateFileSASQueryParameters, generateFileSASQueryParametersInternal,
|
|
23
22
|
* A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
|
24
23
|
*/
|
25
24
|
export class ShareClient extends StorageClient {
|
25
|
+
/**
|
26
|
+
* Share operation context provided by protocol layer.
|
27
|
+
*/
|
28
|
+
context;
|
29
|
+
_name;
|
30
|
+
shareClientConfig;
|
26
31
|
/**
|
27
32
|
* The name of the share
|
28
33
|
*/
|
@@ -96,33 +101,43 @@ export class ShareClient extends StorageClient {
|
|
96
101
|
/**
|
97
102
|
* Creates a new share under the specified account. If the share with
|
98
103
|
* the same name already exists, the operation fails.
|
99
|
-
* @see https://learn.microsoft.com/
|
104
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-share
|
100
105
|
*
|
101
106
|
* @param options - Options to Share Create operation.
|
102
107
|
* @returns Response data for the Share Create operation.
|
103
108
|
*/
|
104
109
|
async create(options = {}) {
|
105
110
|
return tracingClient.withSpan("ShareClient-create", options, async (updatedOptions) => {
|
106
|
-
return assertResponse(await this.context.create(
|
111
|
+
return assertResponse(await this.context.create({
|
112
|
+
...updatedOptions,
|
113
|
+
...this.shareClientConfig,
|
114
|
+
enabledProtocols: toShareProtocolsString(updatedOptions.protocols),
|
115
|
+
}));
|
107
116
|
});
|
108
117
|
}
|
109
118
|
/**
|
110
119
|
* Creates a new share under the specified account. If the share with
|
111
120
|
* the same name already exists, it is not changed.
|
112
|
-
* @see https://learn.microsoft.com/
|
121
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-share
|
113
122
|
*
|
114
123
|
* @param options -
|
115
124
|
*/
|
116
125
|
async createIfNotExists(options = {}) {
|
117
126
|
return tracingClient.withSpan("ShareClient-createIfNotExists", options, async (updatedOptions) => {
|
118
|
-
var _a, _b;
|
119
127
|
try {
|
120
128
|
const res = await this.create(updatedOptions);
|
121
|
-
return
|
129
|
+
return {
|
130
|
+
succeeded: true,
|
131
|
+
...res,
|
132
|
+
};
|
122
133
|
}
|
123
134
|
catch (e) {
|
124
|
-
if (
|
125
|
-
return
|
135
|
+
if (e.details?.errorCode === "ShareAlreadyExists") {
|
136
|
+
return {
|
137
|
+
succeeded: false,
|
138
|
+
...e.response?.parsedHeaders,
|
139
|
+
_response: e.response,
|
140
|
+
};
|
126
141
|
}
|
127
142
|
throw e;
|
128
143
|
}
|
@@ -152,7 +167,7 @@ export class ShareClient extends StorageClient {
|
|
152
167
|
}
|
153
168
|
/**
|
154
169
|
* Creates a new subdirectory under this share.
|
155
|
-
* @see https://learn.microsoft.com/
|
170
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-directory
|
156
171
|
*
|
157
172
|
* @param directoryName -
|
158
173
|
* @param options - Options to Directory Create operation.
|
@@ -171,7 +186,7 @@ export class ShareClient extends StorageClient {
|
|
171
186
|
/**
|
172
187
|
* Removes the specified empty sub directory under this share.
|
173
188
|
* Note that the directory must be empty before it can be deleted.
|
174
|
-
* @see https://learn.microsoft.com/
|
189
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-directory
|
175
190
|
*
|
176
191
|
* @param directoryName -
|
177
192
|
* @param options - Options to Directory Delete operation.
|
@@ -186,7 +201,7 @@ export class ShareClient extends StorageClient {
|
|
186
201
|
/**
|
187
202
|
* Creates a new file or replaces a file under the root directory of this share.
|
188
203
|
* Note it only initializes the file with no content.
|
189
|
-
* @see https://learn.microsoft.com/
|
204
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-file
|
190
205
|
*
|
191
206
|
* @param fileName -
|
192
207
|
* @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
|
@@ -217,7 +232,7 @@ export class ShareClient extends StorageClient {
|
|
217
232
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400
|
218
233
|
* (`InvalidQueryParameterValue`)
|
219
234
|
*
|
220
|
-
* @see https://learn.microsoft.com/
|
235
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-file2
|
221
236
|
*
|
222
237
|
* @param directoryName -
|
223
238
|
* @param fileName -
|
@@ -257,7 +272,7 @@ export class ShareClient extends StorageClient {
|
|
257
272
|
/**
|
258
273
|
* Returns all user-defined metadata and system properties for the specified
|
259
274
|
* share.
|
260
|
-
* @see https://learn.microsoft.com/
|
275
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-share-properties
|
261
276
|
*
|
262
277
|
* WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
|
263
278
|
* they originally contained uppercase characters. This differs from the metadata keys returned by
|
@@ -269,39 +284,52 @@ export class ShareClient extends StorageClient {
|
|
269
284
|
async getProperties(options = {}) {
|
270
285
|
return tracingClient.withSpan("ShareClient-getProperties", options, async (updatedOptions) => {
|
271
286
|
const res = assertResponse(await this.context.getProperties(updatedOptions));
|
272
|
-
return
|
287
|
+
return {
|
288
|
+
...res,
|
289
|
+
...this.shareClientConfig,
|
290
|
+
protocols: toShareProtocols(res.enabledProtocols),
|
291
|
+
};
|
273
292
|
});
|
274
293
|
}
|
275
294
|
/**
|
276
295
|
* Marks the specified share for deletion. The share and any directories or files
|
277
296
|
* contained within it are later deleted during garbage collection.
|
278
|
-
* @see https://learn.microsoft.com/
|
297
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-share
|
279
298
|
*
|
280
299
|
* @param options - Options to Share Delete operation.
|
281
300
|
* @returns Response data for the Share Delete operation.
|
282
301
|
*/
|
283
302
|
async delete(options = {}) {
|
284
303
|
return tracingClient.withSpan("ShareClient-delete", options, async (updatedOptions) => {
|
285
|
-
return assertResponse(await this.context.delete(
|
304
|
+
return assertResponse(await this.context.delete({
|
305
|
+
...updatedOptions,
|
306
|
+
...this.shareClientConfig,
|
307
|
+
}));
|
286
308
|
});
|
287
309
|
}
|
288
310
|
/**
|
289
311
|
* Marks the specified share for deletion if it exists. The share and any directories or files
|
290
312
|
* contained within it are later deleted during garbage collection.
|
291
|
-
* @see https://learn.microsoft.com/
|
313
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-share
|
292
314
|
*
|
293
315
|
* @param options -
|
294
316
|
*/
|
295
317
|
async deleteIfExists(options = {}) {
|
296
318
|
return tracingClient.withSpan("ShareClient-deleteIfExists", options, async (updatedOptions) => {
|
297
|
-
var _a, _b;
|
298
319
|
try {
|
299
320
|
const res = await this.delete(updatedOptions);
|
300
|
-
return
|
321
|
+
return {
|
322
|
+
succeeded: true,
|
323
|
+
...res,
|
324
|
+
};
|
301
325
|
}
|
302
326
|
catch (e) {
|
303
|
-
if (
|
304
|
-
return
|
327
|
+
if (e.details?.errorCode === "ShareNotFound") {
|
328
|
+
return {
|
329
|
+
succeeded: false,
|
330
|
+
...e.response?.parsedHeaders,
|
331
|
+
_response: e.response,
|
332
|
+
};
|
305
333
|
}
|
306
334
|
throw e;
|
307
335
|
}
|
@@ -312,7 +340,7 @@ export class ShareClient extends StorageClient {
|
|
312
340
|
*
|
313
341
|
* If no option provided, or no metadata defined in the option parameter, the share
|
314
342
|
* metadata will be removed.
|
315
|
-
* @see https://learn.microsoft.com/
|
343
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-share-metadata
|
316
344
|
*
|
317
345
|
* @param metadata - If no metadata provided, all existing directory metadata will be removed.
|
318
346
|
* @param option - Options to Share Set Metadata operation.
|
@@ -320,7 +348,11 @@ export class ShareClient extends StorageClient {
|
|
320
348
|
*/
|
321
349
|
async setMetadata(metadata, options = {}) {
|
322
350
|
return tracingClient.withSpan("ShareClient-setMetadata", options, async (updatedOptions) => {
|
323
|
-
return assertResponse(await this.context.setMetadata(
|
351
|
+
return assertResponse(await this.context.setMetadata({
|
352
|
+
...updatedOptions,
|
353
|
+
...this.shareClientConfig,
|
354
|
+
metadata,
|
355
|
+
}));
|
324
356
|
});
|
325
357
|
}
|
326
358
|
/**
|
@@ -330,14 +362,17 @@ export class ShareClient extends StorageClient {
|
|
330
362
|
* WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.
|
331
363
|
* For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
|
332
364
|
*
|
333
|
-
* @see https://learn.microsoft.com/
|
365
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-share-acl
|
334
366
|
*
|
335
367
|
* @param option - Options to Share Get Access Policy operation.
|
336
368
|
* @returns Response data for the Share Get Access Policy operation.
|
337
369
|
*/
|
338
370
|
async getAccessPolicy(options = {}) {
|
339
371
|
return tracingClient.withSpan("ShareClient-getAccessPolicy", options, async (updatedOptions) => {
|
340
|
-
const response = assertResponse(await this.context.getAccessPolicy(
|
372
|
+
const response = assertResponse(await this.context.getAccessPolicy({
|
373
|
+
...updatedOptions,
|
374
|
+
...this.shareClientConfig,
|
375
|
+
}));
|
341
376
|
const res = {
|
342
377
|
_response: response._response,
|
343
378
|
date: response.date,
|
@@ -379,7 +414,7 @@ export class ShareClient extends StorageClient {
|
|
379
414
|
* When you establish a stored access policy on a share, it may take up to 30 seconds to take effect.
|
380
415
|
* During this interval, a shared access signature that is associated with the stored access policy will
|
381
416
|
* fail with status code 403 (Forbidden), until the access policy becomes active.
|
382
|
-
* @see https://learn.microsoft.com/
|
417
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-share-acl
|
383
418
|
*
|
384
419
|
* @param shareAcl - Array of signed identifiers, each having a unique Id and details of access policy.
|
385
420
|
* @param option - Options to Share Set Access Policy operation.
|
@@ -387,23 +422,26 @@ export class ShareClient extends StorageClient {
|
|
387
422
|
*/
|
388
423
|
async setAccessPolicy(shareAcl, options = {}) {
|
389
424
|
return tracingClient.withSpan("ShareClient-setAccessPolicy", options, async (updatedOptions) => {
|
390
|
-
var _a, _b, _c;
|
391
425
|
const acl = [];
|
392
426
|
for (const identifier of shareAcl || []) {
|
393
427
|
acl.push({
|
394
428
|
accessPolicy: {
|
395
|
-
expiresOn:
|
429
|
+
expiresOn: identifier.accessPolicy?.expiresOn
|
396
430
|
? truncatedISO8061Date(identifier.accessPolicy.expiresOn)
|
397
431
|
: undefined,
|
398
|
-
permissions:
|
399
|
-
startsOn:
|
432
|
+
permissions: identifier.accessPolicy?.permissions,
|
433
|
+
startsOn: identifier.accessPolicy?.startsOn
|
400
434
|
? truncatedISO8061Date(identifier.accessPolicy.startsOn)
|
401
435
|
: undefined,
|
402
436
|
},
|
403
437
|
id: identifier.id,
|
404
438
|
});
|
405
439
|
}
|
406
|
-
return assertResponse(await this.context.setAccessPolicy(
|
440
|
+
return assertResponse(await this.context.setAccessPolicy({
|
441
|
+
...updatedOptions,
|
442
|
+
...this.shareClientConfig,
|
443
|
+
shareAcl: acl,
|
444
|
+
}));
|
407
445
|
});
|
408
446
|
}
|
409
447
|
/**
|
@@ -414,7 +452,10 @@ export class ShareClient extends StorageClient {
|
|
414
452
|
*/
|
415
453
|
async createSnapshot(options = {}) {
|
416
454
|
return tracingClient.withSpan("ShareClient-createSnapshot", options, async (updatedOptions) => {
|
417
|
-
return assertResponse(await this.context.createSnapshot(
|
455
|
+
return assertResponse(await this.context.createSnapshot({
|
456
|
+
...updatedOptions,
|
457
|
+
...this.shareClientConfig,
|
458
|
+
}));
|
418
459
|
});
|
419
460
|
}
|
420
461
|
/**
|
@@ -428,7 +469,11 @@ export class ShareClient extends StorageClient {
|
|
428
469
|
*/
|
429
470
|
async setQuota(quotaInGB, options = {}) {
|
430
471
|
return tracingClient.withSpan("ShareClient-setQuota", options, async (updatedOptions) => {
|
431
|
-
return assertResponse(await this.context.setProperties(
|
472
|
+
return assertResponse(await this.context.setProperties({
|
473
|
+
...updatedOptions,
|
474
|
+
...this.shareClientConfig,
|
475
|
+
quota: quotaInGB,
|
476
|
+
}));
|
432
477
|
});
|
433
478
|
}
|
434
479
|
/**
|
@@ -439,7 +484,12 @@ export class ShareClient extends StorageClient {
|
|
439
484
|
*/
|
440
485
|
async setProperties(options = {}) {
|
441
486
|
return tracingClient.withSpan("ShareClient-setProperties", options, async (updatedOptions) => {
|
442
|
-
return assertResponse(await this.context.setProperties(
|
487
|
+
return assertResponse(await this.context.setProperties({
|
488
|
+
...options,
|
489
|
+
...this.shareClientConfig,
|
490
|
+
quota: options.quotaInGB,
|
491
|
+
tracingOptions: updatedOptions.tracingOptions,
|
492
|
+
}));
|
443
493
|
});
|
444
494
|
}
|
445
495
|
/**
|
@@ -450,35 +500,44 @@ export class ShareClient extends StorageClient {
|
|
450
500
|
*/
|
451
501
|
async getStatistics(options = {}) {
|
452
502
|
return tracingClient.withSpan("ShareClient-getStatistics", options, async (updatedOptions) => {
|
453
|
-
const response = assertResponse(await this.context.getStatistics(
|
503
|
+
const response = assertResponse(await this.context.getStatistics({
|
504
|
+
...updatedOptions,
|
505
|
+
...this.shareClientConfig,
|
506
|
+
}));
|
454
507
|
const GBBytes = 1024 * 1024 * 1024;
|
455
|
-
return
|
508
|
+
return { ...response, shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) };
|
456
509
|
});
|
457
510
|
}
|
458
511
|
/**
|
459
512
|
* Creates a file permission (a security descriptor) at the share level.
|
460
513
|
* The created security descriptor can be used for the files/directories in the share.
|
461
|
-
* @see https://learn.microsoft.com/
|
514
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-permission
|
462
515
|
*
|
463
516
|
* @param options - Options to Share Create Permission operation.
|
464
517
|
* @param filePermission - File permission described in the SDDL
|
465
518
|
*/
|
466
519
|
async createPermission(filePermission, options = {}) {
|
467
520
|
return tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
|
468
|
-
return assertResponse(await this.context.createPermission(asSharePermission(filePermission),
|
521
|
+
return assertResponse(await this.context.createPermission(asSharePermission(filePermission), {
|
522
|
+
...updatedOptions,
|
523
|
+
...this.shareClientConfig,
|
524
|
+
}));
|
469
525
|
});
|
470
526
|
}
|
471
527
|
/**
|
472
528
|
* Gets the Security Descriptor Definition Language (SDDL) for a given file permission key
|
473
529
|
* which indicates a security descriptor.
|
474
|
-
* @see https://learn.microsoft.com/
|
530
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-permission
|
475
531
|
*
|
476
532
|
* @param options - Options to Share Create Permission operation.
|
477
533
|
* @param filePermissionKey - File permission key which indicates the security descriptor of the permission.
|
478
534
|
*/
|
479
535
|
async getPermission(filePermissionKey, options = {}) {
|
480
536
|
return tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
|
481
|
-
return assertResponse(await this.context.getPermission(filePermissionKey,
|
537
|
+
return assertResponse(await this.context.getPermission(filePermissionKey, {
|
538
|
+
...updatedOptions,
|
539
|
+
...this.shareClientConfig,
|
540
|
+
}));
|
482
541
|
});
|
483
542
|
}
|
484
543
|
/**
|
@@ -496,7 +555,7 @@ export class ShareClient extends StorageClient {
|
|
496
555
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
497
556
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
498
557
|
*
|
499
|
-
* @see https://learn.microsoft.com/
|
558
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
500
559
|
*
|
501
560
|
* @param options - Optional parameters.
|
502
561
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -505,7 +564,10 @@ export class ShareClient extends StorageClient {
|
|
505
564
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
506
565
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
507
566
|
}
|
508
|
-
const sas = generateFileSASQueryParameters(
|
567
|
+
const sas = generateFileSASQueryParameters({
|
568
|
+
shareName: this.name,
|
569
|
+
...options,
|
570
|
+
}, this.credential).toString();
|
509
571
|
return appendToURLQuery(this.url, sas);
|
510
572
|
}
|
511
573
|
/**
|
@@ -514,7 +576,7 @@ export class ShareClient extends StorageClient {
|
|
514
576
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
515
577
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
516
578
|
*
|
517
|
-
* @see https://learn.microsoft.com/
|
579
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
518
580
|
*
|
519
581
|
* @param options - Optional parameters.
|
520
582
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -524,13 +586,24 @@ export class ShareClient extends StorageClient {
|
|
524
586
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
525
587
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
526
588
|
}
|
527
|
-
return generateFileSASQueryParametersInternal(
|
589
|
+
return generateFileSASQueryParametersInternal({
|
590
|
+
shareName: this.name,
|
591
|
+
...options,
|
592
|
+
}, this.credential).stringToSign;
|
528
593
|
}
|
529
594
|
}
|
530
595
|
/**
|
531
596
|
* A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.
|
532
597
|
*/
|
533
598
|
export class ShareDirectoryClient extends StorageClient {
|
599
|
+
/**
|
600
|
+
* context provided by protocol layer.
|
601
|
+
*/
|
602
|
+
context;
|
603
|
+
_shareName;
|
604
|
+
_path;
|
605
|
+
_name;
|
606
|
+
shareClientConfig;
|
534
607
|
/**
|
535
608
|
* The share name corresponding to this directory client
|
536
609
|
*/
|
@@ -576,7 +649,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
576
649
|
}
|
577
650
|
/**
|
578
651
|
* Creates a new directory under the specified share or parent directory.
|
579
|
-
* @see https://learn.microsoft.com/
|
652
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-directory
|
580
653
|
*
|
581
654
|
* @param options - Options to Directory Create operation.
|
582
655
|
* @returns Response data for the Directory operation.
|
@@ -586,36 +659,55 @@ export class ShareDirectoryClient extends StorageClient {
|
|
586
659
|
options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
|
587
660
|
}
|
588
661
|
return tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
|
589
|
-
|
590
|
-
|
662
|
+
const rawResponse = await this.context.create({
|
663
|
+
...updatedOptions,
|
664
|
+
fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
|
665
|
+
fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
|
666
|
+
fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
|
667
|
+
fileAttributes: updatedOptions.fileAttributes
|
591
668
|
? fileAttributesToString(updatedOptions.fileAttributes)
|
592
|
-
: undefined,
|
593
|
-
|
669
|
+
: undefined,
|
670
|
+
owner: updatedOptions.posixProperties?.owner,
|
671
|
+
group: updatedOptions.posixProperties?.group,
|
672
|
+
fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
|
673
|
+
...this.shareClientConfig,
|
674
|
+
});
|
675
|
+
const wrappedRes = {
|
676
|
+
...rawResponse,
|
677
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
678
|
+
posixProperties: {
|
594
679
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
595
680
|
fileType: rawResponse.nfsFileType,
|
596
681
|
owner: rawResponse.owner,
|
597
682
|
group: rawResponse.group,
|
598
|
-
}
|
683
|
+
},
|
684
|
+
};
|
599
685
|
return assertResponse(wrappedRes);
|
600
686
|
});
|
601
687
|
}
|
602
688
|
/**
|
603
689
|
* Creates a new directory under the specified share or parent directory if it does not already exists.
|
604
690
|
* If the directory already exists, it is not modified.
|
605
|
-
* @see https://learn.microsoft.com/
|
691
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-directory
|
606
692
|
*
|
607
693
|
* @param options -
|
608
694
|
*/
|
609
695
|
async createIfNotExists(options = {}) {
|
610
696
|
return tracingClient.withSpan("ShareDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
|
611
|
-
var _a, _b;
|
612
697
|
try {
|
613
698
|
const res = await this.create(updatedOptions);
|
614
|
-
return
|
699
|
+
return {
|
700
|
+
succeeded: true,
|
701
|
+
...res,
|
702
|
+
};
|
615
703
|
}
|
616
704
|
catch (e) {
|
617
|
-
if (
|
618
|
-
return
|
705
|
+
if (e.details?.errorCode === "ResourceAlreadyExists") {
|
706
|
+
return {
|
707
|
+
succeeded: false,
|
708
|
+
...e.response?.parsedHeaders,
|
709
|
+
_response: e.response,
|
710
|
+
};
|
619
711
|
}
|
620
712
|
throw e;
|
621
713
|
}
|
@@ -623,7 +715,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
623
715
|
}
|
624
716
|
/**
|
625
717
|
* Sets properties on the directory.
|
626
|
-
* @see https://learn.microsoft.com/
|
718
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-directory-properties
|
627
719
|
*
|
628
720
|
* @param DirectoryProperties - Directory properties. If no values are provided,
|
629
721
|
* existing values will be preserved.
|
@@ -631,15 +723,28 @@ export class ShareDirectoryClient extends StorageClient {
|
|
631
723
|
async setProperties(properties = {}) {
|
632
724
|
properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
|
633
725
|
return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
|
634
|
-
|
635
|
-
|
726
|
+
const rawResponse = await this.context.setProperties({
|
727
|
+
...updatedOptions,
|
728
|
+
fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
|
729
|
+
fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
|
730
|
+
fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
|
731
|
+
fileAttributes: updatedOptions.fileAttributes
|
636
732
|
? fileAttributesToString(updatedOptions.fileAttributes)
|
637
|
-
: undefined,
|
638
|
-
|
733
|
+
: undefined,
|
734
|
+
owner: updatedOptions.posixProperties?.owner,
|
735
|
+
group: updatedOptions.posixProperties?.group,
|
736
|
+
fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
|
737
|
+
...this.shareClientConfig,
|
738
|
+
});
|
739
|
+
return assertResponse({
|
740
|
+
...rawResponse,
|
741
|
+
_response: rawResponse._response,
|
742
|
+
posixProperties: {
|
639
743
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
640
744
|
owner: rawResponse.owner,
|
641
745
|
group: rawResponse.group,
|
642
|
-
}
|
746
|
+
},
|
747
|
+
});
|
643
748
|
});
|
644
749
|
}
|
645
750
|
/**
|
@@ -674,7 +779,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
674
779
|
}
|
675
780
|
/**
|
676
781
|
* Creates a new subdirectory under this directory.
|
677
|
-
* @see https://learn.microsoft.com/
|
782
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-directory
|
678
783
|
*
|
679
784
|
* @param directoryName -
|
680
785
|
* @param options - Options to Directory Create operation.
|
@@ -693,7 +798,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
693
798
|
/**
|
694
799
|
* Removes the specified empty sub directory under this directory.
|
695
800
|
* Note that the directory must be empty before it can be deleted.
|
696
|
-
* @see https://learn.microsoft.com/
|
801
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-directory
|
697
802
|
*
|
698
803
|
* @param directoryName -
|
699
804
|
* @param options - Options to Directory Delete operation.
|
@@ -707,7 +812,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
707
812
|
}
|
708
813
|
/**
|
709
814
|
* Creates a new file or replaces a file under this directory. Note it only initializes the file with no content.
|
710
|
-
* @see https://learn.microsoft.com/
|
815
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-file
|
711
816
|
*
|
712
817
|
* @param fileName -
|
713
818
|
* @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
|
@@ -736,7 +841,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
736
841
|
* Delete File is not supported on a share snapshot, which is a read-only copy of
|
737
842
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
|
738
843
|
*
|
739
|
-
* @see https://learn.microsoft.com/
|
844
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-file2
|
740
845
|
*
|
741
846
|
* @param fileName - Name of the file to delete
|
742
847
|
* @param options - Options to File Delete operation.
|
@@ -800,7 +905,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
800
905
|
async exists(options = {}) {
|
801
906
|
return tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
|
802
907
|
try {
|
803
|
-
await this.getProperties(
|
908
|
+
await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });
|
804
909
|
return true;
|
805
910
|
}
|
806
911
|
catch (e) {
|
@@ -815,53 +920,66 @@ export class ShareDirectoryClient extends StorageClient {
|
|
815
920
|
* Returns all system properties for the specified directory, and can also be used to check the
|
816
921
|
* existence of a directory. The data returned does not include the files in the directory or any
|
817
922
|
* subdirectories.
|
818
|
-
* @see https://learn.microsoft.com/
|
923
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-directory-properties
|
819
924
|
*
|
820
925
|
* @param options - Options to Directory Get Properties operation.
|
821
926
|
* @returns Response data for the Directory Get Properties operation.
|
822
927
|
*/
|
823
928
|
async getProperties(options = {}) {
|
824
929
|
return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
|
825
|
-
const rawResponse = await this.context.getProperties(
|
826
|
-
|
930
|
+
const rawResponse = await this.context.getProperties({
|
931
|
+
...updatedOptions,
|
932
|
+
...this.shareClientConfig,
|
933
|
+
});
|
934
|
+
return assertResponse({
|
935
|
+
...rawResponse,
|
936
|
+
_response: rawResponse._response,
|
937
|
+
posixProperties: {
|
827
938
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
828
939
|
owner: rawResponse.owner,
|
829
940
|
group: rawResponse.group,
|
830
941
|
fileType: rawResponse.nfsFileType,
|
831
|
-
}
|
942
|
+
},
|
943
|
+
});
|
832
944
|
});
|
833
945
|
}
|
834
946
|
/**
|
835
947
|
* Removes the specified empty directory. Note that the directory must be empty before it can be
|
836
948
|
* deleted.
|
837
|
-
* @see https://learn.microsoft.com/
|
949
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-directory
|
838
950
|
*
|
839
951
|
* @param options - Options to Directory Delete operation.
|
840
952
|
* @returns Response data for the Directory Delete operation.
|
841
953
|
*/
|
842
954
|
async delete(options = {}) {
|
843
955
|
return tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
|
844
|
-
return assertResponse(await this.context.delete(
|
956
|
+
return assertResponse(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
|
845
957
|
});
|
846
958
|
}
|
847
959
|
/**
|
848
960
|
* Removes the specified empty directory if it exists. Note that the directory must be empty before it can be
|
849
961
|
* deleted.
|
850
|
-
* @see https://learn.microsoft.com/
|
962
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-directory
|
851
963
|
*
|
852
964
|
* @param options -
|
853
965
|
*/
|
854
966
|
async deleteIfExists(options = {}) {
|
855
967
|
return tracingClient.withSpan("ShareDirectoryClient-deleteIfExists", options, async (updatedOptions) => {
|
856
|
-
var _a, _b, _c;
|
857
968
|
try {
|
858
969
|
const res = await this.delete(updatedOptions);
|
859
|
-
return
|
970
|
+
return {
|
971
|
+
succeeded: true,
|
972
|
+
...res,
|
973
|
+
};
|
860
974
|
}
|
861
975
|
catch (e) {
|
862
|
-
if (
|
863
|
-
|
864
|
-
return
|
976
|
+
if (e.details?.errorCode === "ResourceNotFound" ||
|
977
|
+
e.details?.errorCode === "ParentNotFound") {
|
978
|
+
return {
|
979
|
+
succeeded: false,
|
980
|
+
...e.response?.parsedHeaders,
|
981
|
+
_response: e.response,
|
982
|
+
};
|
865
983
|
}
|
866
984
|
throw e;
|
867
985
|
}
|
@@ -869,7 +987,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
869
987
|
}
|
870
988
|
/**
|
871
989
|
* Updates user defined metadata for the specified directory.
|
872
|
-
* @see https://learn.microsoft.com/
|
990
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-directory-metadata
|
873
991
|
*
|
874
992
|
* @param metadata - If no metadata provided, all existing directory metadata will be removed
|
875
993
|
* @param options - Options to Directory Set Metadata operation.
|
@@ -877,7 +995,11 @@ export class ShareDirectoryClient extends StorageClient {
|
|
877
995
|
*/
|
878
996
|
async setMetadata(metadata, options = {}) {
|
879
997
|
return tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
|
880
|
-
return assertResponse(await this.context.setMetadata(
|
998
|
+
return assertResponse(await this.context.setMetadata({
|
999
|
+
...updatedOptions,
|
1000
|
+
metadata,
|
1001
|
+
...this.shareClientConfig,
|
1002
|
+
}));
|
881
1003
|
});
|
882
1004
|
}
|
883
1005
|
/**
|
@@ -892,52 +1014,35 @@ export class ShareDirectoryClient extends StorageClient {
|
|
892
1014
|
* items. The marker value is opaque to the client.
|
893
1015
|
* @param options - Options to list files and directories operation.
|
894
1016
|
*/
|
895
|
-
iterateFilesAndDirectoriesSegments(
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
} while (marker);
|
906
|
-
});
|
1017
|
+
async *iterateFilesAndDirectoriesSegments(marker, options = {}) {
|
1018
|
+
if (options.prefix === "") {
|
1019
|
+
options.prefix = undefined;
|
1020
|
+
}
|
1021
|
+
let listFilesAndDirectoriesResponse;
|
1022
|
+
do {
|
1023
|
+
listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);
|
1024
|
+
marker = listFilesAndDirectoriesResponse.continuationToken;
|
1025
|
+
yield await listFilesAndDirectoriesResponse;
|
1026
|
+
} while (marker);
|
907
1027
|
}
|
908
1028
|
/**
|
909
1029
|
* Returns an AsyncIterableIterator for file and directory items
|
910
1030
|
*
|
911
1031
|
* @param options - Options to list files and directories operation.
|
912
1032
|
*/
|
913
|
-
listFilesAndDirectoriesItems() {
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
for (var _d = true, _e = __asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
922
|
-
_c = _f.value;
|
923
|
-
_d = false;
|
924
|
-
const listFilesAndDirectoriesResponse = _c;
|
925
|
-
for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
|
926
|
-
yield yield __await(Object.assign({ kind: "file" }, file));
|
927
|
-
}
|
928
|
-
for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
|
929
|
-
yield yield __await(Object.assign({ kind: "directory" }, directory));
|
930
|
-
}
|
931
|
-
}
|
1033
|
+
async *listFilesAndDirectoriesItems(options = {}) {
|
1034
|
+
if (options.prefix === "") {
|
1035
|
+
options.prefix = undefined;
|
1036
|
+
}
|
1037
|
+
let marker;
|
1038
|
+
for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(marker, options)) {
|
1039
|
+
for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
|
1040
|
+
yield { kind: "file", ...file };
|
932
1041
|
}
|
933
|
-
|
934
|
-
|
935
|
-
try {
|
936
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
937
|
-
}
|
938
|
-
finally { if (e_1) throw e_1.error; }
|
1042
|
+
for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
|
1043
|
+
yield { kind: "directory", ...directory };
|
939
1044
|
}
|
940
|
-
}
|
1045
|
+
}
|
941
1046
|
}
|
942
1047
|
/**
|
943
1048
|
* Returns an async iterable iterator to list all the files and directories
|
@@ -1105,7 +1210,10 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1105
1210
|
if (options.prefix === "") {
|
1106
1211
|
options.prefix = undefined;
|
1107
1212
|
}
|
1108
|
-
const updatedOptions =
|
1213
|
+
const updatedOptions = {
|
1214
|
+
...options,
|
1215
|
+
...(include.length > 0 ? { include: include } : {}),
|
1216
|
+
};
|
1109
1217
|
// AsyncIterableIterator to iterate over files and directories
|
1110
1218
|
const iter = this.listFilesAndDirectoriesItems(updatedOptions);
|
1111
1219
|
return {
|
@@ -1125,14 +1233,17 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1125
1233
|
* Return an AsyncIterableIterator that works a page at a time
|
1126
1234
|
*/
|
1127
1235
|
byPage: (settings = {}) => {
|
1128
|
-
return this.iterateFilesAndDirectoriesSegments(removeEmptyString(settings.continuationToken),
|
1236
|
+
return this.iterateFilesAndDirectoriesSegments(removeEmptyString(settings.continuationToken), {
|
1237
|
+
maxResults: settings.maxPageSize,
|
1238
|
+
...updatedOptions,
|
1239
|
+
});
|
1129
1240
|
},
|
1130
1241
|
};
|
1131
1242
|
}
|
1132
1243
|
/**
|
1133
1244
|
* Returns a list of files or directories under the specified share or directory. It lists the
|
1134
1245
|
* contents only for a single level of the directory hierarchy.
|
1135
|
-
* @see https://learn.microsoft.com/
|
1246
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-directories-and-files
|
1136
1247
|
*
|
1137
1248
|
* @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
|
1138
1249
|
* @param options - Options to Directory List Files and Directories Segment operation.
|
@@ -1143,8 +1254,18 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1143
1254
|
options.prefix = undefined;
|
1144
1255
|
}
|
1145
1256
|
return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
|
1146
|
-
const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(
|
1147
|
-
|
1257
|
+
const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment({
|
1258
|
+
...updatedOptions,
|
1259
|
+
marker,
|
1260
|
+
...this.shareClientConfig,
|
1261
|
+
}));
|
1262
|
+
const wrappedResponse = {
|
1263
|
+
...ConvertInternalResponseOfListFiles(rawResponse),
|
1264
|
+
_response: {
|
1265
|
+
...rawResponse._response,
|
1266
|
+
parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody),
|
1267
|
+
}, // _response is made non-enumerable
|
1268
|
+
};
|
1148
1269
|
return wrappedResponse;
|
1149
1270
|
});
|
1150
1271
|
}
|
@@ -1158,47 +1279,30 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1158
1279
|
* set of list items.
|
1159
1280
|
* @param options - Options to list handles operation.
|
1160
1281
|
*/
|
1161
|
-
iterateHandleSegments(
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
}
|
1171
|
-
});
|
1282
|
+
async *iterateHandleSegments(marker, options = {}) {
|
1283
|
+
let listHandlesResponse;
|
1284
|
+
if (!!marker || marker === undefined) {
|
1285
|
+
do {
|
1286
|
+
listHandlesResponse = await this.listHandlesSegment(marker, options);
|
1287
|
+
marker = listHandlesResponse.continuationToken;
|
1288
|
+
yield await listHandlesResponse;
|
1289
|
+
} while (marker);
|
1290
|
+
}
|
1172
1291
|
}
|
1173
1292
|
/**
|
1174
1293
|
* Returns an AsyncIterableIterator for handles
|
1175
1294
|
*
|
1176
1295
|
* @param options - Options to list handles operation.
|
1177
1296
|
*/
|
1178
|
-
listHandleItems() {
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
_c = _f.value;
|
1185
|
-
_d = false;
|
1186
|
-
const listHandlesResponse = _c;
|
1187
|
-
if (listHandlesResponse.handleList) {
|
1188
|
-
for (const handle of listHandlesResponse.handleList) {
|
1189
|
-
yield yield __await(handle);
|
1190
|
-
}
|
1191
|
-
}
|
1297
|
+
async *listHandleItems(options = {}) {
|
1298
|
+
let marker;
|
1299
|
+
for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
|
1300
|
+
if (listHandlesResponse.handleList) {
|
1301
|
+
for (const handle of listHandlesResponse.handleList) {
|
1302
|
+
yield handle;
|
1192
1303
|
}
|
1193
1304
|
}
|
1194
|
-
|
1195
|
-
finally {
|
1196
|
-
try {
|
1197
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
1198
|
-
}
|
1199
|
-
finally { if (e_2) throw e_2.error; }
|
1200
|
-
}
|
1201
|
-
});
|
1305
|
+
}
|
1202
1306
|
}
|
1203
1307
|
/**
|
1204
1308
|
* Returns an async iterable iterator to list all the handles.
|
@@ -1343,13 +1447,16 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1343
1447
|
* Return an AsyncIterableIterator that works a page at a time
|
1344
1448
|
*/
|
1345
1449
|
byPage: (settings = {}) => {
|
1346
|
-
return this.iterateHandleSegments(removeEmptyString(settings.continuationToken),
|
1450
|
+
return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {
|
1451
|
+
maxResults: settings.maxPageSize,
|
1452
|
+
...options,
|
1453
|
+
});
|
1347
1454
|
},
|
1348
1455
|
};
|
1349
1456
|
}
|
1350
1457
|
/**
|
1351
1458
|
* Lists handles for a directory.
|
1352
|
-
* @see https://learn.microsoft.com/
|
1459
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-handles
|
1353
1460
|
*
|
1354
1461
|
* @param marker - Optional. A string value that identifies the portion of the list to be
|
1355
1462
|
* returned with the next list handles operation. The operation returns a
|
@@ -1361,19 +1468,29 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1361
1468
|
async listHandlesSegment(marker, options = {}) {
|
1362
1469
|
return tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
|
1363
1470
|
marker = marker === "" ? undefined : marker;
|
1364
|
-
const response = assertResponse(await this.context.listHandles(
|
1471
|
+
const response = assertResponse(await this.context.listHandles({
|
1472
|
+
...updatedOptions,
|
1473
|
+
marker,
|
1474
|
+
...this.shareClientConfig,
|
1475
|
+
}));
|
1365
1476
|
// TODO: Protocol layer issue that when handle list is in returned XML
|
1366
1477
|
// response.handleList is an empty string
|
1367
1478
|
if (response.handleList === "") {
|
1368
1479
|
response.handleList = undefined;
|
1369
1480
|
}
|
1370
|
-
const wrappedResponse =
|
1481
|
+
const wrappedResponse = {
|
1482
|
+
...ConvertInternalResponseOfListHandles(response),
|
1483
|
+
_response: {
|
1484
|
+
...response._response,
|
1485
|
+
parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),
|
1486
|
+
},
|
1487
|
+
};
|
1371
1488
|
return wrappedResponse;
|
1372
1489
|
});
|
1373
1490
|
}
|
1374
1491
|
/**
|
1375
1492
|
* Force close all handles for a directory.
|
1376
|
-
* @see https://learn.microsoft.com/
|
1493
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/force-close-handles
|
1377
1494
|
*
|
1378
1495
|
* @param marker - Optional. A string value that identifies the position of handles that will
|
1379
1496
|
* be closed with the next force close handles operation.
|
@@ -1384,17 +1501,24 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1384
1501
|
*/
|
1385
1502
|
async forceCloseHandlesSegment(marker, options = {}) {
|
1386
1503
|
return tracingClient.withSpan("ShareDirectoryClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
|
1387
|
-
var _a, _b;
|
1388
1504
|
if (marker === "") {
|
1389
1505
|
marker = undefined;
|
1390
1506
|
}
|
1391
|
-
const rawResponse = assertResponse(await this.context.forceCloseHandles("*",
|
1392
|
-
|
1507
|
+
const rawResponse = assertResponse(await this.context.forceCloseHandles("*", {
|
1508
|
+
...updatedOptions,
|
1509
|
+
marker,
|
1510
|
+
...this.shareClientConfig,
|
1511
|
+
}));
|
1512
|
+
return {
|
1513
|
+
...rawResponse,
|
1514
|
+
closedHandlesCount: rawResponse.numberOfHandlesClosed ?? 0,
|
1515
|
+
closeFailureCount: rawResponse.numberOfHandlesFailedToClose ?? 0,
|
1516
|
+
};
|
1393
1517
|
});
|
1394
1518
|
}
|
1395
1519
|
/**
|
1396
1520
|
* Force close all handles for a directory.
|
1397
|
-
* @see https://learn.microsoft.com/
|
1521
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/force-close-handles
|
1398
1522
|
*
|
1399
1523
|
* @param options -
|
1400
1524
|
*/
|
@@ -1421,7 +1545,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1421
1545
|
}
|
1422
1546
|
/**
|
1423
1547
|
* Force close a specific handle for a directory.
|
1424
|
-
* @see https://learn.microsoft.com/
|
1548
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/force-close-handles
|
1425
1549
|
*
|
1426
1550
|
* @param aborter - Create a new Aborter instance with Aborter.none or Aborter.timeout(),
|
1427
1551
|
* goto documents of Aborter for more examples about request cancellation
|
@@ -1434,7 +1558,10 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1434
1558
|
if (handleId === "*") {
|
1435
1559
|
throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
|
1436
1560
|
}
|
1437
|
-
const rawResponse = await this.context.forceCloseHandles(handleId,
|
1561
|
+
const rawResponse = await this.context.forceCloseHandles(handleId, {
|
1562
|
+
...updatedOptions,
|
1563
|
+
...this.shareClientConfig,
|
1564
|
+
});
|
1438
1565
|
const response = rawResponse;
|
1439
1566
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
1440
1567
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -1490,15 +1617,20 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1490
1617
|
}
|
1491
1618
|
const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
|
1492
1619
|
return tracingClient.withSpan("ShareDirectoryClient-rename", options, async (updatedOptions) => {
|
1493
|
-
const response = assertResponse(await destDirectory.context.rename(this.url,
|
1620
|
+
const response = assertResponse(await destDirectory.context.rename(this.url, {
|
1621
|
+
...updatedOptions,
|
1622
|
+
sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
1494
1623
|
? {
|
1495
1624
|
sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
|
1496
1625
|
}
|
1497
|
-
: undefined,
|
1626
|
+
: undefined,
|
1627
|
+
destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
|
1498
1628
|
? {
|
1499
1629
|
destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
|
1500
1630
|
}
|
1501
|
-
: undefined
|
1631
|
+
: undefined,
|
1632
|
+
...this.shareClientConfig,
|
1633
|
+
}));
|
1502
1634
|
return {
|
1503
1635
|
destinationDirectoryClient: destDirectory,
|
1504
1636
|
directoryRenameResponse: response,
|
@@ -1510,6 +1642,14 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1510
1642
|
* A ShareFileClient represents a URL to an Azure Storage file.
|
1511
1643
|
*/
|
1512
1644
|
export class ShareFileClient extends StorageClient {
|
1645
|
+
/**
|
1646
|
+
* context provided by protocol layer.
|
1647
|
+
*/
|
1648
|
+
context;
|
1649
|
+
_shareName;
|
1650
|
+
_path;
|
1651
|
+
_name;
|
1652
|
+
shareClientConfig;
|
1513
1653
|
/**
|
1514
1654
|
* The share name corresponding to this file client
|
1515
1655
|
*/
|
@@ -1565,7 +1705,7 @@ export class ShareFileClient extends StorageClient {
|
|
1565
1705
|
}
|
1566
1706
|
/**
|
1567
1707
|
* Creates a new file or replaces a file. Note it only initializes the file with no content.
|
1568
|
-
* @see https://learn.microsoft.com/
|
1708
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-file
|
1569
1709
|
*
|
1570
1710
|
* @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
|
1571
1711
|
* @param options - Options to File Create operation.
|
@@ -1607,16 +1747,30 @@ export class ShareFileClient extends StorageClient {
|
|
1607
1747
|
options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
|
1608
1748
|
options.fileHttpHeaders = options.fileHttpHeaders || {};
|
1609
1749
|
return tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
|
1610
|
-
|
1611
|
-
|
1750
|
+
const rawResponse = await this.context.create(size, {
|
1751
|
+
...updatedOptions,
|
1752
|
+
fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
|
1753
|
+
fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
|
1754
|
+
fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
|
1755
|
+
fileAttributes: updatedOptions.fileAttributes
|
1612
1756
|
? fileAttributesToString(updatedOptions.fileAttributes)
|
1613
|
-
: undefined,
|
1614
|
-
|
1757
|
+
: undefined,
|
1758
|
+
owner: updatedOptions.posixProperties?.owner,
|
1759
|
+
group: updatedOptions.posixProperties?.group,
|
1760
|
+
fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
|
1761
|
+
nfsFileType: updatedOptions.posixProperties?.fileType,
|
1762
|
+
...this.shareClientConfig,
|
1763
|
+
});
|
1764
|
+
const wrappedRes = {
|
1765
|
+
...rawResponse,
|
1766
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
1767
|
+
posixProperties: {
|
1615
1768
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
1616
1769
|
fileType: rawResponse.nfsFileType,
|
1617
1770
|
owner: rawResponse.owner,
|
1618
1771
|
group: rawResponse.group,
|
1619
|
-
}
|
1772
|
+
},
|
1773
|
+
};
|
1620
1774
|
return assertResponse(wrappedRes);
|
1621
1775
|
});
|
1622
1776
|
}
|
@@ -1626,7 +1780,7 @@ export class ShareFileClient extends StorageClient {
|
|
1626
1780
|
* * In Node.js, data returns in a Readable stream `readableStreamBody`
|
1627
1781
|
* * In browsers, data returns in a promise `contentAsBlob`
|
1628
1782
|
*
|
1629
|
-
* @see https://learn.microsoft.com/
|
1783
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-file
|
1630
1784
|
*
|
1631
1785
|
* @param offset - From which position of the file to download, greater than or equal to 0
|
1632
1786
|
* @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
|
@@ -1706,15 +1860,24 @@ export class ShareFileClient extends StorageClient {
|
|
1706
1860
|
throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
|
1707
1861
|
}
|
1708
1862
|
const downloadFullFile = offset === 0 && !count;
|
1709
|
-
const rawResponse = await this.context.download(
|
1863
|
+
const rawResponse = await this.context.download({
|
1864
|
+
...updatedOptions,
|
1865
|
+
requestOptions: {
|
1710
1866
|
onDownloadProgress: isNodeLike ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
|
1711
|
-
},
|
1712
|
-
|
1867
|
+
},
|
1868
|
+
range: downloadFullFile ? undefined : rangeToString({ offset, count }),
|
1869
|
+
...this.shareClientConfig,
|
1870
|
+
});
|
1871
|
+
const res = assertResponse({
|
1872
|
+
...rawResponse,
|
1873
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
1874
|
+
posixProperties: {
|
1713
1875
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
1714
1876
|
owner: rawResponse.owner,
|
1715
1877
|
group: rawResponse.group,
|
1716
1878
|
linkCount: rawResponse.linkCount,
|
1717
|
-
}
|
1879
|
+
},
|
1880
|
+
});
|
1718
1881
|
// Return browser response immediately
|
1719
1882
|
if (!isNodeLike) {
|
1720
1883
|
return res;
|
@@ -1744,7 +1907,11 @@ export class ShareFileClient extends StorageClient {
|
|
1744
1907
|
// chunkDownloadOptions.range
|
1745
1908
|
// }, options: ${JSON.stringify(chunkDownloadOptions)}`
|
1746
1909
|
// );
|
1747
|
-
const downloadRes = await this.context.download(
|
1910
|
+
const downloadRes = await this.context.download({
|
1911
|
+
...updatedOptions,
|
1912
|
+
...updatedDownloadOptions,
|
1913
|
+
...this.shareClientConfig, // TODO: confirm whether this is needed
|
1914
|
+
});
|
1748
1915
|
if (!(downloadRes.etag === res.etag)) {
|
1749
1916
|
throw new Error("File has been modified concurrently");
|
1750
1917
|
}
|
@@ -1781,26 +1948,33 @@ export class ShareFileClient extends StorageClient {
|
|
1781
1948
|
/**
|
1782
1949
|
* Returns all user-defined metadata, standard HTTP properties, and system properties
|
1783
1950
|
* for the file. It does not return the content of the file.
|
1784
|
-
* @see https://learn.microsoft.com/
|
1951
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-file-properties
|
1785
1952
|
*
|
1786
1953
|
* @param options - Options to File Get Properties operation.
|
1787
1954
|
* @returns Response data for the File Get Properties operation.
|
1788
1955
|
*/
|
1789
1956
|
async getProperties(options = {}) {
|
1790
1957
|
return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
|
1791
|
-
const rawResponse = await this.context.getProperties(
|
1792
|
-
|
1958
|
+
const rawResponse = await this.context.getProperties({
|
1959
|
+
...updatedOptions,
|
1960
|
+
...this.shareClientConfig,
|
1961
|
+
});
|
1962
|
+
return assertResponse({
|
1963
|
+
...rawResponse,
|
1964
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
1965
|
+
posixProperties: {
|
1793
1966
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
1794
1967
|
fileType: rawResponse.nfsFileType,
|
1795
1968
|
owner: rawResponse.owner,
|
1796
1969
|
group: rawResponse.group,
|
1797
1970
|
linkCount: rawResponse.linkCount,
|
1798
|
-
}
|
1971
|
+
},
|
1972
|
+
});
|
1799
1973
|
});
|
1800
1974
|
}
|
1801
1975
|
/**
|
1802
1976
|
* Sets properties on the file.
|
1803
|
-
* @see https://learn.microsoft.com/
|
1977
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-file-properties
|
1804
1978
|
*
|
1805
1979
|
* @param properties - File properties. For file HTTP headers(e.g. Content-Type),
|
1806
1980
|
* if no values are provided, existing HTTP headers will be removed.
|
@@ -1811,16 +1985,29 @@ export class ShareFileClient extends StorageClient {
|
|
1811
1985
|
properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
|
1812
1986
|
properties.fileHttpHeaders = properties.fileHttpHeaders || {};
|
1813
1987
|
return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
|
1814
|
-
|
1815
|
-
|
1988
|
+
const rawResponse = await this.context.setHttpHeaders({
|
1989
|
+
...updatedOptions,
|
1990
|
+
fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
|
1991
|
+
fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
|
1992
|
+
fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
|
1993
|
+
fileAttributes: updatedOptions.fileAttributes
|
1816
1994
|
? fileAttributesToString(updatedOptions.fileAttributes)
|
1817
|
-
: undefined,
|
1818
|
-
|
1995
|
+
: undefined,
|
1996
|
+
owner: updatedOptions.posixProperties?.owner,
|
1997
|
+
group: updatedOptions.posixProperties?.group,
|
1998
|
+
fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
|
1999
|
+
...this.shareClientConfig,
|
2000
|
+
});
|
2001
|
+
return assertResponse({
|
2002
|
+
...rawResponse,
|
2003
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
2004
|
+
posixProperties: {
|
1819
2005
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
1820
2006
|
owner: rawResponse.owner,
|
1821
2007
|
group: rawResponse.group,
|
1822
2008
|
linkCount: rawResponse.linkCount,
|
1823
|
-
}
|
2009
|
+
},
|
2010
|
+
});
|
1824
2011
|
});
|
1825
2012
|
}
|
1826
2013
|
/**
|
@@ -1835,14 +2022,14 @@ export class ShareFileClient extends StorageClient {
|
|
1835
2022
|
* Delete File is not supported on a share snapshot, which is a read-only copy of
|
1836
2023
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
|
1837
2024
|
*
|
1838
|
-
* @see https://learn.microsoft.com/
|
2025
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-file2
|
1839
2026
|
*
|
1840
2027
|
* @param options - Options to File Delete operation.
|
1841
2028
|
* @returns Response data for the File Delete operation.
|
1842
2029
|
*/
|
1843
2030
|
async delete(options = {}) {
|
1844
2031
|
return tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
|
1845
|
-
return assertResponse(await this.context.delete(
|
2032
|
+
return assertResponse(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
|
1846
2033
|
});
|
1847
2034
|
}
|
1848
2035
|
/**
|
@@ -1857,21 +2044,27 @@ export class ShareFileClient extends StorageClient {
|
|
1857
2044
|
* Delete File is not supported on a share snapshot, which is a read-only copy of
|
1858
2045
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
|
1859
2046
|
*
|
1860
|
-
* @see https://learn.microsoft.com/
|
2047
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-file2
|
1861
2048
|
*
|
1862
2049
|
* @param options -
|
1863
2050
|
*/
|
1864
2051
|
async deleteIfExists(options = {}) {
|
1865
2052
|
return tracingClient.withSpan("ShareFileClient-deleteIfExists", options, async (updatedOptions) => {
|
1866
|
-
var _a, _b, _c;
|
1867
2053
|
try {
|
1868
2054
|
const res = await this.delete(updatedOptions);
|
1869
|
-
return
|
2055
|
+
return {
|
2056
|
+
succeeded: true,
|
2057
|
+
...res,
|
2058
|
+
};
|
1870
2059
|
}
|
1871
2060
|
catch (e) {
|
1872
|
-
if (
|
1873
|
-
|
1874
|
-
return
|
2061
|
+
if (e.details?.errorCode === "ResourceNotFound" ||
|
2062
|
+
e.details?.errorCode === "ParentNotFound") {
|
2063
|
+
return {
|
2064
|
+
succeeded: false,
|
2065
|
+
...e.response?.parsedHeaders,
|
2066
|
+
_response: e.response,
|
2067
|
+
};
|
1875
2068
|
}
|
1876
2069
|
throw e;
|
1877
2070
|
}
|
@@ -1882,7 +2075,7 @@ export class ShareFileClient extends StorageClient {
|
|
1882
2075
|
*
|
1883
2076
|
* If no option provided, or no value provided for the file HTTP headers in the options,
|
1884
2077
|
* these file HTTP headers without a value will be cleared.
|
1885
|
-
* @see https://learn.microsoft.com/
|
2078
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-file-properties
|
1886
2079
|
*
|
1887
2080
|
* @param FileHttpHeaders - File HTTP headers like Content-Type.
|
1888
2081
|
* Provide undefined will remove existing HTTP headers.
|
@@ -1893,22 +2086,36 @@ export class ShareFileClient extends StorageClient {
|
|
1893
2086
|
// FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
|
1894
2087
|
options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
|
1895
2088
|
return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
|
1896
|
-
|
1897
|
-
|
2089
|
+
const rawResponse = await this.context.setHttpHeaders({
|
2090
|
+
...updatedOptions,
|
2091
|
+
fileHttpHeaders,
|
2092
|
+
fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
|
2093
|
+
fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
|
2094
|
+
fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
|
2095
|
+
fileAttributes: updatedOptions.fileAttributes
|
1898
2096
|
? fileAttributesToString(updatedOptions.fileAttributes)
|
1899
|
-
: undefined,
|
1900
|
-
|
2097
|
+
: undefined,
|
2098
|
+
owner: updatedOptions.posixProperties?.owner,
|
2099
|
+
group: updatedOptions.posixProperties?.group,
|
2100
|
+
fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
|
2101
|
+
...this.shareClientConfig,
|
2102
|
+
});
|
2103
|
+
return assertResponse({
|
2104
|
+
...rawResponse,
|
2105
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
2106
|
+
posixProperties: {
|
1901
2107
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
1902
2108
|
owner: rawResponse.owner,
|
1903
2109
|
group: rawResponse.group,
|
1904
2110
|
linkCount: rawResponse.linkCount,
|
1905
|
-
}
|
2111
|
+
},
|
2112
|
+
});
|
1906
2113
|
});
|
1907
2114
|
}
|
1908
2115
|
/**
|
1909
2116
|
* Resize file.
|
1910
2117
|
*
|
1911
|
-
* @see https://learn.microsoft.com/
|
2118
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-file-properties
|
1912
2119
|
*
|
1913
2120
|
* @param length - Resizes a file to the specified size in bytes.
|
1914
2121
|
* If the specified byte value is less than the current size of the file,
|
@@ -1923,14 +2130,28 @@ export class ShareFileClient extends StorageClient {
|
|
1923
2130
|
// FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
|
1924
2131
|
options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
|
1925
2132
|
return tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
2133
|
+
const rawResponse = await this.context.setHttpHeaders({
|
2134
|
+
...updatedOptions,
|
2135
|
+
fileContentLength: length,
|
2136
|
+
fileChangeOn: fileChangeTimeToString(options.changeTime),
|
2137
|
+
fileCreatedOn: fileCreationTimeToString(options.creationTime),
|
2138
|
+
fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime),
|
2139
|
+
fileAttributes: fileAttributesToString(updatedOptions.fileAttributes),
|
2140
|
+
owner: updatedOptions.posixProperties?.owner,
|
2141
|
+
group: updatedOptions.posixProperties?.group,
|
2142
|
+
fileMode: toOctalFileMode(options.posixProperties?.fileMode),
|
2143
|
+
...this.shareClientConfig,
|
2144
|
+
});
|
2145
|
+
return assertResponse({
|
2146
|
+
...rawResponse,
|
2147
|
+
_response: rawResponse._response,
|
2148
|
+
posixProperties: {
|
1929
2149
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
1930
2150
|
owner: rawResponse.owner,
|
1931
2151
|
group: rawResponse.group,
|
1932
2152
|
linkCount: rawResponse.linkCount,
|
1933
|
-
}
|
2153
|
+
},
|
2154
|
+
});
|
1934
2155
|
});
|
1935
2156
|
}
|
1936
2157
|
/**
|
@@ -1938,7 +2159,7 @@ export class ShareFileClient extends StorageClient {
|
|
1938
2159
|
*
|
1939
2160
|
* If no metadata defined in the option parameter, the file
|
1940
2161
|
* metadata will be removed.
|
1941
|
-
* @see https://learn.microsoft.com/
|
2162
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-file-metadata
|
1942
2163
|
*
|
1943
2164
|
* @param metadata - If no metadata provided, all existing directory metadata will be removed
|
1944
2165
|
* @param options - Options to File Set Metadata operation.
|
@@ -1946,7 +2167,11 @@ export class ShareFileClient extends StorageClient {
|
|
1946
2167
|
*/
|
1947
2168
|
async setMetadata(metadata = {}, options = {}) {
|
1948
2169
|
return tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
|
1949
|
-
return assertResponse(await this.context.setMetadata(
|
2170
|
+
return assertResponse(await this.context.setMetadata({
|
2171
|
+
...updatedOptions,
|
2172
|
+
metadata,
|
2173
|
+
...this.shareClientConfig,
|
2174
|
+
}));
|
1950
2175
|
});
|
1951
2176
|
}
|
1952
2177
|
/**
|
@@ -2002,9 +2227,14 @@ export class ShareFileClient extends StorageClient {
|
|
2002
2227
|
if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
|
2003
2228
|
throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
|
2004
2229
|
}
|
2005
|
-
return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength,
|
2230
|
+
return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, {
|
2231
|
+
...updatedOptions,
|
2232
|
+
requestOptions: {
|
2006
2233
|
onUploadProgress: updatedOptions.onProgress,
|
2007
|
-
},
|
2234
|
+
},
|
2235
|
+
body,
|
2236
|
+
...this.shareClientConfig,
|
2237
|
+
}));
|
2008
2238
|
});
|
2009
2239
|
}
|
2010
2240
|
/**
|
@@ -2025,7 +2255,13 @@ export class ShareFileClient extends StorageClient {
|
|
2025
2255
|
if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
|
2026
2256
|
throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
|
2027
2257
|
}
|
2028
|
-
return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0,
|
2258
|
+
return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, {
|
2259
|
+
...updatedOptions,
|
2260
|
+
sourceRange: rangeToString({ offset: sourceOffset, count }),
|
2261
|
+
sourceModifiedAccessConditions: updatedOptions.sourceConditions,
|
2262
|
+
copySourceAuthorization: httpAuthorizationToString(updatedOptions.sourceAuthorization),
|
2263
|
+
...this.shareClientConfig,
|
2264
|
+
}));
|
2029
2265
|
});
|
2030
2266
|
}
|
2031
2267
|
/**
|
@@ -2041,7 +2277,7 @@ export class ShareFileClient extends StorageClient {
|
|
2041
2277
|
if (offset < 0 || contentLength <= 0) {
|
2042
2278
|
throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
|
2043
2279
|
}
|
2044
|
-
return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0,
|
2280
|
+
return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, { ...updatedOptions, ...this.shareClientConfig }));
|
2045
2281
|
});
|
2046
2282
|
}
|
2047
2283
|
/**
|
@@ -2051,12 +2287,20 @@ export class ShareFileClient extends StorageClient {
|
|
2051
2287
|
*/
|
2052
2288
|
async getRangeList(options = {}) {
|
2053
2289
|
return tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
|
2054
|
-
const originalResponse = assertResponse(await this.context.getRangeList(
|
2290
|
+
const originalResponse = assertResponse(await this.context.getRangeList({
|
2291
|
+
...updatedOptions,
|
2292
|
+
range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,
|
2293
|
+
...this.shareClientConfig,
|
2294
|
+
}));
|
2055
2295
|
// Only returns ranges, ignoring clearRanges.
|
2056
2296
|
const parsedBody = originalResponse._response.parsedBody.ranges
|
2057
2297
|
? originalResponse._response.parsedBody.ranges
|
2058
2298
|
: [];
|
2059
|
-
return
|
2299
|
+
return {
|
2300
|
+
...originalResponse,
|
2301
|
+
_response: { ...originalResponse._response, parsedBody },
|
2302
|
+
rangeList: originalResponse.ranges ? originalResponse.ranges : [],
|
2303
|
+
};
|
2060
2304
|
});
|
2061
2305
|
}
|
2062
2306
|
/**
|
@@ -2067,7 +2311,13 @@ export class ShareFileClient extends StorageClient {
|
|
2067
2311
|
*/
|
2068
2312
|
async getRangeListDiff(prevShareSnapshot, options = {}) {
|
2069
2313
|
return tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
|
2070
|
-
return assertResponse(await this.context.getRangeList(
|
2314
|
+
return assertResponse(await this.context.getRangeList({
|
2315
|
+
...updatedOptions,
|
2316
|
+
prevsharesnapshot: prevShareSnapshot,
|
2317
|
+
supportRename: options.includeRenames,
|
2318
|
+
range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,
|
2319
|
+
...this.shareClientConfig,
|
2320
|
+
}));
|
2071
2321
|
});
|
2072
2322
|
}
|
2073
2323
|
/**
|
@@ -2084,21 +2334,28 @@ export class ShareFileClient extends StorageClient {
|
|
2084
2334
|
*/
|
2085
2335
|
async startCopyFromURL(copySource, options = {}) {
|
2086
2336
|
return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
|
2087
|
-
|
2088
|
-
|
2337
|
+
return assertResponse(await this.context.startCopy(copySource, {
|
2338
|
+
...updatedOptions,
|
2339
|
+
...this.shareClientConfig,
|
2340
|
+
owner: updatedOptions.posixProperties?.owner,
|
2341
|
+
group: updatedOptions.posixProperties?.group,
|
2342
|
+
fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
|
2343
|
+
fileModeCopyMode: updatedOptions.fileModeCopyMode,
|
2344
|
+
fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode,
|
2345
|
+
}));
|
2089
2346
|
});
|
2090
2347
|
}
|
2091
2348
|
/**
|
2092
2349
|
* Aborts a pending Copy File operation, and leaves a destination file with zero length and full
|
2093
2350
|
* metadata.
|
2094
|
-
* @see https://learn.microsoft.com/
|
2351
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/abort-copy-file
|
2095
2352
|
*
|
2096
2353
|
* @param copyId - Id of the Copy File operation to abort.
|
2097
2354
|
* @param options - Options to File Abort Copy From URL operation.
|
2098
2355
|
*/
|
2099
2356
|
async abortCopyFromURL(copyId, options = {}) {
|
2100
2357
|
return tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
|
2101
|
-
return assertResponse(await this.context.abortCopy(copyId,
|
2358
|
+
return assertResponse(await this.context.abortCopy(copyId, { ...updatedOptions, ...this.shareClientConfig }));
|
2102
2359
|
});
|
2103
2360
|
}
|
2104
2361
|
// High Level functions
|
@@ -2424,7 +2681,7 @@ export class ShareFileClient extends StorageClient {
|
|
2424
2681
|
}
|
2425
2682
|
/**
|
2426
2683
|
* Lists handles for a file.
|
2427
|
-
* @see https://learn.microsoft.com/
|
2684
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-handles
|
2428
2685
|
*
|
2429
2686
|
* @param marker - Optional. A string value that identifies the portion of the list to be
|
2430
2687
|
* returned with the next list handles operation. The operation returns a
|
@@ -2436,13 +2693,23 @@ export class ShareFileClient extends StorageClient {
|
|
2436
2693
|
async listHandlesSegment(marker, options = {}) {
|
2437
2694
|
return tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
|
2438
2695
|
marker = marker === "" ? undefined : marker;
|
2439
|
-
const response = assertResponse(await this.context.listHandles(
|
2696
|
+
const response = assertResponse(await this.context.listHandles({
|
2697
|
+
...updatedOptions,
|
2698
|
+
...this.shareClientConfig,
|
2699
|
+
marker,
|
2700
|
+
}));
|
2440
2701
|
// TODO: Protocol layer issue that when handle list is in returned XML
|
2441
2702
|
// response.handleList is an empty string
|
2442
2703
|
if (response.handleList === "") {
|
2443
2704
|
response.handleList = undefined;
|
2444
2705
|
}
|
2445
|
-
const wrappedResponse =
|
2706
|
+
const wrappedResponse = {
|
2707
|
+
...ConvertInternalResponseOfListHandles(response),
|
2708
|
+
_response: {
|
2709
|
+
...response._response,
|
2710
|
+
parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),
|
2711
|
+
},
|
2712
|
+
};
|
2446
2713
|
return wrappedResponse;
|
2447
2714
|
});
|
2448
2715
|
}
|
@@ -2456,47 +2723,30 @@ export class ShareFileClient extends StorageClient {
|
|
2456
2723
|
* set of list items.
|
2457
2724
|
* @param options - Options to list handles operation.
|
2458
2725
|
*/
|
2459
|
-
iterateHandleSegments(
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
2464
|
-
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2468
|
-
}
|
2469
|
-
});
|
2726
|
+
async *iterateHandleSegments(marker, options = {}) {
|
2727
|
+
let listHandlesResponse;
|
2728
|
+
if (!!marker || marker === undefined) {
|
2729
|
+
do {
|
2730
|
+
listHandlesResponse = await this.listHandlesSegment(marker, options);
|
2731
|
+
marker = listHandlesResponse.continuationToken;
|
2732
|
+
yield listHandlesResponse;
|
2733
|
+
} while (marker);
|
2734
|
+
}
|
2470
2735
|
}
|
2471
2736
|
/**
|
2472
2737
|
* Returns an AsyncIterableIterator for handles
|
2473
2738
|
*
|
2474
2739
|
* @param options - Options to list handles operation.
|
2475
2740
|
*/
|
2476
|
-
listHandleItems() {
|
2477
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
_c = _f.value;
|
2483
|
-
_d = false;
|
2484
|
-
const listHandlesResponse = _c;
|
2485
|
-
if (listHandlesResponse.handleList) {
|
2486
|
-
for (const handle of listHandlesResponse.handleList) {
|
2487
|
-
yield yield __await(handle);
|
2488
|
-
}
|
2489
|
-
}
|
2741
|
+
async *listHandleItems(options = {}) {
|
2742
|
+
let marker;
|
2743
|
+
for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
|
2744
|
+
if (listHandlesResponse.handleList) {
|
2745
|
+
for (const handle of listHandlesResponse.handleList) {
|
2746
|
+
yield handle;
|
2490
2747
|
}
|
2491
2748
|
}
|
2492
|
-
|
2493
|
-
finally {
|
2494
|
-
try {
|
2495
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
2496
|
-
}
|
2497
|
-
finally { if (e_3) throw e_3.error; }
|
2498
|
-
}
|
2499
|
-
});
|
2749
|
+
}
|
2500
2750
|
}
|
2501
2751
|
/**
|
2502
2752
|
* Returns an async iterable iterator to list all the handles.
|
@@ -2528,13 +2778,16 @@ export class ShareFileClient extends StorageClient {
|
|
2528
2778
|
* Return an AsyncIterableIterator that works a page at a time
|
2529
2779
|
*/
|
2530
2780
|
byPage: (settings = {}) => {
|
2531
|
-
return this.iterateHandleSegments(removeEmptyString(settings.continuationToken),
|
2781
|
+
return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {
|
2782
|
+
maxPageSize: settings.maxPageSize,
|
2783
|
+
...options,
|
2784
|
+
});
|
2532
2785
|
},
|
2533
2786
|
};
|
2534
2787
|
}
|
2535
2788
|
/**
|
2536
2789
|
* Force close all handles for a file.
|
2537
|
-
* @see https://learn.microsoft.com/
|
2790
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/force-close-handles
|
2538
2791
|
*
|
2539
2792
|
* @param marker - Optional. A string value that identifies the position of handles that will
|
2540
2793
|
* be closed with the next force close handles operation.
|
@@ -2546,7 +2799,11 @@ export class ShareFileClient extends StorageClient {
|
|
2546
2799
|
async forceCloseHandlesSegment(marker, options = {}) {
|
2547
2800
|
return tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
|
2548
2801
|
marker = marker === "" ? undefined : marker;
|
2549
|
-
const rawResponse = await this.context.forceCloseHandles("*",
|
2802
|
+
const rawResponse = await this.context.forceCloseHandles("*", {
|
2803
|
+
...updatedOptions,
|
2804
|
+
...this.shareClientConfig,
|
2805
|
+
marker,
|
2806
|
+
});
|
2550
2807
|
const response = rawResponse;
|
2551
2808
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
2552
2809
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -2555,7 +2812,7 @@ export class ShareFileClient extends StorageClient {
|
|
2555
2812
|
}
|
2556
2813
|
/**
|
2557
2814
|
* Force close all handles for a file.
|
2558
|
-
* @see https://learn.microsoft.com/
|
2815
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/force-close-handles
|
2559
2816
|
*
|
2560
2817
|
* @param options - Options to force close handles operation.
|
2561
2818
|
*/
|
@@ -2582,7 +2839,7 @@ export class ShareFileClient extends StorageClient {
|
|
2582
2839
|
}
|
2583
2840
|
/**
|
2584
2841
|
* Force close a specific handle for a file.
|
2585
|
-
* @see https://learn.microsoft.com/
|
2842
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/force-close-handles
|
2586
2843
|
*
|
2587
2844
|
* @param handleId - Specific handle ID, cannot be asterisk "*".
|
2588
2845
|
* Use forceCloseAllHandles() to close all handles.
|
@@ -2593,7 +2850,10 @@ export class ShareFileClient extends StorageClient {
|
|
2593
2850
|
if (handleId === "*") {
|
2594
2851
|
throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
|
2595
2852
|
}
|
2596
|
-
const rawResponse = await this.context.forceCloseHandles(handleId,
|
2853
|
+
const rawResponse = await this.context.forceCloseHandles(handleId, {
|
2854
|
+
...updatedOptions,
|
2855
|
+
...this.shareClientConfig,
|
2856
|
+
});
|
2597
2857
|
const response = rawResponse;
|
2598
2858
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
2599
2859
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -2608,14 +2868,21 @@ export class ShareFileClient extends StorageClient {
|
|
2608
2868
|
*/
|
2609
2869
|
async createHardLink(targetFile, options = {}) {
|
2610
2870
|
return tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
|
2611
|
-
const rawResponse = await this.context.createHardLink(targetFile,
|
2612
|
-
|
2871
|
+
const rawResponse = await this.context.createHardLink(targetFile, {
|
2872
|
+
...updatedOptions,
|
2873
|
+
...this.shareClientConfig,
|
2874
|
+
});
|
2875
|
+
return assertResponse({
|
2876
|
+
...rawResponse,
|
2877
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
2878
|
+
posixProperties: {
|
2613
2879
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
2614
2880
|
fileType: rawResponse.nfsFileType,
|
2615
2881
|
owner: rawResponse.owner,
|
2616
2882
|
group: rawResponse.group,
|
2617
2883
|
linkCount: rawResponse.linkCount,
|
2618
|
-
}
|
2884
|
+
},
|
2885
|
+
});
|
2619
2886
|
});
|
2620
2887
|
}
|
2621
2888
|
/**
|
@@ -2627,13 +2894,20 @@ export class ShareFileClient extends StorageClient {
|
|
2627
2894
|
*/
|
2628
2895
|
async createSymbolicLink(linkText, options = {}) {
|
2629
2896
|
return tracingClient.withSpan("ShareFileClient-createSymbolicLink", options, async (updatedOptions) => {
|
2630
|
-
const rawResponse = await this.context.createSymbolicLink(linkText,
|
2631
|
-
|
2897
|
+
const rawResponse = await this.context.createSymbolicLink(linkText, {
|
2898
|
+
...updatedOptions,
|
2899
|
+
...this.shareClientConfig,
|
2900
|
+
});
|
2901
|
+
return assertResponse({
|
2902
|
+
...rawResponse,
|
2903
|
+
_response: rawResponse._response, // _response is made non-enumerable,
|
2904
|
+
posixProperties: {
|
2632
2905
|
fileMode: parseOctalFileMode(rawResponse.fileMode),
|
2633
2906
|
owner: rawResponse.owner,
|
2634
2907
|
group: rawResponse.group,
|
2635
2908
|
fileType: rawResponse.nfsFileType,
|
2636
|
-
}
|
2909
|
+
},
|
2910
|
+
});
|
2637
2911
|
});
|
2638
2912
|
}
|
2639
2913
|
/**
|
@@ -2642,7 +2916,10 @@ export class ShareFileClient extends StorageClient {
|
|
2642
2916
|
*/
|
2643
2917
|
async getSymbolicLink(options = {}) {
|
2644
2918
|
return tracingClient.withSpan("ShareFileClient-getSymbolicLink", options, async (updatedOptions) => {
|
2645
|
-
return assertResponse(await this.context.getSymbolicLink(
|
2919
|
+
return assertResponse(await this.context.getSymbolicLink({
|
2920
|
+
...updatedOptions,
|
2921
|
+
...this.shareClientConfig,
|
2922
|
+
}));
|
2646
2923
|
});
|
2647
2924
|
}
|
2648
2925
|
/**
|
@@ -2660,7 +2937,7 @@ export class ShareFileClient extends StorageClient {
|
|
2660
2937
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
2661
2938
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
2662
2939
|
*
|
2663
|
-
* @see https://learn.microsoft.com/
|
2940
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
2664
2941
|
*
|
2665
2942
|
* @param options - Optional parameters.
|
2666
2943
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -2669,7 +2946,11 @@ export class ShareFileClient extends StorageClient {
|
|
2669
2946
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
2670
2947
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
2671
2948
|
}
|
2672
|
-
const sas = generateFileSASQueryParameters(
|
2949
|
+
const sas = generateFileSASQueryParameters({
|
2950
|
+
shareName: this.shareName,
|
2951
|
+
filePath: this.path,
|
2952
|
+
...options,
|
2953
|
+
}, this.credential).toString();
|
2673
2954
|
return appendToURLQuery(this.url, sas);
|
2674
2955
|
}
|
2675
2956
|
/**
|
@@ -2678,7 +2959,7 @@ export class ShareFileClient extends StorageClient {
|
|
2678
2959
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
2679
2960
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
2680
2961
|
*
|
2681
|
-
* @see https://learn.microsoft.com/
|
2962
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
2682
2963
|
*
|
2683
2964
|
* @param options - Optional parameters.
|
2684
2965
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -2688,7 +2969,11 @@ export class ShareFileClient extends StorageClient {
|
|
2688
2969
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
2689
2970
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
2690
2971
|
}
|
2691
|
-
return generateFileSASQueryParametersInternal(
|
2972
|
+
return generateFileSASQueryParametersInternal({
|
2973
|
+
shareName: this.shareName,
|
2974
|
+
filePath: this.path,
|
2975
|
+
...options,
|
2976
|
+
}, this.credential).stringToSign;
|
2692
2977
|
}
|
2693
2978
|
/**
|
2694
2979
|
* Renames a file.
|
@@ -2743,19 +3028,25 @@ export class ShareFileClient extends StorageClient {
|
|
2743
3028
|
}
|
2744
3029
|
const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
|
2745
3030
|
return tracingClient.withSpan("ShareFileClient-rename", options, async (updatedOptions) => {
|
2746
|
-
const response = assertResponse(await destFile.context.rename(this.url,
|
3031
|
+
const response = assertResponse(await destFile.context.rename(this.url, {
|
3032
|
+
...updatedOptions,
|
3033
|
+
sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
2747
3034
|
? {
|
2748
3035
|
sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
|
2749
3036
|
}
|
2750
|
-
: undefined,
|
3037
|
+
: undefined,
|
3038
|
+
destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
|
2751
3039
|
? {
|
2752
3040
|
destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
|
2753
3041
|
}
|
2754
|
-
: undefined,
|
3042
|
+
: undefined,
|
3043
|
+
fileHttpHeaders: options.contentType
|
2755
3044
|
? {
|
2756
3045
|
fileContentType: options.contentType,
|
2757
3046
|
}
|
2758
|
-
: undefined
|
3047
|
+
: undefined,
|
3048
|
+
...this.shareClientConfig,
|
3049
|
+
}));
|
2759
3050
|
return {
|
2760
3051
|
destinationFileClient: destFile,
|
2761
3052
|
fileRenameResponse: response,
|
@@ -2770,6 +3061,10 @@ export class ShareFileClient extends StorageClient {
|
|
2770
3061
|
* @see https://learn.microsoft.com/rest/api/storageservices/lease-share
|
2771
3062
|
*/
|
2772
3063
|
export class ShareLeaseClient {
|
3064
|
+
_leaseId;
|
3065
|
+
_url;
|
3066
|
+
fileOrShare;
|
3067
|
+
shareClientConfig;
|
2773
3068
|
/**
|
2774
3069
|
* Gets the lease Id.
|
2775
3070
|
*
|
@@ -2816,7 +3111,12 @@ export class ShareLeaseClient {
|
|
2816
3111
|
*/
|
2817
3112
|
async acquireLease(duration = -1, options = {}) {
|
2818
3113
|
return tracingClient.withSpan("ShareLeaseClient-acquireLease", options, async (updatedOptions) => {
|
2819
|
-
return assertResponse(await this.fileOrShare.acquireLease(
|
3114
|
+
return assertResponse(await this.fileOrShare.acquireLease({
|
3115
|
+
...updatedOptions,
|
3116
|
+
...this.shareClientConfig,
|
3117
|
+
duration,
|
3118
|
+
proposedLeaseId: this._leaseId,
|
3119
|
+
}));
|
2820
3120
|
});
|
2821
3121
|
}
|
2822
3122
|
/**
|
@@ -2828,7 +3128,11 @@ export class ShareLeaseClient {
|
|
2828
3128
|
*/
|
2829
3129
|
async changeLease(proposedLeaseId, options = {}) {
|
2830
3130
|
return tracingClient.withSpan("ShareLeaseClient-changeLease", options, async (updatedOptions) => {
|
2831
|
-
const response = assertResponse(await this.fileOrShare.changeLease(this._leaseId,
|
3131
|
+
const response = assertResponse(await this.fileOrShare.changeLease(this._leaseId, {
|
3132
|
+
...updatedOptions,
|
3133
|
+
...this.shareClientConfig,
|
3134
|
+
proposedLeaseId,
|
3135
|
+
}));
|
2832
3136
|
this._leaseId = proposedLeaseId;
|
2833
3137
|
return response;
|
2834
3138
|
});
|
@@ -2842,7 +3146,10 @@ export class ShareLeaseClient {
|
|
2842
3146
|
*/
|
2843
3147
|
async releaseLease(options = {}) {
|
2844
3148
|
return tracingClient.withSpan("ShareLeaseClient-releaseLease", options, async (updatedOptions) => {
|
2845
|
-
return assertResponse(await this.fileOrShare.releaseLease(this._leaseId,
|
3149
|
+
return assertResponse(await this.fileOrShare.releaseLease(this._leaseId, {
|
3150
|
+
...updatedOptions,
|
3151
|
+
...this.shareClientConfig,
|
3152
|
+
}));
|
2846
3153
|
});
|
2847
3154
|
}
|
2848
3155
|
/**
|
@@ -2853,7 +3160,10 @@ export class ShareLeaseClient {
|
|
2853
3160
|
*/
|
2854
3161
|
async breakLease(options = {}) {
|
2855
3162
|
return tracingClient.withSpan("ShareLeaseClient-breakLease", options, async (updatedOptions) => {
|
2856
|
-
return assertResponse(await this.fileOrShare.breakLease(
|
3163
|
+
return assertResponse(await this.fileOrShare.breakLease({
|
3164
|
+
...updatedOptions,
|
3165
|
+
...this.shareClientConfig,
|
3166
|
+
}));
|
2857
3167
|
});
|
2858
3168
|
}
|
2859
3169
|
/**
|
@@ -2869,7 +3179,10 @@ export class ShareLeaseClient {
|
|
2869
3179
|
if (isFile(this.fileOrShare)) {
|
2870
3180
|
throw new RangeError("The renewLease operation is not available for lease on file.");
|
2871
3181
|
}
|
2872
|
-
return assertResponse(await this.fileOrShare.renewLease(this._leaseId,
|
3182
|
+
return assertResponse(await this.fileOrShare.renewLease(this._leaseId, {
|
3183
|
+
...updatedOptions,
|
3184
|
+
...this.shareClientConfig,
|
3185
|
+
}));
|
2873
3186
|
});
|
2874
3187
|
}
|
2875
3188
|
}
|