@azure/storage-common 12.0.0-alpha.20250617.1 → 12.0.0-alpha.20250717.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/StorageBrowserPolicyFactory.d.ts +16 -0
- package/dist/browser/StorageBrowserPolicyFactory.d.ts.map +1 -0
- package/dist/browser/StorageBrowserPolicyFactory.js +19 -0
- package/dist/browser/StorageBrowserPolicyFactory.js.map +1 -0
- package/dist/browser/StorageRetryPolicyFactory.d.ts +66 -0
- package/dist/browser/StorageRetryPolicyFactory.d.ts.map +1 -0
- package/dist/browser/StorageRetryPolicyFactory.js +27 -0
- package/dist/browser/StorageRetryPolicyFactory.js.map +1 -0
- package/dist/browser/credentials/AnonymousCredential.d.ts +19 -0
- package/dist/browser/credentials/AnonymousCredential.d.ts.map +1 -0
- package/dist/browser/credentials/AnonymousCredential.js +22 -0
- package/dist/browser/credentials/AnonymousCredential.js.map +1 -0
- package/dist/browser/credentials/Credential.d.ts +20 -0
- package/dist/browser/credentials/Credential.d.ts.map +1 -0
- package/dist/browser/credentials/Credential.js +18 -0
- package/dist/browser/credentials/Credential.js.map +1 -0
- package/dist/browser/credentials/StorageSharedKeyCredential-browser.d.mts.map +1 -0
- package/dist/browser/credentials/StorageSharedKeyCredential-browser.mjs.map +1 -0
- package/dist/browser/credentials/StorageSharedKeyCredential.d.ts +3 -0
- package/dist/browser/credentials/StorageSharedKeyCredential.js +5 -0
- package/dist/browser/index-browser.d.mts.map +1 -0
- package/dist/browser/index-browser.mjs.map +1 -0
- package/dist/browser/index.d.ts +17 -1
- package/dist/browser/index.js +17 -1
- package/dist/browser/log.d.ts +5 -0
- package/dist/browser/log.d.ts.map +1 -0
- package/dist/browser/log.js +8 -0
- package/dist/browser/log.js.map +1 -0
- package/dist/browser/policies/AnonymousCredentialPolicy.d.ts +15 -0
- package/dist/browser/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
- package/dist/browser/policies/AnonymousCredentialPolicy.js +20 -0
- package/dist/browser/policies/AnonymousCredentialPolicy.js.map +1 -0
- package/dist/browser/policies/CredentialPolicy.d.ts +22 -0
- package/dist/browser/policies/CredentialPolicy.d.ts.map +1 -0
- package/dist/browser/policies/CredentialPolicy.js +29 -0
- package/dist/browser/policies/CredentialPolicy.js.map +1 -0
- package/dist/browser/policies/RequestPolicy.d.ts +45 -0
- package/dist/browser/policies/RequestPolicy.d.ts.map +1 -0
- package/dist/browser/policies/RequestPolicy.js +40 -0
- package/dist/browser/policies/RequestPolicy.js.map +1 -0
- package/dist/browser/policies/StorageBrowserPolicy.d.ts +28 -0
- package/dist/browser/policies/StorageBrowserPolicy.d.ts.map +1 -0
- package/dist/browser/policies/StorageBrowserPolicy.js +47 -0
- package/dist/browser/policies/StorageBrowserPolicy.js.map +1 -0
- package/dist/browser/policies/StorageBrowserPolicyV2.d.ts +11 -0
- package/dist/browser/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
- package/dist/browser/policies/StorageBrowserPolicyV2.js +31 -0
- package/dist/browser/policies/StorageBrowserPolicyV2.js.map +1 -0
- package/dist/browser/policies/StorageCorrectContentLengthPolicy-browser.d.mts.map +1 -0
- package/dist/browser/policies/StorageCorrectContentLengthPolicy-browser.mjs.map +1 -0
- package/dist/browser/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
- package/dist/browser/policies/StorageCorrectContentLengthPolicy.js +18 -0
- package/dist/browser/policies/StorageRetryPolicy.d.ts +62 -0
- package/dist/browser/policies/StorageRetryPolicy.d.ts.map +1 -0
- package/dist/browser/policies/StorageRetryPolicy.js +216 -0
- package/dist/browser/policies/StorageRetryPolicy.js.map +1 -0
- package/dist/browser/policies/StorageRetryPolicyType.d.ts +14 -0
- package/dist/browser/policies/StorageRetryPolicyType.d.ts.map +1 -0
- package/dist/browser/policies/StorageRetryPolicyType.js +17 -0
- package/dist/browser/policies/StorageRetryPolicyType.js.map +1 -0
- package/dist/browser/policies/StorageRetryPolicyV2.d.ts +11 -0
- package/dist/browser/policies/StorageRetryPolicyV2.d.ts.map +1 -0
- package/dist/browser/policies/StorageRetryPolicyV2.js +167 -0
- package/dist/browser/policies/StorageRetryPolicyV2.js.map +1 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js +141 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-browser.d.mts.map +1 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-browser.mjs.map +1 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
- package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2.js +18 -0
- package/dist/browser/utils/SharedKeyComparator.d.ts +2 -0
- package/dist/browser/utils/SharedKeyComparator.d.ts.map +1 -0
- package/dist/browser/utils/SharedKeyComparator.js +73 -0
- package/dist/browser/utils/SharedKeyComparator.js.map +1 -0
- package/dist/browser/utils/constants.d.ts +39 -0
- package/dist/browser/utils/constants.d.ts.map +1 -0
- package/dist/browser/utils/constants.js +64 -0
- package/dist/browser/utils/constants.js.map +1 -0
- package/dist/browser/utils/tracing.d.ts +6 -0
- package/dist/browser/utils/tracing.d.ts.map +1 -0
- package/dist/browser/utils/tracing.js +14 -0
- package/dist/browser/utils/tracing.js.map +1 -0
- package/dist/browser/utils/utils.common.d.ts +305 -0
- package/dist/browser/utils/utils.common.d.ts.map +1 -0
- package/dist/browser/utils/utils.common.js +545 -0
- package/dist/browser/utils/utils.common.js.map +1 -0
- package/dist/commonjs/StorageBrowserPolicyFactory.d.ts +16 -0
- package/dist/commonjs/StorageBrowserPolicyFactory.d.ts.map +1 -0
- package/dist/commonjs/StorageBrowserPolicyFactory.js +23 -0
- package/dist/commonjs/StorageBrowserPolicyFactory.js.map +1 -0
- package/dist/commonjs/StorageRetryPolicyFactory.d.ts +66 -0
- package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +1 -0
- package/dist/commonjs/StorageRetryPolicyFactory.js +32 -0
- package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -0
- package/dist/commonjs/credentials/AnonymousCredential.d.ts +19 -0
- package/dist/commonjs/credentials/AnonymousCredential.d.ts.map +1 -0
- package/dist/commonjs/credentials/AnonymousCredential.js +26 -0
- package/dist/commonjs/credentials/AnonymousCredential.js.map +1 -0
- package/dist/commonjs/credentials/Credential.d.ts +20 -0
- package/dist/commonjs/credentials/Credential.d.ts.map +1 -0
- package/dist/commonjs/credentials/Credential.js +22 -0
- package/dist/commonjs/credentials/Credential.js.map +1 -0
- package/dist/commonjs/credentials/StorageSharedKeyCredential.d.ts +38 -0
- package/dist/commonjs/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
- package/dist/commonjs/credentials/StorageSharedKeyCredential.js +44 -0
- package/dist/commonjs/credentials/StorageSharedKeyCredential.js.map +1 -0
- package/dist/commonjs/index.d.ts +17 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +19 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/log.d.ts +5 -0
- package/dist/commonjs/log.d.ts.map +1 -0
- package/dist/commonjs/log.js +11 -0
- package/dist/commonjs/log.js.map +1 -0
- package/dist/commonjs/policies/AnonymousCredentialPolicy.d.ts +15 -0
- package/dist/commonjs/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/AnonymousCredentialPolicy.js +24 -0
- package/dist/commonjs/policies/AnonymousCredentialPolicy.js.map +1 -0
- package/dist/commonjs/policies/CredentialPolicy.d.ts +22 -0
- package/dist/commonjs/policies/CredentialPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/CredentialPolicy.js +33 -0
- package/dist/commonjs/policies/CredentialPolicy.js.map +1 -0
- package/dist/commonjs/policies/RequestPolicy.d.ts +45 -0
- package/dist/commonjs/policies/RequestPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/RequestPolicy.js +44 -0
- package/dist/commonjs/policies/RequestPolicy.js.map +1 -0
- package/dist/commonjs/policies/StorageBrowserPolicy.d.ts +28 -0
- package/dist/commonjs/policies/StorageBrowserPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageBrowserPolicy.js +51 -0
- package/dist/commonjs/policies/StorageBrowserPolicy.js.map +1 -0
- package/dist/commonjs/policies/StorageBrowserPolicyV2.d.ts +11 -0
- package/dist/commonjs/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageBrowserPolicyV2.js +35 -0
- package/dist/commonjs/policies/StorageBrowserPolicyV2.js.map +1 -0
- package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
- package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js +31 -0
- package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js.map +1 -0
- package/dist/commonjs/policies/StorageRetryPolicy.d.ts +62 -0
- package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageRetryPolicy.js +221 -0
- package/dist/commonjs/policies/StorageRetryPolicy.js.map +1 -0
- package/dist/commonjs/policies/StorageRetryPolicyType.d.ts +14 -0
- package/dist/commonjs/policies/StorageRetryPolicyType.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageRetryPolicyType.js +20 -0
- package/dist/commonjs/policies/StorageRetryPolicyType.js.map +1 -0
- package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts +11 -0
- package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageRetryPolicyV2.js +171 -0
- package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +1 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +145 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js +136 -0
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
- package/dist/commonjs/utils/SharedKeyComparator.d.ts +2 -0
- package/dist/commonjs/utils/SharedKeyComparator.d.ts.map +1 -0
- package/dist/commonjs/utils/SharedKeyComparator.js +76 -0
- package/dist/commonjs/utils/SharedKeyComparator.js.map +1 -0
- package/dist/commonjs/utils/constants.d.ts +39 -0
- package/dist/commonjs/utils/constants.d.ts.map +1 -0
- package/dist/commonjs/utils/constants.js +67 -0
- package/dist/commonjs/utils/constants.js.map +1 -0
- package/dist/commonjs/utils/tracing.d.ts +6 -0
- package/dist/commonjs/utils/tracing.d.ts.map +1 -0
- package/dist/commonjs/utils/tracing.js +17 -0
- package/dist/commonjs/utils/tracing.js.map +1 -0
- package/dist/commonjs/utils/utils.common.d.ts +305 -0
- package/dist/commonjs/utils/utils.common.d.ts.map +1 -0
- package/dist/commonjs/utils/utils.common.js +574 -0
- package/dist/commonjs/utils/utils.common.js.map +1 -0
- package/dist/esm/StorageBrowserPolicyFactory.d.ts +16 -0
- package/dist/esm/StorageBrowserPolicyFactory.d.ts.map +1 -0
- package/dist/esm/StorageBrowserPolicyFactory.js +19 -0
- package/dist/esm/StorageBrowserPolicyFactory.js.map +1 -0
- package/dist/esm/StorageRetryPolicyFactory.d.ts +66 -0
- package/dist/esm/StorageRetryPolicyFactory.d.ts.map +1 -0
- package/dist/esm/StorageRetryPolicyFactory.js +27 -0
- package/dist/esm/StorageRetryPolicyFactory.js.map +1 -0
- package/dist/esm/credentials/AnonymousCredential.d.ts +19 -0
- package/dist/esm/credentials/AnonymousCredential.d.ts.map +1 -0
- package/dist/esm/credentials/AnonymousCredential.js +22 -0
- package/dist/esm/credentials/AnonymousCredential.js.map +1 -0
- package/dist/esm/credentials/Credential.d.ts +20 -0
- package/dist/esm/credentials/Credential.d.ts.map +1 -0
- package/dist/esm/credentials/Credential.js +18 -0
- package/dist/esm/credentials/Credential.js.map +1 -0
- package/dist/esm/credentials/StorageSharedKeyCredential.d.ts +38 -0
- package/dist/esm/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
- package/dist/esm/credentials/StorageSharedKeyCredential.js +40 -0
- package/dist/esm/credentials/StorageSharedKeyCredential.js.map +1 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/log.d.ts +5 -0
- package/dist/esm/log.d.ts.map +1 -0
- package/dist/esm/log.js +8 -0
- package/dist/esm/log.js.map +1 -0
- package/dist/esm/policies/AnonymousCredentialPolicy.d.ts +15 -0
- package/dist/esm/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
- package/dist/esm/policies/AnonymousCredentialPolicy.js +20 -0
- package/dist/esm/policies/AnonymousCredentialPolicy.js.map +1 -0
- package/dist/esm/policies/CredentialPolicy.d.ts +22 -0
- package/dist/esm/policies/CredentialPolicy.d.ts.map +1 -0
- package/dist/esm/policies/CredentialPolicy.js +29 -0
- package/dist/esm/policies/CredentialPolicy.js.map +1 -0
- package/dist/esm/policies/RequestPolicy.d.ts +45 -0
- package/dist/esm/policies/RequestPolicy.d.ts.map +1 -0
- package/dist/esm/policies/RequestPolicy.js +40 -0
- package/dist/esm/policies/RequestPolicy.js.map +1 -0
- package/dist/esm/policies/StorageBrowserPolicy.d.ts +28 -0
- package/dist/esm/policies/StorageBrowserPolicy.d.ts.map +1 -0
- package/dist/esm/policies/StorageBrowserPolicy.js +47 -0
- package/dist/esm/policies/StorageBrowserPolicy.js.map +1 -0
- package/dist/esm/policies/StorageBrowserPolicyV2.d.ts +11 -0
- package/dist/esm/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
- package/dist/esm/policies/StorageBrowserPolicyV2.js +31 -0
- package/dist/esm/policies/StorageBrowserPolicyV2.js.map +1 -0
- package/dist/esm/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
- package/dist/esm/policies/StorageCorrectContentLengthPolicy.d.ts.map +1 -0
- package/dist/esm/policies/StorageCorrectContentLengthPolicy.js +27 -0
- package/dist/esm/policies/StorageCorrectContentLengthPolicy.js.map +1 -0
- package/dist/esm/policies/StorageRetryPolicy.d.ts +62 -0
- package/dist/esm/policies/StorageRetryPolicy.d.ts.map +1 -0
- package/dist/esm/policies/StorageRetryPolicy.js +216 -0
- package/dist/esm/policies/StorageRetryPolicy.js.map +1 -0
- package/dist/esm/policies/StorageRetryPolicyType.d.ts +14 -0
- package/dist/esm/policies/StorageRetryPolicyType.d.ts.map +1 -0
- package/dist/esm/policies/StorageRetryPolicyType.js +17 -0
- package/dist/esm/policies/StorageRetryPolicyType.js.map +1 -0
- package/dist/esm/policies/StorageRetryPolicyV2.d.ts +11 -0
- package/dist/esm/policies/StorageRetryPolicyV2.d.ts.map +1 -0
- package/dist/esm/policies/StorageRetryPolicyV2.js +167 -0
- package/dist/esm/policies/StorageRetryPolicyV2.js.map +1 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js +141 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +1 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js +132 -0
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
- package/dist/esm/utils/SharedKeyComparator.d.ts +2 -0
- package/dist/esm/utils/SharedKeyComparator.d.ts.map +1 -0
- package/dist/esm/utils/SharedKeyComparator.js +73 -0
- package/dist/esm/utils/SharedKeyComparator.js.map +1 -0
- package/dist/esm/utils/constants.d.ts +39 -0
- package/dist/esm/utils/constants.d.ts.map +1 -0
- package/dist/esm/utils/constants.js +64 -0
- package/dist/esm/utils/constants.js.map +1 -0
- package/dist/esm/utils/tracing.d.ts +6 -0
- package/dist/esm/utils/tracing.d.ts.map +1 -0
- package/dist/esm/utils/tracing.js +14 -0
- package/dist/esm/utils/tracing.js.map +1 -0
- package/dist/esm/utils/utils.common.d.ts +305 -0
- package/dist/esm/utils/utils.common.d.ts.map +1 -0
- package/dist/esm/utils/utils.common.js +545 -0
- package/dist/esm/utils/utils.common.js.map +1 -0
- package/dist/react-native/StorageBrowserPolicyFactory.d.ts +16 -0
- package/dist/react-native/StorageBrowserPolicyFactory.d.ts.map +1 -0
- package/dist/react-native/StorageBrowserPolicyFactory.js +19 -0
- package/dist/react-native/StorageBrowserPolicyFactory.js.map +1 -0
- package/dist/react-native/StorageRetryPolicyFactory.d.ts +66 -0
- package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +1 -0
- package/dist/react-native/StorageRetryPolicyFactory.js +27 -0
- package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -0
- package/dist/react-native/credentials/AnonymousCredential.d.ts +19 -0
- package/dist/react-native/credentials/AnonymousCredential.d.ts.map +1 -0
- package/dist/react-native/credentials/AnonymousCredential.js +22 -0
- package/dist/react-native/credentials/AnonymousCredential.js.map +1 -0
- package/dist/react-native/credentials/Credential.d.ts +20 -0
- package/dist/react-native/credentials/Credential.d.ts.map +1 -0
- package/dist/react-native/credentials/Credential.js +18 -0
- package/dist/react-native/credentials/Credential.js.map +1 -0
- package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts +38 -0
- package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
- package/dist/react-native/credentials/StorageSharedKeyCredential.js +40 -0
- package/dist/react-native/credentials/StorageSharedKeyCredential.js.map +1 -0
- package/dist/react-native/index.d.ts +17 -0
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +17 -0
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/log.d.ts +5 -0
- package/dist/react-native/log.d.ts.map +1 -0
- package/dist/react-native/log.js +8 -0
- package/dist/react-native/log.js.map +1 -0
- package/dist/react-native/policies/AnonymousCredentialPolicy.d.ts +15 -0
- package/dist/react-native/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/AnonymousCredentialPolicy.js +20 -0
- package/dist/react-native/policies/AnonymousCredentialPolicy.js.map +1 -0
- package/dist/react-native/policies/CredentialPolicy.d.ts +22 -0
- package/dist/react-native/policies/CredentialPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/CredentialPolicy.js +29 -0
- package/dist/react-native/policies/CredentialPolicy.js.map +1 -0
- package/dist/react-native/policies/RequestPolicy.d.ts +45 -0
- package/dist/react-native/policies/RequestPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/RequestPolicy.js +40 -0
- package/dist/react-native/policies/RequestPolicy.js.map +1 -0
- package/dist/react-native/policies/StorageBrowserPolicy.d.ts +28 -0
- package/dist/react-native/policies/StorageBrowserPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/StorageBrowserPolicy.js +47 -0
- package/dist/react-native/policies/StorageBrowserPolicy.js.map +1 -0
- package/dist/react-native/policies/StorageBrowserPolicyV2.d.ts +11 -0
- package/dist/react-native/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
- package/dist/react-native/policies/StorageBrowserPolicyV2.js +31 -0
- package/dist/react-native/policies/StorageBrowserPolicyV2.js.map +1 -0
- package/dist/react-native/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
- package/dist/react-native/policies/StorageCorrectContentLengthPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/StorageCorrectContentLengthPolicy.js +27 -0
- package/dist/react-native/policies/StorageCorrectContentLengthPolicy.js.map +1 -0
- package/dist/react-native/policies/StorageRetryPolicy.d.ts +62 -0
- package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/StorageRetryPolicy.js +216 -0
- package/dist/react-native/policies/StorageRetryPolicy.js.map +1 -0
- package/dist/react-native/policies/StorageRetryPolicyType.d.ts +14 -0
- package/dist/react-native/policies/StorageRetryPolicyType.d.ts.map +1 -0
- package/dist/react-native/policies/StorageRetryPolicyType.js +17 -0
- package/dist/react-native/policies/StorageRetryPolicyType.js.map +1 -0
- package/dist/react-native/policies/StorageRetryPolicyV2.d.ts +11 -0
- package/dist/react-native/policies/StorageRetryPolicyV2.d.ts.map +1 -0
- package/dist/react-native/policies/StorageRetryPolicyV2.js +167 -0
- package/dist/react-native/policies/StorageRetryPolicyV2.js.map +1 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js +141 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +1 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js +132 -0
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
- package/dist/react-native/utils/SharedKeyComparator.d.ts +2 -0
- package/dist/react-native/utils/SharedKeyComparator.d.ts.map +1 -0
- package/dist/react-native/utils/SharedKeyComparator.js +73 -0
- package/dist/react-native/utils/SharedKeyComparator.js.map +1 -0
- package/dist/react-native/utils/constants.d.ts +39 -0
- package/dist/react-native/utils/constants.d.ts.map +1 -0
- package/dist/react-native/utils/constants.js +64 -0
- package/dist/react-native/utils/constants.js.map +1 -0
- package/dist/react-native/utils/tracing.d.ts +6 -0
- package/dist/react-native/utils/tracing.d.ts.map +1 -0
- package/dist/react-native/utils/tracing.js +14 -0
- package/dist/react-native/utils/tracing.js.map +1 -0
- package/dist/react-native/utils/utils.common.d.ts +305 -0
- package/dist/react-native/utils/utils.common.d.ts.map +1 -0
- package/dist/react-native/utils/utils.common.js +545 -0
- package/dist/react-native/utils/utils.common.js.map +1 -0
- package/package.json +7 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions, WebResourceLike as WebResource, CompatResponse as HttpOperationResponse } from "@azure/core-http-compat";
|
|
2
|
+
import { BaseRequestPolicy } from "./RequestPolicy.js";
|
|
3
|
+
/**
|
|
4
|
+
* StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
|
|
5
|
+
*
|
|
6
|
+
* 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.
|
|
7
|
+
* StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL
|
|
8
|
+
* thus avoid the browser cache.
|
|
9
|
+
*
|
|
10
|
+
* 2. Remove cookie header for security
|
|
11
|
+
*
|
|
12
|
+
* 3. Remove content-length header to avoid browsers warning
|
|
13
|
+
*/
|
|
14
|
+
export declare class StorageBrowserPolicy extends BaseRequestPolicy {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of StorageBrowserPolicy.
|
|
17
|
+
* @param nextPolicy -
|
|
18
|
+
* @param options -
|
|
19
|
+
*/
|
|
20
|
+
constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Sends out request.
|
|
23
|
+
*
|
|
24
|
+
* @param request -
|
|
25
|
+
*/
|
|
26
|
+
sendRequest(request: WebResource): Promise<HttpOperationResponse>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=StorageBrowserPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageBrowserPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EAChD,eAAe,IAAI,WAAW,EAC9B,cAAc,IAAI,qBAAqB,EACxC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKvD;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD;;;;OAIG;gBAGS,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB;IAIpE;;;;OAIG;IACU,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAoB/E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { BaseRequestPolicy } from "./RequestPolicy.js";
|
|
4
|
+
import { isNodeLike } from "@azure/core-util";
|
|
5
|
+
import { HeaderConstants, URLConstants } from "../utils/constants.js";
|
|
6
|
+
import { setURLParameter } from "../utils/utils.common.js";
|
|
7
|
+
/**
|
|
8
|
+
* StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
|
|
9
|
+
*
|
|
10
|
+
* 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.
|
|
11
|
+
* StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL
|
|
12
|
+
* thus avoid the browser cache.
|
|
13
|
+
*
|
|
14
|
+
* 2. Remove cookie header for security
|
|
15
|
+
*
|
|
16
|
+
* 3. Remove content-length header to avoid browsers warning
|
|
17
|
+
*/
|
|
18
|
+
export class StorageBrowserPolicy extends BaseRequestPolicy {
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of StorageBrowserPolicy.
|
|
21
|
+
* @param nextPolicy -
|
|
22
|
+
* @param options -
|
|
23
|
+
*/
|
|
24
|
+
// The base class has a protected constructor. Adding a public one to enable constructing of this class.
|
|
25
|
+
/* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
|
|
26
|
+
constructor(nextPolicy, options) {
|
|
27
|
+
super(nextPolicy, options);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sends out request.
|
|
31
|
+
*
|
|
32
|
+
* @param request -
|
|
33
|
+
*/
|
|
34
|
+
async sendRequest(request) {
|
|
35
|
+
if (isNodeLike) {
|
|
36
|
+
return this._nextPolicy.sendRequest(request);
|
|
37
|
+
}
|
|
38
|
+
if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
|
|
39
|
+
request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
|
|
40
|
+
}
|
|
41
|
+
request.headers.remove(HeaderConstants.COOKIE);
|
|
42
|
+
// According to XHR standards, content-length should be fully controlled by browsers
|
|
43
|
+
request.headers.remove(HeaderConstants.CONTENT_LENGTH);
|
|
44
|
+
return this._nextPolicy.sendRequest(request);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=StorageBrowserPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageBrowserPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IACzD;;;;OAIG;IACH,wGAAwG;IACxG,uEAAuE;IACvE,YAAY,UAAyB,EAAE,OAA6B;QAClE,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,OAAoB;QAC3C,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;YACtF,OAAO,CAAC,GAAG,GAAG,eAAe,CAC3B,OAAO,CAAC,GAAG,EACX,YAAY,CAAC,UAAU,CAAC,sBAAsB,EAC9C,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAChC,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAE/C,oFAAoF;QACpF,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;QAEvD,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\nimport { BaseRequestPolicy } from \"./RequestPolicy.js\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants.js\";\nimport { setURLParameter } from \"../utils/utils.common.js\";\n\n/**\n * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:\n *\n * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.\n * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL\n * thus avoid the browser cache.\n *\n * 2. Remove cookie header for security\n *\n * 3. Remove content-length header to avoid browsers warning\n */\nexport class StorageBrowserPolicy extends BaseRequestPolicy {\n /**\n * Creates an instance of StorageBrowserPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) {\n super(nextPolicy, options);\n }\n\n /**\n * Sends out request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise<HttpOperationResponse> {\n if (isNodeLike) {\n return this._nextPolicy.sendRequest(request);\n }\n\n if (request.method.toUpperCase() === \"GET\" || request.method.toUpperCase() === \"HEAD\") {\n request.url = setURLParameter(\n request.url,\n URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,\n new Date().getTime().toString(),\n );\n }\n\n request.headers.remove(HeaderConstants.COOKIE);\n\n // According to XHR standards, content-length should be fully controlled by browsers\n request.headers.remove(HeaderConstants.CONTENT_LENGTH);\n\n return this._nextPolicy.sendRequest(request);\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
/**
|
|
3
|
+
* The programmatic identifier of the StorageBrowserPolicy.
|
|
4
|
+
*/
|
|
5
|
+
export declare const storageBrowserPolicyName = "storageBrowserPolicy";
|
|
6
|
+
/**
|
|
7
|
+
* storageBrowserPolicy is a policy used to prevent browsers from caching requests
|
|
8
|
+
* and to remove cookies and explicit content-length headers.
|
|
9
|
+
*/
|
|
10
|
+
export declare function storageBrowserPolicy(): PipelinePolicy;
|
|
11
|
+
//# sourceMappingURL=StorageBrowserPolicyV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageBrowserPolicyV2.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicyV2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAKnC;;GAEG;AACH,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAuBrD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { isNodeLike } from "@azure/core-util";
|
|
4
|
+
import { HeaderConstants, URLConstants } from "../utils/constants.js";
|
|
5
|
+
import { setURLParameter } from "../utils/utils.common.js";
|
|
6
|
+
/**
|
|
7
|
+
* The programmatic identifier of the StorageBrowserPolicy.
|
|
8
|
+
*/
|
|
9
|
+
export const storageBrowserPolicyName = "storageBrowserPolicy";
|
|
10
|
+
/**
|
|
11
|
+
* storageBrowserPolicy is a policy used to prevent browsers from caching requests
|
|
12
|
+
* and to remove cookies and explicit content-length headers.
|
|
13
|
+
*/
|
|
14
|
+
export function storageBrowserPolicy() {
|
|
15
|
+
return {
|
|
16
|
+
name: storageBrowserPolicyName,
|
|
17
|
+
async sendRequest(request, next) {
|
|
18
|
+
if (isNodeLike) {
|
|
19
|
+
return next(request);
|
|
20
|
+
}
|
|
21
|
+
if (request.method === "GET" || request.method === "HEAD") {
|
|
22
|
+
request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
|
|
23
|
+
}
|
|
24
|
+
request.headers.delete(HeaderConstants.COOKIE);
|
|
25
|
+
// According to XHR standards, content-length should be fully controlled by browsers
|
|
26
|
+
request.headers.delete(HeaderConstants.CONTENT_LENGTH);
|
|
27
|
+
return next(request);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=StorageBrowserPolicyV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageBrowserPolicyV2.js","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicyV2.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;gBAC1D,OAAO,CAAC,GAAG,GAAG,eAAe,CAC3B,OAAO,CAAC,GAAG,EACX,YAAY,CAAC,UAAU,CAAC,sBAAsB,EAC9C,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAChC,CAAC;YACJ,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAE/C,oFAAoF;YACpF,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants.js\";\nimport { setURLParameter } from \"../utils/utils.common.js\";\n\n/**\n * The programmatic identifier of the StorageBrowserPolicy.\n */\nexport const storageBrowserPolicyName = \"storageBrowserPolicy\";\n\n/**\n * storageBrowserPolicy is a policy used to prevent browsers from caching requests\n * and to remove cookies and explicit content-length headers.\n */\nexport function storageBrowserPolicy(): PipelinePolicy {\n return {\n name: storageBrowserPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (isNodeLike) {\n return next(request);\n }\n\n if (request.method === \"GET\" || request.method === \"HEAD\") {\n request.url = setURLParameter(\n request.url,\n URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,\n new Date().getTime().toString(),\n );\n }\n\n request.headers.delete(HeaderConstants.COOKIE);\n\n // According to XHR standards, content-length should be fully controlled by browsers\n request.headers.delete(HeaderConstants.CONTENT_LENGTH);\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
/**
|
|
3
|
+
* The programmatic identifier of the storageCorrectContentLengthPolicy.
|
|
4
|
+
*/
|
|
5
|
+
export declare const storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
|
|
6
|
+
/**
|
|
7
|
+
* storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
|
|
8
|
+
*/
|
|
9
|
+
export declare function storageCorrectContentLengthPolicy(): PipelinePolicy;
|
|
10
|
+
//# sourceMappingURL=StorageCorrectContentLengthPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageCorrectContentLengthPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageCorrectContentLengthPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAGnC;;GAEG;AACH,eAAO,MAAM,qCAAqC,sCAAsC,CAAC;AAEzF;;GAEG;AACH,wBAAgB,iCAAiC,IAAI,cAAc,CAkBlE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { HeaderConstants } from "../utils/constants.js";
|
|
4
|
+
/**
|
|
5
|
+
* The programmatic identifier of the storageCorrectContentLengthPolicy.
|
|
6
|
+
*/
|
|
7
|
+
export const storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
|
|
8
|
+
/**
|
|
9
|
+
* storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
|
|
10
|
+
*/
|
|
11
|
+
export function storageCorrectContentLengthPolicy() {
|
|
12
|
+
function correctContentLength(request) {
|
|
13
|
+
if (request.body &&
|
|
14
|
+
(typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
|
|
15
|
+
request.body.length > 0) {
|
|
16
|
+
request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
name: storageCorrectContentLengthPolicyName,
|
|
21
|
+
async sendRequest(request, next) {
|
|
22
|
+
correctContentLength(request);
|
|
23
|
+
return next(request);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=StorageCorrectContentLengthPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageCorrectContentLengthPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageCorrectContentLengthPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,mCAAmC,CAAC;AAEzF;;GAEG;AACH,MAAM,UAAU,iCAAiC;IAC/C,SAAS,oBAAoB,CAAC,OAAwB;QACpD,IACE,OAAO,CAAC,IAAI;YACZ,CAAC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACvB,CAAC;YACD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,qCAAqC;QAC3C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { HeaderConstants } from \"../utils/constants.js\";\n\n/**\n * The programmatic identifier of the storageCorrectContentLengthPolicy.\n */\nexport const storageCorrectContentLengthPolicyName = \"StorageCorrectContentLengthPolicy\";\n\n/**\n * storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.\n */\nexport function storageCorrectContentLengthPolicy(): PipelinePolicy {\n function correctContentLength(request: PipelineRequest): void {\n if (\n request.body &&\n (typeof request.body === \"string\" || Buffer.isBuffer(request.body)) &&\n request.body.length > 0\n ) {\n request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));\n }\n }\n\n return {\n name: storageCorrectContentLengthPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n correctContentLength(request);\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions, RequestPolicyFactory, WebResourceLike as WebResource, CompatResponse as HttpOperationResponse } from "@azure/core-http-compat";
|
|
2
|
+
import { BaseRequestPolicy } from "./RequestPolicy.js";
|
|
3
|
+
import type { RestError } from "@azure/core-rest-pipeline";
|
|
4
|
+
import { type StorageRetryOptions } from "../StorageRetryPolicyFactory.js";
|
|
5
|
+
/**
|
|
6
|
+
* A factory method used to generated a RetryPolicy factory.
|
|
7
|
+
*
|
|
8
|
+
* @param retryOptions -
|
|
9
|
+
*/
|
|
10
|
+
export declare function NewRetryPolicyFactory(retryOptions?: StorageRetryOptions): RequestPolicyFactory;
|
|
11
|
+
/**
|
|
12
|
+
* Retry policy with exponential retry and linear retry implemented.
|
|
13
|
+
*/
|
|
14
|
+
export declare class StorageRetryPolicy extends BaseRequestPolicy {
|
|
15
|
+
/**
|
|
16
|
+
* RetryOptions.
|
|
17
|
+
*/
|
|
18
|
+
private readonly retryOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of RetryPolicy.
|
|
21
|
+
*
|
|
22
|
+
* @param nextPolicy -
|
|
23
|
+
* @param options -
|
|
24
|
+
* @param retryOptions -
|
|
25
|
+
*/
|
|
26
|
+
constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, retryOptions?: StorageRetryOptions);
|
|
27
|
+
/**
|
|
28
|
+
* Sends request.
|
|
29
|
+
*
|
|
30
|
+
* @param request -
|
|
31
|
+
*/
|
|
32
|
+
sendRequest(request: WebResource): Promise<HttpOperationResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Decide and perform next retry. Won't mutate request parameter.
|
|
35
|
+
*
|
|
36
|
+
* @param request -
|
|
37
|
+
* @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|
38
|
+
* the resource was not found. This may be due to replication delay. So, in this
|
|
39
|
+
* case, we'll never try the secondary again for this operation.
|
|
40
|
+
* @param attempt - How many retries has been attempted to performed, starting from 1, which includes
|
|
41
|
+
* the attempt will be performed by this method call.
|
|
42
|
+
*/
|
|
43
|
+
protected attemptSendRequest(request: WebResource, secondaryHas404: boolean, attempt: number): Promise<HttpOperationResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Decide whether to retry according to last HTTP response and retry counters.
|
|
46
|
+
*
|
|
47
|
+
* @param isPrimaryRetry -
|
|
48
|
+
* @param attempt -
|
|
49
|
+
* @param response -
|
|
50
|
+
* @param err -
|
|
51
|
+
*/
|
|
52
|
+
protected shouldRetry(isPrimaryRetry: boolean, attempt: number, response?: HttpOperationResponse, err?: RestError): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Delay a calculated time between retries.
|
|
55
|
+
*
|
|
56
|
+
* @param isPrimaryRetry -
|
|
57
|
+
* @param attempt -
|
|
58
|
+
* @param abortSignal -
|
|
59
|
+
*/
|
|
60
|
+
private delay;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=StorageRetryPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EAChD,oBAAoB,EACpB,eAAe,IAAI,WAAW,EAC9B,cAAc,IAAI,qBAAqB,EACxC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAM3E;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAM9F;AAcD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD;;;;;;OAMG;gBAED,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,oBAAoB,EAC7B,YAAY,GAAE,mBAA2C;IAyC3D;;;;OAIG;IACU,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI9E;;;;;;;;;OASG;cACa,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,eAAe,EAAE,OAAO,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC;IA0CjC;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CACnB,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,qBAAqB,EAChC,GAAG,CAAC,EAAE,SAAS,GACd,OAAO;IA8EV;;;;;;OAMG;YACW,KAAK;CA0BpB"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { AbortError } from "@azure/abort-controller";
|
|
4
|
+
import { BaseRequestPolicy } from "./RequestPolicy.js";
|
|
5
|
+
import { URLConstants } from "../utils/constants.js";
|
|
6
|
+
import { delay, setURLHost, setURLParameter } from "../utils/utils.common.js";
|
|
7
|
+
import { logger } from "../log.js";
|
|
8
|
+
import { StorageRetryPolicyType } from "./StorageRetryPolicyType.js";
|
|
9
|
+
/**
|
|
10
|
+
* A factory method used to generated a RetryPolicy factory.
|
|
11
|
+
*
|
|
12
|
+
* @param retryOptions -
|
|
13
|
+
*/
|
|
14
|
+
export function NewRetryPolicyFactory(retryOptions) {
|
|
15
|
+
return {
|
|
16
|
+
create: (nextPolicy, options) => {
|
|
17
|
+
return new StorageRetryPolicy(nextPolicy, options, retryOptions);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
// Default values of StorageRetryOptions
|
|
22
|
+
const DEFAULT_RETRY_OPTIONS = {
|
|
23
|
+
maxRetryDelayInMs: 120 * 1000,
|
|
24
|
+
maxTries: 4,
|
|
25
|
+
retryDelayInMs: 4 * 1000,
|
|
26
|
+
retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,
|
|
27
|
+
secondaryHost: "",
|
|
28
|
+
tryTimeoutInMs: undefined, // Use server side default timeout strategy
|
|
29
|
+
};
|
|
30
|
+
const RETRY_ABORT_ERROR = new AbortError("The operation was aborted.");
|
|
31
|
+
/**
|
|
32
|
+
* Retry policy with exponential retry and linear retry implemented.
|
|
33
|
+
*/
|
|
34
|
+
export class StorageRetryPolicy extends BaseRequestPolicy {
|
|
35
|
+
/**
|
|
36
|
+
* Creates an instance of RetryPolicy.
|
|
37
|
+
*
|
|
38
|
+
* @param nextPolicy -
|
|
39
|
+
* @param options -
|
|
40
|
+
* @param retryOptions -
|
|
41
|
+
*/
|
|
42
|
+
constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) {
|
|
43
|
+
super(nextPolicy, options);
|
|
44
|
+
// Initialize retry options
|
|
45
|
+
this.retryOptions = {
|
|
46
|
+
retryPolicyType: retryOptions.retryPolicyType
|
|
47
|
+
? retryOptions.retryPolicyType
|
|
48
|
+
: DEFAULT_RETRY_OPTIONS.retryPolicyType,
|
|
49
|
+
maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1
|
|
50
|
+
? Math.floor(retryOptions.maxTries)
|
|
51
|
+
: DEFAULT_RETRY_OPTIONS.maxTries,
|
|
52
|
+
tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0
|
|
53
|
+
? retryOptions.tryTimeoutInMs
|
|
54
|
+
: DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,
|
|
55
|
+
retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0
|
|
56
|
+
? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs
|
|
57
|
+
? retryOptions.maxRetryDelayInMs
|
|
58
|
+
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs)
|
|
59
|
+
: DEFAULT_RETRY_OPTIONS.retryDelayInMs,
|
|
60
|
+
maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0
|
|
61
|
+
? retryOptions.maxRetryDelayInMs
|
|
62
|
+
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,
|
|
63
|
+
secondaryHost: retryOptions.secondaryHost
|
|
64
|
+
? retryOptions.secondaryHost
|
|
65
|
+
: DEFAULT_RETRY_OPTIONS.secondaryHost,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sends request.
|
|
70
|
+
*
|
|
71
|
+
* @param request -
|
|
72
|
+
*/
|
|
73
|
+
async sendRequest(request) {
|
|
74
|
+
return this.attemptSendRequest(request, false, 1);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Decide and perform next retry. Won't mutate request parameter.
|
|
78
|
+
*
|
|
79
|
+
* @param request -
|
|
80
|
+
* @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|
81
|
+
* the resource was not found. This may be due to replication delay. So, in this
|
|
82
|
+
* case, we'll never try the secondary again for this operation.
|
|
83
|
+
* @param attempt - How many retries has been attempted to performed, starting from 1, which includes
|
|
84
|
+
* the attempt will be performed by this method call.
|
|
85
|
+
*/
|
|
86
|
+
async attemptSendRequest(request, secondaryHas404, attempt) {
|
|
87
|
+
const newRequest = request.clone();
|
|
88
|
+
const isPrimaryRetry = secondaryHas404 ||
|
|
89
|
+
!this.retryOptions.secondaryHost ||
|
|
90
|
+
!(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") ||
|
|
91
|
+
attempt % 2 === 1;
|
|
92
|
+
if (!isPrimaryRetry) {
|
|
93
|
+
newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost);
|
|
94
|
+
}
|
|
95
|
+
// Set the server-side timeout query parameter "timeout=[seconds]"
|
|
96
|
+
if (this.retryOptions.tryTimeoutInMs) {
|
|
97
|
+
newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString());
|
|
98
|
+
}
|
|
99
|
+
let response;
|
|
100
|
+
try {
|
|
101
|
+
logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
|
|
102
|
+
response = await this._nextPolicy.sendRequest(newRequest);
|
|
103
|
+
if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);
|
|
110
|
+
if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
await this.delay(isPrimaryRetry, attempt, request.abortSignal);
|
|
115
|
+
return this.attemptSendRequest(request, secondaryHas404, ++attempt);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Decide whether to retry according to last HTTP response and retry counters.
|
|
119
|
+
*
|
|
120
|
+
* @param isPrimaryRetry -
|
|
121
|
+
* @param attempt -
|
|
122
|
+
* @param response -
|
|
123
|
+
* @param err -
|
|
124
|
+
*/
|
|
125
|
+
shouldRetry(isPrimaryRetry, attempt, response, err) {
|
|
126
|
+
if (attempt >= this.retryOptions.maxTries) {
|
|
127
|
+
logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions
|
|
128
|
+
.maxTries}, no further try.`);
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
// Handle network failures, you may need to customize the list when you implement
|
|
132
|
+
// your own http client
|
|
133
|
+
const retriableErrors = [
|
|
134
|
+
"ETIMEDOUT",
|
|
135
|
+
"ESOCKETTIMEDOUT",
|
|
136
|
+
"ECONNREFUSED",
|
|
137
|
+
"ECONNRESET",
|
|
138
|
+
"ENOENT",
|
|
139
|
+
"ENOTFOUND",
|
|
140
|
+
"TIMEOUT",
|
|
141
|
+
"EPIPE",
|
|
142
|
+
"REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js
|
|
143
|
+
];
|
|
144
|
+
if (err) {
|
|
145
|
+
for (const retriableError of retriableErrors) {
|
|
146
|
+
if (err.name.toUpperCase().includes(retriableError) ||
|
|
147
|
+
err.message.toUpperCase().includes(retriableError) ||
|
|
148
|
+
(err.code && err.code.toString().toUpperCase() === retriableError)) {
|
|
149
|
+
logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|
155
|
+
// the resource was not found. This may be due to replication delay. So, in this
|
|
156
|
+
// case, we'll never try the secondary again for this operation.
|
|
157
|
+
if (response || err) {
|
|
158
|
+
const statusCode = response ? response.status : err ? err.statusCode : 0;
|
|
159
|
+
if (!isPrimaryRetry && statusCode === 404) {
|
|
160
|
+
logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
// Server internal error or server timeout
|
|
164
|
+
if (statusCode === 503 || statusCode === 500) {
|
|
165
|
+
logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// [Copy source error code] Feature is pending on service side, skip retry on copy source error for now.
|
|
170
|
+
// if (response) {
|
|
171
|
+
// // Retry select Copy Source Error Codes.
|
|
172
|
+
// if (response?.status >= 400) {
|
|
173
|
+
// const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);
|
|
174
|
+
// if (copySourceError !== undefined) {
|
|
175
|
+
// switch (copySourceError) {
|
|
176
|
+
// case "InternalError":
|
|
177
|
+
// case "OperationTimedOut":
|
|
178
|
+
// case "ServerBusy":
|
|
179
|
+
// return true;
|
|
180
|
+
// }
|
|
181
|
+
// }
|
|
182
|
+
// }
|
|
183
|
+
// }
|
|
184
|
+
if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) {
|
|
185
|
+
logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Delay a calculated time between retries.
|
|
192
|
+
*
|
|
193
|
+
* @param isPrimaryRetry -
|
|
194
|
+
* @param attempt -
|
|
195
|
+
* @param abortSignal -
|
|
196
|
+
*/
|
|
197
|
+
async delay(isPrimaryRetry, attempt, abortSignal) {
|
|
198
|
+
let delayTimeInMs = 0;
|
|
199
|
+
if (isPrimaryRetry) {
|
|
200
|
+
switch (this.retryOptions.retryPolicyType) {
|
|
201
|
+
case StorageRetryPolicyType.EXPONENTIAL:
|
|
202
|
+
delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs);
|
|
203
|
+
break;
|
|
204
|
+
case StorageRetryPolicyType.FIXED:
|
|
205
|
+
delayTimeInMs = this.retryOptions.retryDelayInMs;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
delayTimeInMs = Math.random() * 1000;
|
|
211
|
+
}
|
|
212
|
+
logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
|
|
213
|
+
return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=StorageRetryPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicy.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n WebResourceLike as WebResource,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\nimport { BaseRequestPolicy } from \"./RequestPolicy.js\";\nimport type { RestError } from \"@azure/core-rest-pipeline\";\nimport { type StorageRetryOptions } from \"../StorageRetryPolicyFactory.js\";\nimport { URLConstants } from \"../utils/constants.js\";\nimport { delay, setURLHost, setURLParameter } from \"../utils/utils.common.js\";\nimport { logger } from \"../log.js\";\nimport { StorageRetryPolicyType } from \"./StorageRetryPolicyType.js\";\n\n/**\n * A factory method used to generated a RetryPolicy factory.\n *\n * @param retryOptions -\n */\nexport function NewRetryPolicyFactory(retryOptions?: StorageRetryOptions): RequestPolicyFactory {\n return {\n create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy => {\n return new StorageRetryPolicy(nextPolicy, options, retryOptions);\n },\n };\n}\n\n// Default values of StorageRetryOptions\nconst DEFAULT_RETRY_OPTIONS: StorageRetryOptions = {\n maxRetryDelayInMs: 120 * 1000,\n maxTries: 4,\n retryDelayInMs: 4 * 1000,\n retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,\n secondaryHost: \"\",\n tryTimeoutInMs: undefined, // Use server side default timeout strategy\n};\n\nconst RETRY_ABORT_ERROR = new AbortError(\"The operation was aborted.\");\n\n/**\n * Retry policy with exponential retry and linear retry implemented.\n */\nexport class StorageRetryPolicy extends BaseRequestPolicy {\n /**\n * RetryOptions.\n */\n private readonly retryOptions: StorageRetryOptions;\n\n /**\n * Creates an instance of RetryPolicy.\n *\n * @param nextPolicy -\n * @param options -\n * @param retryOptions -\n */\n constructor(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n retryOptions: StorageRetryOptions = DEFAULT_RETRY_OPTIONS,\n ) {\n super(nextPolicy, options);\n\n // Initialize retry options\n this.retryOptions = {\n retryPolicyType: retryOptions.retryPolicyType\n ? retryOptions.retryPolicyType\n : DEFAULT_RETRY_OPTIONS.retryPolicyType,\n\n maxTries:\n retryOptions.maxTries && retryOptions.maxTries >= 1\n ? Math.floor(retryOptions.maxTries)\n : DEFAULT_RETRY_OPTIONS.maxTries,\n\n tryTimeoutInMs:\n retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0\n ? retryOptions.tryTimeoutInMs\n : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,\n\n retryDelayInMs:\n retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0\n ? Math.min(\n retryOptions.retryDelayInMs,\n retryOptions.maxRetryDelayInMs\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs!,\n )\n : DEFAULT_RETRY_OPTIONS.retryDelayInMs,\n\n maxRetryDelayInMs:\n retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,\n\n secondaryHost: retryOptions.secondaryHost\n ? retryOptions.secondaryHost\n : DEFAULT_RETRY_OPTIONS.secondaryHost,\n };\n }\n\n /**\n * Sends request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise<HttpOperationResponse> {\n return this.attemptSendRequest(request, false, 1);\n }\n\n /**\n * Decide and perform next retry. Won't mutate request parameter.\n *\n * @param request -\n * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then\n * the resource was not found. This may be due to replication delay. So, in this\n * case, we'll never try the secondary again for this operation.\n * @param attempt - How many retries has been attempted to performed, starting from 1, which includes\n * the attempt will be performed by this method call.\n */\n protected async attemptSendRequest(\n request: WebResource,\n secondaryHas404: boolean,\n attempt: number,\n ): Promise<HttpOperationResponse> {\n const newRequest: WebResource = request.clone();\n\n const isPrimaryRetry =\n secondaryHas404 ||\n !this.retryOptions.secondaryHost ||\n !(request.method === \"GET\" || request.method === \"HEAD\" || request.method === \"OPTIONS\") ||\n attempt % 2 === 1;\n\n if (!isPrimaryRetry) {\n newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost!);\n }\n\n // Set the server-side timeout query parameter \"timeout=[seconds]\"\n if (this.retryOptions.tryTimeoutInMs) {\n newRequest.url = setURLParameter(\n newRequest.url,\n URLConstants.Parameters.TIMEOUT,\n Math.floor(this.retryOptions.tryTimeoutInMs! / 1000).toString(),\n );\n }\n\n let response: HttpOperationResponse | undefined;\n try {\n logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? \"Primary\" : \"Secondary\"}`);\n response = await this._nextPolicy.sendRequest(newRequest);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {\n return response;\n }\n\n secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);\n } catch (err: any) {\n logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {\n throw err;\n }\n }\n\n await this.delay(isPrimaryRetry, attempt, request.abortSignal);\n return this.attemptSendRequest(request, secondaryHas404, ++attempt);\n }\n\n /**\n * Decide whether to retry according to last HTTP response and retry counters.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param response -\n * @param err -\n */\n protected shouldRetry(\n isPrimaryRetry: boolean,\n attempt: number,\n response?: HttpOperationResponse,\n err?: RestError,\n ): boolean {\n if (attempt >= this.retryOptions.maxTries!) {\n logger.info(\n `RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions\n .maxTries!}, no further try.`,\n );\n return false;\n }\n\n // Handle network failures, you may need to customize the list when you implement\n // your own http client\n const retriableErrors = [\n \"ETIMEDOUT\",\n \"ESOCKETTIMEDOUT\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"ENOENT\",\n \"ENOTFOUND\",\n \"TIMEOUT\",\n \"EPIPE\",\n \"REQUEST_SEND_ERROR\", // For default xhr based http client provided in ms-rest-js\n ];\n if (err) {\n for (const retriableError of retriableErrors) {\n if (\n err.name.toUpperCase().includes(retriableError) ||\n err.message.toUpperCase().includes(retriableError) ||\n (err.code && err.code.toString().toUpperCase() === retriableError)\n ) {\n logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);\n return true;\n }\n }\n }\n\n // If attempt was against the secondary & it returned a StatusNotFound (404), then\n // the resource was not found. This may be due to replication delay. So, in this\n // case, we'll never try the secondary again for this operation.\n if (response || err) {\n const statusCode = response ? response.status : err ? err.statusCode : 0;\n if (!isPrimaryRetry && statusCode === 404) {\n logger.info(`RetryPolicy: Secondary access with 404, will retry.`);\n return true;\n }\n\n // Server internal error or server timeout\n if (statusCode === 503 || statusCode === 500) {\n logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);\n return true;\n }\n }\n\n // [Copy source error code] Feature is pending on service side, skip retry on copy source error for now.\n // if (response) {\n // // Retry select Copy Source Error Codes.\n // if (response?.status >= 400) {\n // const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);\n // if (copySourceError !== undefined) {\n // switch (copySourceError) {\n // case \"InternalError\":\n // case \"OperationTimedOut\":\n // case \"ServerBusy\":\n // return true;\n // }\n // }\n // }\n // }\n\n if (err?.code === \"PARSE_ERROR\" && err?.message.startsWith(`Error \"Error: Unclosed root tag`)) {\n logger.info(\n \"RetryPolicy: Incomplete XML response likely due to service timeout, will retry.\",\n );\n return true;\n }\n\n return false;\n }\n\n /**\n * Delay a calculated time between retries.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param abortSignal -\n */\n private async delay(\n isPrimaryRetry: boolean,\n attempt: number,\n abortSignal?: AbortSignalLike,\n ): Promise<void> {\n let delayTimeInMs: number = 0;\n\n if (isPrimaryRetry) {\n switch (this.retryOptions.retryPolicyType) {\n case StorageRetryPolicyType.EXPONENTIAL:\n delayTimeInMs = Math.min(\n (Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs!,\n this.retryOptions.maxRetryDelayInMs!,\n );\n break;\n case StorageRetryPolicyType.FIXED:\n delayTimeInMs = this.retryOptions.retryDelayInMs!;\n break;\n }\n } else {\n delayTimeInMs = Math.random() * 1000;\n }\n\n logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);\n return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RetryPolicy types.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum StorageRetryPolicyType {
|
|
5
|
+
/**
|
|
6
|
+
* Exponential retry. Retry time delay grows exponentially.
|
|
7
|
+
*/
|
|
8
|
+
EXPONENTIAL = 0,
|
|
9
|
+
/**
|
|
10
|
+
* Linear retry. Retry time delay grows linearly.
|
|
11
|
+
*/
|
|
12
|
+
FIXED = 1
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=StorageRetryPolicyType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRetryPolicyType.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicyType.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,sBAAsB;IAChC;;OAEG;IACH,WAAW,IAAA;IACX;;OAEG;IACH,KAAK,IAAA;CACN"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* RetryPolicy types.
|
|
5
|
+
*/
|
|
6
|
+
export var StorageRetryPolicyType;
|
|
7
|
+
(function (StorageRetryPolicyType) {
|
|
8
|
+
/**
|
|
9
|
+
* Exponential retry. Retry time delay grows exponentially.
|
|
10
|
+
*/
|
|
11
|
+
StorageRetryPolicyType[StorageRetryPolicyType["EXPONENTIAL"] = 0] = "EXPONENTIAL";
|
|
12
|
+
/**
|
|
13
|
+
* Linear retry. Retry time delay grows linearly.
|
|
14
|
+
*/
|
|
15
|
+
StorageRetryPolicyType[StorageRetryPolicyType["FIXED"] = 1] = "FIXED";
|
|
16
|
+
})(StorageRetryPolicyType || (StorageRetryPolicyType = {}));
|
|
17
|
+
//# sourceMappingURL=StorageRetryPolicyType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRetryPolicyType.js","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicyType.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,sBASX;AATD,WAAY,sBAAsB;IAChC;;OAEG;IACH,iFAAW,CAAA;IACX;;OAEG;IACH,qEAAK,CAAA;AACP,CAAC,EATW,sBAAsB,KAAtB,sBAAsB,QASjC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * RetryPolicy types.\n */\nexport enum StorageRetryPolicyType {\n /**\n * Exponential retry. Retry time delay grows exponentially.\n */\n EXPONENTIAL,\n /**\n * Linear retry. Retry time delay grows linearly.\n */\n FIXED,\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
import { type StorageRetryOptions } from "../StorageRetryPolicyFactory.js";
|
|
3
|
+
/**
|
|
4
|
+
* Name of the {@link storageRetryPolicy}
|
|
5
|
+
*/
|
|
6
|
+
export declare const storageRetryPolicyName = "storageRetryPolicy";
|
|
7
|
+
/**
|
|
8
|
+
* Retry policy with exponential retry and linear retry implemented.
|
|
9
|
+
*/
|
|
10
|
+
export declare function storageRetryPolicy(options?: StorageRetryOptions): PipelinePolicy;
|
|
11
|
+
//# sourceMappingURL=StorageRetryPolicyV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRetryPolicyV2.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicyV2.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKnG;;GAEG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AA0B3D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,CAgKpF"}
|