@azure/storage-blob 12.13.0-alpha.20230202.2 → 12.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/index.js +5893 -5338
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/BatchResponse.js.map +1 -1
  4. package/dist-esm/storage-blob/src/BatchResponseParser.js +2 -3
  5. package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -1
  6. package/dist-esm/storage-blob/src/BlobBatch.js +87 -74
  7. package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
  8. package/dist-esm/storage-blob/src/BlobBatchClient.js +23 -10
  9. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
  10. package/dist-esm/storage-blob/src/BlobDownloadResponse.js +1 -1
  11. package/dist-esm/storage-blob/src/BlobDownloadResponse.js.map +1 -1
  12. package/dist-esm/storage-blob/src/BlobLeaseClient.js +83 -54
  13. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
  14. package/dist-esm/storage-blob/src/BlobQueryResponse.browser.js.map +1 -1
  15. package/dist-esm/storage-blob/src/BlobQueryResponse.js +1 -1
  16. package/dist-esm/storage-blob/src/BlobQueryResponse.js.map +1 -1
  17. package/dist-esm/storage-blob/src/BlobServiceClient.js +165 -67
  18. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  19. package/dist-esm/storage-blob/src/Clients.js +889 -651
  20. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  21. package/dist-esm/storage-blob/src/ContainerClient.js +238 -115
  22. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  23. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +1 -1
  24. package/dist-esm/storage-blob/src/Pipeline.js +40 -194
  25. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
  26. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +1 -1
  27. package/dist-esm/storage-blob/src/StorageClient.js +17 -4
  28. package/dist-esm/storage-blob/src/StorageClient.js.map +1 -1
  29. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +1 -1
  30. package/dist-esm/storage-blob/src/TelemetryPolicyFactory.js +50 -0
  31. package/dist-esm/storage-blob/src/TelemetryPolicyFactory.js.map +1 -0
  32. package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js.map +1 -1
  33. package/dist-esm/storage-blob/src/credentials/Credential.js.map +1 -1
  34. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js.map +1 -1
  35. package/dist-esm/storage-blob/src/generated/src/index.js +1 -1
  36. package/dist-esm/storage-blob/src/generated/src/index.js.map +1 -1
  37. package/dist-esm/storage-blob/src/generated/src/models/index.js +1 -248
  38. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
  39. package/dist-esm/storage-blob/src/generated/src/models/mappers.js +11 -13
  40. package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
  41. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +5 -5
  42. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
  43. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js +27 -11
  44. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js.map +1 -1
  45. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +110 -28
  46. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
  47. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +43 -16
  48. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js.map +1 -1
  49. package/dist-esm/storage-blob/src/generated/src/operations/container.js +86 -22
  50. package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +1 -1
  51. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +54 -16
  52. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js.map +1 -1
  53. package/dist-esm/storage-blob/src/generated/src/operations/service.js +42 -12
  54. package/dist-esm/storage-blob/src/generated/src/operations/service.js.map +1 -1
  55. package/dist-esm/storage-blob/src/generated/src/storageClient.js +10 -32
  56. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  57. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +39 -0
  58. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -0
  59. package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
  60. package/dist-esm/storage-blob/src/index.browser.js +2 -3
  61. package/dist-esm/storage-blob/src/index.browser.js.map +1 -1
  62. package/dist-esm/storage-blob/src/index.js +2 -3
  63. package/dist-esm/storage-blob/src/index.js.map +1 -1
  64. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +1 -1
  65. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js +1 -1
  66. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +1 -1
  67. package/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js +245 -0
  68. package/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js.map +1 -0
  69. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +1 -2
  70. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +1 -1
  71. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +1 -1
  72. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  73. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  74. package/dist-esm/storage-blob/src/policies/TelemetryPolicy.js +36 -0
  75. package/dist-esm/storage-blob/src/policies/TelemetryPolicy.js.map +1 -0
  76. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +1 -1
  77. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  78. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -1
  79. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +2 -10
  80. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -1
  81. package/dist-esm/storage-blob/src/utils/cache.js +2 -5
  82. package/dist-esm/storage-blob/src/utils/cache.js.map +1 -1
  83. package/dist-esm/storage-blob/src/utils/constants.js +2 -2
  84. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  85. package/dist-esm/storage-blob/src/utils/tracing.js +18 -5
  86. package/dist-esm/storage-blob/src/utils/tracing.js.map +1 -1
  87. package/dist-esm/storage-blob/src/utils/utils.common.js +42 -83
  88. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  89. package/package.json +15 -22
  90. package/types/3.1/storage-blob.d.ts +625 -2332
  91. package/types/latest/storage-blob.d.ts +606 -2493
  92. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js +0 -9
  93. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js.map +0 -1
  94. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js +0 -9
  95. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js.map +0 -1
  96. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js +0 -9
  97. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js.map +0 -1
  98. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js +0 -9
  99. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js.map +0 -1
  100. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js +0 -14
  101. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js.map +0 -1
  102. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js +0 -9
  103. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js.map +0 -1
  104. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js +0 -9
  105. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js.map +0 -1
  106. package/dist-esm/storage-blob/src/policies/PathParameterWorkaroundPolicy.js +0 -25
  107. package/dist-esm/storage-blob/src/policies/PathParameterWorkaroundPolicy.js.map +0 -1
  108. package/dist-esm/storage-blob/src/policies/RequestPolicy.js +0 -40
  109. package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +0 -1
  110. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js +0 -31
  111. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +0 -1
  112. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +0 -165
  113. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +0 -1
  114. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js +0 -18
  115. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +0 -1
  116. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +0 -131
  117. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +0 -1
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export {};
9
- //# sourceMappingURL=appendBlob.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appendBlob.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/appendBlob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n AppendBlobCreateOptionalParams,\n AppendBlobCreateResponse,\n AppendBlobAppendBlockOptionalParams,\n AppendBlobAppendBlockResponse,\n AppendBlobAppendBlockFromUrlOptionalParams,\n AppendBlobAppendBlockFromUrlResponse,\n AppendBlobSealOptionalParams,\n AppendBlobSealResponse\n} from \"../models\";\n\n/** Interface representing a AppendBlob. */\nexport interface AppendBlob {\n /**\n * The Create Append Blob operation creates a new append blob.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n create(\n contentLength: number,\n options?: AppendBlobCreateOptionalParams\n ): Promise<AppendBlobCreateResponse>;\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob. The\n * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to\n * AppendBlob. Append Block is supported only on version 2015-02-21 version or later.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n appendBlock(\n contentLength: number,\n body: coreRestPipeline.RequestBodyType,\n options?: AppendBlobAppendBlockOptionalParams\n ): Promise<AppendBlobAppendBlockResponse>;\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob where\n * the contents are read from a source url. The Append Block operation is permitted only if the blob\n * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version\n * 2015-02-21 version or later.\n * @param sourceUrl Specify a URL to the copy source.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n appendBlockFromUrl(\n sourceUrl: string,\n contentLength: number,\n options?: AppendBlobAppendBlockFromUrlOptionalParams\n ): Promise<AppendBlobAppendBlockFromUrlResponse>;\n /**\n * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version\n * 2019-12-12 version or later.\n * @param options The options parameters.\n */\n seal(options?: AppendBlobSealOptionalParams): Promise<AppendBlobSealResponse>;\n}\n"]}
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export {};
9
- //# sourceMappingURL=blob.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blob.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/blob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n BlobDownloadOptionalParams,\n BlobDownloadResponse,\n BlobGetPropertiesOptionalParams,\n BlobGetPropertiesResponse,\n BlobDeleteOptionalParams,\n BlobDeleteResponse,\n BlobUndeleteOptionalParams,\n BlobUndeleteResponse,\n BlobExpiryOptions,\n BlobSetExpiryOptionalParams,\n BlobSetExpiryResponse,\n BlobSetHttpHeadersOptionalParams,\n BlobSetHttpHeadersResponse,\n BlobSetImmutabilityPolicyOptionalParams,\n BlobSetImmutabilityPolicyResponse,\n BlobDeleteImmutabilityPolicyOptionalParams,\n BlobDeleteImmutabilityPolicyResponse,\n BlobSetLegalHoldOptionalParams,\n BlobSetLegalHoldResponse,\n BlobSetMetadataOptionalParams,\n BlobSetMetadataResponse,\n BlobAcquireLeaseOptionalParams,\n BlobAcquireLeaseResponse,\n BlobReleaseLeaseOptionalParams,\n BlobReleaseLeaseResponse,\n BlobRenewLeaseOptionalParams,\n BlobRenewLeaseResponse,\n BlobChangeLeaseOptionalParams,\n BlobChangeLeaseResponse,\n BlobBreakLeaseOptionalParams,\n BlobBreakLeaseResponse,\n BlobCreateSnapshotOptionalParams,\n BlobCreateSnapshotResponse,\n BlobStartCopyFromURLOptionalParams,\n BlobStartCopyFromURLResponse,\n BlobCopyFromURLOptionalParams,\n BlobCopyFromURLResponse,\n BlobAbortCopyFromURLOptionalParams,\n BlobAbortCopyFromURLResponse,\n AccessTier,\n BlobSetTierOptionalParams,\n BlobSetTierResponse,\n BlobGetAccountInfoOptionalParams,\n BlobGetAccountInfoResponse,\n BlobQueryOptionalParams,\n BlobQueryResponse,\n BlobGetTagsOptionalParams,\n BlobGetTagsResponse,\n BlobSetTagsOptionalParams,\n BlobSetTagsResponse\n} from \"../models\";\n\n/** Interface representing a Blob. */\nexport interface Blob {\n /**\n * The Download operation reads or downloads a blob from the system, including its metadata and\n * properties. You can also call Download to read a snapshot.\n * @param options The options parameters.\n */\n download(options?: BlobDownloadOptionalParams): Promise<BlobDownloadResponse>;\n /**\n * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system\n * properties for the blob. It does not return the content of the blob.\n * @param options The options parameters.\n */\n getProperties(\n options?: BlobGetPropertiesOptionalParams\n ): Promise<BlobGetPropertiesResponse>;\n /**\n * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is\n * permanently removed from the storage account. If the storage account's soft delete feature is\n * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible\n * immediately. However, the blob service retains the blob or snapshot for the number of days specified\n * by the DeleteRetentionPolicy section of [Storage service properties]\n * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is\n * permanently removed from the storage account. Note that you continue to be charged for the\n * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the\n * \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You\n * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a\n * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404\n * (ResourceNotFound).\n * @param options The options parameters.\n */\n delete(options?: BlobDeleteOptionalParams): Promise<BlobDeleteResponse>;\n /**\n * Undelete a blob that was previously soft deleted\n * @param options The options parameters.\n */\n undelete(options?: BlobUndeleteOptionalParams): Promise<BlobUndeleteResponse>;\n /**\n * Sets the time a blob will expire and be deleted.\n * @param expiryOptions Required. Indicates mode of the expiry time\n * @param options The options parameters.\n */\n setExpiry(\n expiryOptions: BlobExpiryOptions,\n options?: BlobSetExpiryOptionalParams\n ): Promise<BlobSetExpiryResponse>;\n /**\n * The Set HTTP Headers operation sets system properties on the blob\n * @param options The options parameters.\n */\n setHttpHeaders(\n options?: BlobSetHttpHeadersOptionalParams\n ): Promise<BlobSetHttpHeadersResponse>;\n /**\n * The Set Immutability Policy operation sets the immutability policy on the blob\n * @param options The options parameters.\n */\n setImmutabilityPolicy(\n options?: BlobSetImmutabilityPolicyOptionalParams\n ): Promise<BlobSetImmutabilityPolicyResponse>;\n /**\n * The Delete Immutability Policy operation deletes the immutability policy on the blob\n * @param options The options parameters.\n */\n deleteImmutabilityPolicy(\n options?: BlobDeleteImmutabilityPolicyOptionalParams\n ): Promise<BlobDeleteImmutabilityPolicyResponse>;\n /**\n * The Set Legal Hold operation sets a legal hold on the blob.\n * @param legalHold Specified if a legal hold should be set on the blob.\n * @param options The options parameters.\n */\n setLegalHold(\n legalHold: boolean,\n options?: BlobSetLegalHoldOptionalParams\n ): Promise<BlobSetLegalHoldResponse>;\n /**\n * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more\n * name-value pairs\n * @param options The options parameters.\n */\n setMetadata(\n options?: BlobSetMetadataOptionalParams\n ): Promise<BlobSetMetadataResponse>;\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param options The options parameters.\n */\n acquireLease(\n options?: BlobAcquireLeaseOptionalParams\n ): Promise<BlobAcquireLeaseResponse>;\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n releaseLease(\n leaseId: string,\n options?: BlobReleaseLeaseOptionalParams\n ): Promise<BlobReleaseLeaseResponse>;\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n renewLease(\n leaseId: string,\n options?: BlobRenewLeaseOptionalParams\n ): Promise<BlobRenewLeaseResponse>;\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param leaseId Specifies the current lease ID on the resource.\n * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400\n * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor\n * (String) for a list of valid GUID string formats.\n * @param options The options parameters.\n */\n changeLease(\n leaseId: string,\n proposedLeaseId: string,\n options?: BlobChangeLeaseOptionalParams\n ): Promise<BlobChangeLeaseResponse>;\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param options The options parameters.\n */\n breakLease(\n options?: BlobBreakLeaseOptionalParams\n ): Promise<BlobBreakLeaseResponse>;\n /**\n * The Create Snapshot operation creates a read-only snapshot of a blob\n * @param options The options parameters.\n */\n createSnapshot(\n options?: BlobCreateSnapshotOptionalParams\n ): Promise<BlobCreateSnapshotResponse>;\n /**\n * The Start Copy From URL operation copies a blob or an internet resource to a new blob.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n startCopyFromURL(\n copySource: string,\n options?: BlobStartCopyFromURLOptionalParams\n ): Promise<BlobStartCopyFromURLResponse>;\n /**\n * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return\n * a response until the copy is complete.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n copyFromURL(\n copySource: string,\n options?: BlobCopyFromURLOptionalParams\n ): Promise<BlobCopyFromURLResponse>;\n /**\n * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination\n * blob with zero length and full metadata.\n * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob\n * operation.\n * @param options The options parameters.\n */\n abortCopyFromURL(\n copyId: string,\n options?: BlobAbortCopyFromURLOptionalParams\n ): Promise<BlobAbortCopyFromURLResponse>;\n /**\n * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant storage only). A\n * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block\n * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's\n * ETag.\n * @param tier Indicates the tier to be set on the blob.\n * @param options The options parameters.\n */\n setTier(\n tier: AccessTier,\n options?: BlobSetTierOptionalParams\n ): Promise<BlobSetTierResponse>;\n /**\n * Returns the sku name and account kind\n * @param options The options parameters.\n */\n getAccountInfo(\n options?: BlobGetAccountInfoOptionalParams\n ): Promise<BlobGetAccountInfoResponse>;\n /**\n * The Query operation enables users to select/project on blob data by providing simple query\n * expressions.\n * @param options The options parameters.\n */\n query(options?: BlobQueryOptionalParams): Promise<BlobQueryResponse>;\n /**\n * The Get Tags operation enables users to get the tags associated with a blob.\n * @param options The options parameters.\n */\n getTags(options?: BlobGetTagsOptionalParams): Promise<BlobGetTagsResponse>;\n /**\n * The Set Tags operation enables users to set tags on a blob.\n * @param options The options parameters.\n */\n setTags(options?: BlobSetTagsOptionalParams): Promise<BlobSetTagsResponse>;\n}\n"]}
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export {};
9
- //# sourceMappingURL=blockBlob.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockBlob.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/blockBlob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n BlockBlobUploadOptionalParams,\n BlockBlobUploadResponse,\n BlockBlobPutBlobFromUrlOptionalParams,\n BlockBlobPutBlobFromUrlResponse,\n BlockBlobStageBlockOptionalParams,\n BlockBlobStageBlockResponse,\n BlockBlobStageBlockFromURLOptionalParams,\n BlockBlobStageBlockFromURLResponse,\n BlockLookupList,\n BlockBlobCommitBlockListOptionalParams,\n BlockBlobCommitBlockListResponse,\n BlockListType,\n BlockBlobGetBlockListOptionalParams,\n BlockBlobGetBlockListResponse\n} from \"../models\";\n\n/** Interface representing a BlockBlob. */\nexport interface BlockBlob {\n /**\n * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing\n * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put\n * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a\n * partial update of the content of a block blob, use the Put Block List operation.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n upload(\n contentLength: number,\n body: coreRestPipeline.RequestBodyType,\n options?: BlockBlobUploadOptionalParams\n ): Promise<BlockBlobUploadResponse>;\n /**\n * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read\n * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are\n * not supported with Put Blob from URL; the content of an existing blob is overwritten with the\n * content of the new blob. To perform partial updates to a block blob’s contents using a source URL,\n * use the Put Block from URL API in conjunction with Put Block List.\n * @param contentLength The length of the request.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n putBlobFromUrl(\n contentLength: number,\n copySource: string,\n options?: BlockBlobPutBlobFromUrlOptionalParams\n ): Promise<BlockBlobPutBlobFromUrlResponse>;\n /**\n * The Stage Block operation creates a new block to be committed as part of a blob\n * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string\n * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified\n * for the blockid parameter must be the same size for each block.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n stageBlock(\n blockId: string,\n contentLength: number,\n body: coreRestPipeline.RequestBodyType,\n options?: BlockBlobStageBlockOptionalParams\n ): Promise<BlockBlobStageBlockResponse>;\n /**\n * The Stage Block operation creates a new block to be committed as part of a blob where the contents\n * are read from a URL.\n * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string\n * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified\n * for the blockid parameter must be the same size for each block.\n * @param contentLength The length of the request.\n * @param sourceUrl Specify a URL to the copy source.\n * @param options The options parameters.\n */\n stageBlockFromURL(\n blockId: string,\n contentLength: number,\n sourceUrl: string,\n options?: BlockBlobStageBlockFromURLOptionalParams\n ): Promise<BlockBlobStageBlockFromURLResponse>;\n /**\n * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the\n * blob. In order to be written as part of a blob, a block must have been successfully written to the\n * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading\n * only those blocks that have changed, then committing the new and existing blocks together. You can\n * do this by specifying whether to commit a block from the committed block list or from the\n * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list\n * it may belong to.\n * @param blocks Blob Blocks.\n * @param options The options parameters.\n */\n commitBlockList(\n blocks: BlockLookupList,\n options?: BlockBlobCommitBlockListOptionalParams\n ): Promise<BlockBlobCommitBlockListResponse>;\n /**\n * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block\n * blob\n * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted\n * blocks, or both lists together.\n * @param options The options parameters.\n */\n getBlockList(\n listType: BlockListType,\n options?: BlockBlobGetBlockListOptionalParams\n ): Promise<BlockBlobGetBlockListResponse>;\n}\n"]}
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export {};
9
- //# sourceMappingURL=container.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"container.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/container.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n ContainerCreateOptionalParams,\n ContainerCreateResponse,\n ContainerGetPropertiesOptionalParams,\n ContainerGetPropertiesResponse,\n ContainerDeleteOptionalParams,\n ContainerDeleteResponse,\n ContainerSetMetadataOptionalParams,\n ContainerSetMetadataResponse,\n ContainerGetAccessPolicyOptionalParams,\n ContainerGetAccessPolicyResponse,\n ContainerSetAccessPolicyOptionalParams,\n ContainerSetAccessPolicyResponse,\n ContainerRestoreOptionalParams,\n ContainerRestoreResponse,\n ContainerRenameOptionalParams,\n ContainerRenameResponse,\n ContainerSubmitBatchOptionalParams,\n ContainerSubmitBatchResponse,\n ContainerFilterBlobsOptionalParams,\n ContainerFilterBlobsResponse,\n ContainerAcquireLeaseOptionalParams,\n ContainerAcquireLeaseResponse,\n ContainerReleaseLeaseOptionalParams,\n ContainerReleaseLeaseResponse,\n ContainerRenewLeaseOptionalParams,\n ContainerRenewLeaseResponse,\n ContainerBreakLeaseOptionalParams,\n ContainerBreakLeaseResponse,\n ContainerChangeLeaseOptionalParams,\n ContainerChangeLeaseResponse,\n ContainerListBlobFlatSegmentOptionalParams,\n ContainerListBlobFlatSegmentResponse,\n ContainerListBlobHierarchySegmentOptionalParams,\n ContainerListBlobHierarchySegmentResponse,\n ContainerGetAccountInfoOptionalParams,\n ContainerGetAccountInfoResponse\n} from \"../models\";\n\n/** Interface representing a Container. */\nexport interface Container {\n /**\n * creates a new container under the specified account. If the container with the same name already\n * exists, the operation fails\n * @param options The options parameters.\n */\n create(\n options?: ContainerCreateOptionalParams\n ): Promise<ContainerCreateResponse>;\n /**\n * returns all user-defined metadata and system properties for the specified container. The data\n * returned does not include the container's list of blobs\n * @param options The options parameters.\n */\n getProperties(\n options?: ContainerGetPropertiesOptionalParams\n ): Promise<ContainerGetPropertiesResponse>;\n /**\n * operation marks the specified container for deletion. The container and any blobs contained within\n * it are later deleted during garbage collection\n * @param options The options parameters.\n */\n delete(\n options?: ContainerDeleteOptionalParams\n ): Promise<ContainerDeleteResponse>;\n /**\n * operation sets one or more user-defined name-value pairs for the specified container.\n * @param options The options parameters.\n */\n setMetadata(\n options?: ContainerSetMetadataOptionalParams\n ): Promise<ContainerSetMetadataResponse>;\n /**\n * gets the permissions for the specified container. The permissions indicate whether container data\n * may be accessed publicly.\n * @param options The options parameters.\n */\n getAccessPolicy(\n options?: ContainerGetAccessPolicyOptionalParams\n ): Promise<ContainerGetAccessPolicyResponse>;\n /**\n * sets the permissions for the specified container. The permissions indicate whether blobs in a\n * container may be accessed publicly.\n * @param options The options parameters.\n */\n setAccessPolicy(\n options?: ContainerSetAccessPolicyOptionalParams\n ): Promise<ContainerSetAccessPolicyResponse>;\n /**\n * Restores a previously-deleted container.\n * @param options The options parameters.\n */\n restore(\n options?: ContainerRestoreOptionalParams\n ): Promise<ContainerRestoreResponse>;\n /**\n * Renames an existing container.\n * @param sourceContainerName Required. Specifies the name of the container to rename.\n * @param options The options parameters.\n */\n rename(\n sourceContainerName: string,\n options?: ContainerRenameOptionalParams\n ): Promise<ContainerRenameResponse>;\n /**\n * The Batch operation allows multiple API calls to be embedded into a single HTTP request.\n * @param contentLength The length of the request.\n * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch\n * boundary. Example header value: multipart/mixed; boundary=batch_<GUID>\n * @param body Initial data\n * @param options The options parameters.\n */\n submitBatch(\n contentLength: number,\n multipartContentType: string,\n body: coreRestPipeline.RequestBodyType,\n options?: ContainerSubmitBatchOptionalParams\n ): Promise<ContainerSubmitBatchResponse>;\n /**\n * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given\n * search expression. Filter blobs searches within the given container.\n * @param options The options parameters.\n */\n filterBlobs(\n options?: ContainerFilterBlobsOptionalParams\n ): Promise<ContainerFilterBlobsResponse>;\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param options The options parameters.\n */\n acquireLease(\n options?: ContainerAcquireLeaseOptionalParams\n ): Promise<ContainerAcquireLeaseResponse>;\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n releaseLease(\n leaseId: string,\n options?: ContainerReleaseLeaseOptionalParams\n ): Promise<ContainerReleaseLeaseResponse>;\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n renewLease(\n leaseId: string,\n options?: ContainerRenewLeaseOptionalParams\n ): Promise<ContainerRenewLeaseResponse>;\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param options The options parameters.\n */\n breakLease(\n options?: ContainerBreakLeaseOptionalParams\n ): Promise<ContainerBreakLeaseResponse>;\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param leaseId Specifies the current lease ID on the resource.\n * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400\n * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor\n * (String) for a list of valid GUID string formats.\n * @param options The options parameters.\n */\n changeLease(\n leaseId: string,\n proposedLeaseId: string,\n options?: ContainerChangeLeaseOptionalParams\n ): Promise<ContainerChangeLeaseResponse>;\n /**\n * [Update] The List Blobs operation returns a list of the blobs under the specified container\n * @param options The options parameters.\n */\n listBlobFlatSegment(\n options?: ContainerListBlobFlatSegmentOptionalParams\n ): Promise<ContainerListBlobFlatSegmentResponse>;\n /**\n * [Update] The List Blobs operation returns a list of the blobs under the specified container\n * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix\n * element in the response body that acts as a placeholder for all blobs whose names begin with the\n * same substring up to the appearance of the delimiter character. The delimiter may be a single\n * character or a string.\n * @param options The options parameters.\n */\n listBlobHierarchySegment(\n delimiter: string,\n options?: ContainerListBlobHierarchySegmentOptionalParams\n ): Promise<ContainerListBlobHierarchySegmentResponse>;\n /**\n * Returns the sku name and account kind\n * @param options The options parameters.\n */\n getAccountInfo(\n options?: ContainerGetAccountInfoOptionalParams\n ): Promise<ContainerGetAccountInfoResponse>;\n}\n"]}
@@ -1,14 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export * from "./service";
9
- export * from "./container";
10
- export * from "./blob";
11
- export * from "./pageBlob";
12
- export * from "./appendBlob";
13
- export * from "./blockBlob";
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./service\";\nexport * from \"./container\";\nexport * from \"./blob\";\nexport * from \"./pageBlob\";\nexport * from \"./appendBlob\";\nexport * from \"./blockBlob\";\n"]}
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export {};
9
- //# sourceMappingURL=pageBlob.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageBlob.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/pageBlob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PageBlobCreateOptionalParams,\n PageBlobCreateResponse,\n PageBlobUploadPagesOptionalParams,\n PageBlobUploadPagesResponse,\n PageBlobClearPagesOptionalParams,\n PageBlobClearPagesResponse,\n PageBlobUploadPagesFromURLOptionalParams,\n PageBlobUploadPagesFromURLResponse,\n PageBlobGetPageRangesOptionalParams,\n PageBlobGetPageRangesResponse,\n PageBlobGetPageRangesDiffOptionalParams,\n PageBlobGetPageRangesDiffResponse,\n PageBlobResizeOptionalParams,\n PageBlobResizeResponse,\n SequenceNumberActionType,\n PageBlobUpdateSequenceNumberOptionalParams,\n PageBlobUpdateSequenceNumberResponse,\n PageBlobCopyIncrementalOptionalParams,\n PageBlobCopyIncrementalResponse\n} from \"../models\";\n\n/** Interface representing a PageBlob. */\nexport interface PageBlob {\n /**\n * The Create operation creates a new page blob.\n * @param contentLength The length of the request.\n * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The\n * page blob size must be aligned to a 512-byte boundary.\n * @param options The options parameters.\n */\n create(\n contentLength: number,\n blobContentLength: number,\n options?: PageBlobCreateOptionalParams\n ): Promise<PageBlobCreateResponse>;\n /**\n * The Upload Pages operation writes a range of pages to a page blob\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n uploadPages(\n contentLength: number,\n body: coreRestPipeline.RequestBodyType,\n options?: PageBlobUploadPagesOptionalParams\n ): Promise<PageBlobUploadPagesResponse>;\n /**\n * The Clear Pages operation clears a set of pages from a page blob\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n clearPages(\n contentLength: number,\n options?: PageBlobClearPagesOptionalParams\n ): Promise<PageBlobClearPagesResponse>;\n /**\n * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a\n * URL\n * @param sourceUrl Specify a URL to the copy source.\n * @param sourceRange Bytes of source data in the specified range. The length of this range should\n * match the ContentLength header and x-ms-range/Range destination range header.\n * @param contentLength The length of the request.\n * @param range The range of bytes to which the source range would be written. The range should be 512\n * aligned and range-end is required.\n * @param options The options parameters.\n */\n uploadPagesFromURL(\n sourceUrl: string,\n sourceRange: string,\n contentLength: number,\n range: string,\n options?: PageBlobUploadPagesFromURLOptionalParams\n ): Promise<PageBlobUploadPagesFromURLResponse>;\n /**\n * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a\n * page blob\n * @param options The options parameters.\n */\n getPageRanges(\n options?: PageBlobGetPageRangesOptionalParams\n ): Promise<PageBlobGetPageRangesResponse>;\n /**\n * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were\n * changed between target blob and previous snapshot.\n * @param options The options parameters.\n */\n getPageRangesDiff(\n options?: PageBlobGetPageRangesDiffOptionalParams\n ): Promise<PageBlobGetPageRangesDiffResponse>;\n /**\n * Resize the Blob\n * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The\n * page blob size must be aligned to a 512-byte boundary.\n * @param options The options parameters.\n */\n resize(\n blobContentLength: number,\n options?: PageBlobResizeOptionalParams\n ): Promise<PageBlobResizeResponse>;\n /**\n * Update the sequence number of the blob\n * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request.\n * This property applies to page blobs only. This property indicates how the service should modify the\n * blob's sequence number\n * @param options The options parameters.\n */\n updateSequenceNumber(\n sequenceNumberAction: SequenceNumberActionType,\n options?: PageBlobUpdateSequenceNumberOptionalParams\n ): Promise<PageBlobUpdateSequenceNumberResponse>;\n /**\n * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob.\n * The snapshot is copied such that only the differential changes between the previously copied\n * snapshot are transferred to the destination. The copied snapshots are complete copies of the\n * original snapshot and can be read or copied from as usual. This API is supported since REST version\n * 2016-05-31.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n copyIncremental(\n copySource: string,\n options?: PageBlobCopyIncrementalOptionalParams\n ): Promise<PageBlobCopyIncrementalResponse>;\n}\n"]}
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- export {};
9
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../../src/generated/src/operationsInterfaces/service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n BlobServiceProperties,\n ServiceSetPropertiesOptionalParams,\n ServiceSetPropertiesResponse,\n ServiceGetPropertiesOptionalParams,\n ServiceGetPropertiesResponse,\n ServiceGetStatisticsOptionalParams,\n ServiceGetStatisticsResponse,\n ServiceListContainersSegmentOptionalParams,\n ServiceListContainersSegmentResponse,\n KeyInfo,\n ServiceGetUserDelegationKeyOptionalParams,\n ServiceGetUserDelegationKeyResponse,\n ServiceGetAccountInfoOptionalParams,\n ServiceGetAccountInfoResponse,\n ServiceSubmitBatchOptionalParams,\n ServiceSubmitBatchResponse,\n ServiceFilterBlobsOptionalParams,\n ServiceFilterBlobsResponse\n} from \"../models\";\n\n/** Interface representing a Service. */\nexport interface Service {\n /**\n * Sets properties for a storage account's Blob service endpoint, including properties for Storage\n * Analytics and CORS (Cross-Origin Resource Sharing) rules\n * @param blobServiceProperties The StorageService properties.\n * @param options The options parameters.\n */\n setProperties(\n blobServiceProperties: BlobServiceProperties,\n options?: ServiceSetPropertiesOptionalParams\n ): Promise<ServiceSetPropertiesResponse>;\n /**\n * gets the properties of a storage account's Blob service, including properties for Storage Analytics\n * and CORS (Cross-Origin Resource Sharing) rules.\n * @param options The options parameters.\n */\n getProperties(\n options?: ServiceGetPropertiesOptionalParams\n ): Promise<ServiceGetPropertiesResponse>;\n /**\n * Retrieves statistics related to replication for the Blob service. It is only available on the\n * secondary location endpoint when read-access geo-redundant replication is enabled for the storage\n * account.\n * @param options The options parameters.\n */\n getStatistics(\n options?: ServiceGetStatisticsOptionalParams\n ): Promise<ServiceGetStatisticsResponse>;\n /**\n * The List Containers Segment operation returns a list of the containers under the specified account\n * @param options The options parameters.\n */\n listContainersSegment(\n options?: ServiceListContainersSegmentOptionalParams\n ): Promise<ServiceListContainersSegmentResponse>;\n /**\n * Retrieves a user delegation key for the Blob service. This is only a valid operation when using\n * bearer token authentication.\n * @param keyInfo Key information\n * @param options The options parameters.\n */\n getUserDelegationKey(\n keyInfo: KeyInfo,\n options?: ServiceGetUserDelegationKeyOptionalParams\n ): Promise<ServiceGetUserDelegationKeyResponse>;\n /**\n * Returns the sku name and account kind\n * @param options The options parameters.\n */\n getAccountInfo(\n options?: ServiceGetAccountInfoOptionalParams\n ): Promise<ServiceGetAccountInfoResponse>;\n /**\n * The Batch operation allows multiple API calls to be embedded into a single HTTP request.\n * @param contentLength The length of the request.\n * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch\n * boundary. Example header value: multipart/mixed; boundary=batch_<GUID>\n * @param body Initial data\n * @param options The options parameters.\n */\n submitBatch(\n contentLength: number,\n multipartContentType: string,\n body: coreRestPipeline.RequestBodyType,\n options?: ServiceSubmitBatchOptionalParams\n ): Promise<ServiceSubmitBatchResponse>;\n /**\n * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a\n * given search expression. Filter blobs searches across all containers within a storage account but\n * can be scoped within the expression to a single container.\n * @param options The options parameters.\n */\n filterBlobs(\n options?: ServiceFilterBlobsOptionalParams\n ): Promise<ServiceFilterBlobsResponse>;\n}\n"]}
@@ -1,25 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- /**
4
- * The programmatic identifier of the pathParameterWorkaroundPolicy.
5
- */
6
- export const pathParameterWorkaroundPolicyName = "pathParameterWorkaroundPolicy";
7
- /**
8
- * pathParameterWorkaroundPolicy works around a generator issue with path parameters being
9
- * left in the URL.
10
- */
11
- export function pathParameterWorkaroundPolicy() {
12
- return {
13
- name: pathParameterWorkaroundPolicyName,
14
- async sendRequest(request, next) {
15
- if (request.url.includes("/%7BcontainerName%7D/%7Bblob%7D")) {
16
- request.url = request.url.replace("/%7BcontainerName%7D/%7Bblob%7D", "");
17
- }
18
- else if (request.url.includes("/%7BcontainerName%7D")) {
19
- request.url = request.url.replace("/%7BcontainerName%7D", "");
20
- }
21
- return next(request);
22
- },
23
- };
24
- }
25
- //# sourceMappingURL=PathParameterWorkaroundPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PathParameterWorkaroundPolicy.js","sourceRoot":"","sources":["../../../../src/policies/PathParameterWorkaroundPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,+BAA+B,CAAC;AAEjF;;;GAGG;AACH,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,iCAAiC;QACvC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EAAE;gBAC3D,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;aAC1E;iBAAM,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;gBACvD,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;aAC/D;YACD,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 {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * The programmatic identifier of the pathParameterWorkaroundPolicy.\n */\nexport const pathParameterWorkaroundPolicyName = \"pathParameterWorkaroundPolicy\";\n\n/**\n * pathParameterWorkaroundPolicy works around a generator issue with path parameters being\n * left in the URL.\n */\nexport function pathParameterWorkaroundPolicy(): PipelinePolicy {\n return {\n name: pathParameterWorkaroundPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (request.url.includes(\"/%7BcontainerName%7D/%7Bblob%7D\")) {\n request.url = request.url.replace(\"/%7BcontainerName%7D/%7Bblob%7D\", \"\");\n } else if (request.url.includes(\"/%7BcontainerName%7D\")) {\n request.url = request.url.replace(\"/%7BcontainerName%7D\", \"\");\n }\n return next(request);\n },\n };\n}\n"]}
@@ -1,40 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- /**
4
- * The base class from which all request policies derive.
5
- */
6
- export class BaseRequestPolicy {
7
- /**
8
- * The main method to implement that manipulates a request/response.
9
- */
10
- constructor(
11
- /**
12
- * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
13
- */
14
- _nextPolicy,
15
- /**
16
- * The options that can be passed to a given request policy.
17
- */
18
- _options) {
19
- this._nextPolicy = _nextPolicy;
20
- this._options = _options;
21
- }
22
- /**
23
- * Get whether or not a log with the provided log level should be logged.
24
- * @param logLevel - The log level of the log that will be logged.
25
- * @returns Whether or not a log with the provided log level should be logged.
26
- */
27
- shouldLog(logLevel) {
28
- return this._options.shouldLog(logLevel);
29
- }
30
- /**
31
- * Attempt to log the provided message to the provided logger. If no logger was provided or if
32
- * the log level does not meat the logger's threshold, then nothing will be logged.
33
- * @param logLevel - The log level of this log.
34
- * @param message - The message of this log.
35
- */
36
- log(logLevel, message) {
37
- this._options.log(logLevel, message);
38
- }
39
- }
40
- //# sourceMappingURL=RequestPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequestPolicy.js","sourceRoot":"","sources":["../../../../src/policies/RequestPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;GAEG;AACH,MAAM,OAAgB,iBAAiB;IACrC;;OAEG;IACH;IACE;;OAEG;IACM,WAA0B;IACnC;;OAEG;IACM,QAAkC;QAJlC,gBAAW,GAAX,WAAW,CAAe;QAI1B,aAAQ,GAAR,QAAQ,CAA0B;IAC1C,CAAC;IAQJ;;;;OAIG;IACI,SAAS,CAAC,QAA8B;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,GAAG,CAAC,QAA8B,EAAE,OAAe;QACxD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n HttpPipelineLogLevel,\n RequestPolicy,\n RequestPolicyOptionsLike,\n WebResourceLike,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\n\n/**\n * The base class from which all request policies derive.\n */\nexport abstract class BaseRequestPolicy implements RequestPolicy {\n /**\n * The main method to implement that manipulates a request/response.\n */\n protected constructor(\n /**\n * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.\n */\n readonly _nextPolicy: RequestPolicy,\n /**\n * The options that can be passed to a given request policy.\n */\n readonly _options: RequestPolicyOptionsLike\n ) {}\n\n /**\n * Sends a network request based on the given web resource.\n * @param webResource - A {@link WebResourceLike} that describes a HTTP request to be made.\n */\n public abstract sendRequest(webResource: WebResourceLike): Promise<HttpOperationResponse>;\n\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n public shouldLog(logLevel: HttpPipelineLogLevel): boolean {\n return this._options.shouldLog(logLevel);\n }\n\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meat the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n public log(logLevel: HttpPipelineLogLevel, message: string): void {\n this._options.log(logLevel, message);\n }\n}\n"]}
@@ -1,31 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { isNode } from "@azure/core-util";
4
- import { HeaderConstants, URLConstants } from "../utils/constants";
5
- import { setURLParameter } from "../utils/utils.common";
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 (isNode) {
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageBrowserPolicyV2.js","sourceRoot":"","sources":["../../../../src/policies/StorageBrowserPolicyV2.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;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,MAAM,EAAE;gBACV,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;aACtB;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;gBACzD,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;aACH;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 {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { isNode } from \"@azure/core-util\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants\";\nimport { setURLParameter } from \"../utils/utils.common\";\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 (isNode) {\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"]}
@@ -1,165 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { AbortError } from "@azure/abort-controller";
4
- import { isRestError, RestError, } from "@azure/core-rest-pipeline";
5
- import { getErrorMessage } from "@azure/core-util";
6
- import { URLConstants } from "../utils/constants";
7
- import { delay, setURLHost, setURLParameter } from "../utils/utils.common";
8
- import { logger } from "../log";
9
- /**
10
- * Name of the {@link storageRetryPolicy}
11
- */
12
- export const storageRetryPolicyName = "storageRetryPolicy";
13
- /**
14
- * RetryPolicy types.
15
- */
16
- export var StorageRetryPolicyType;
17
- (function (StorageRetryPolicyType) {
18
- /**
19
- * Exponential retry. Retry time delay grows exponentially.
20
- */
21
- StorageRetryPolicyType[StorageRetryPolicyType["EXPONENTIAL"] = 0] = "EXPONENTIAL";
22
- /**
23
- * Linear retry. Retry time delay grows linearly.
24
- */
25
- StorageRetryPolicyType[StorageRetryPolicyType["FIXED"] = 1] = "FIXED";
26
- })(StorageRetryPolicyType || (StorageRetryPolicyType = {}));
27
- // Default values of StorageRetryOptions
28
- const DEFAULT_RETRY_OPTIONS = {
29
- maxRetryDelayInMs: 120 * 1000,
30
- maxTries: 4,
31
- retryDelayInMs: 4 * 1000,
32
- retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,
33
- secondaryHost: "",
34
- tryTimeoutInMs: undefined, // Use server side default timeout strategy
35
- };
36
- const retriableErrors = [
37
- "ETIMEDOUT",
38
- "ESOCKETTIMEDOUT",
39
- "ECONNREFUSED",
40
- "ECONNRESET",
41
- "ENOENT",
42
- "ENOTFOUND",
43
- "TIMEOUT",
44
- "EPIPE",
45
- "REQUEST_SEND_ERROR",
46
- ];
47
- const RETRY_ABORT_ERROR = new AbortError("The operation was aborted.");
48
- /**
49
- * Retry policy with exponential retry and linear retry implemented.
50
- */
51
- export function storageRetryPolicy(options = {}) {
52
- var _a, _b, _c, _d, _e, _f;
53
- const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType;
54
- const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries;
55
- const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs;
56
- const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;
57
- const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost;
58
- const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
59
- function shouldRetry({ isPrimaryRetry, attempt, response, error, }) {
60
- var _a, _b;
61
- if (attempt >= maxTries) {
62
- logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);
63
- return false;
64
- }
65
- if (error) {
66
- for (const retriableError of retriableErrors) {
67
- if (error.name.toUpperCase().includes(retriableError) ||
68
- error.message.toUpperCase().includes(retriableError) ||
69
- (error.code && error.code.toString().toUpperCase() === retriableError)) {
70
- logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
71
- return true;
72
- }
73
- }
74
- if ((error === null || error === void 0 ? void 0 : error.code) === "PARSE_ERROR" &&
75
- (error === null || error === void 0 ? void 0 : error.message.startsWith(`Error "Error: Unclosed root tag`))) {
76
- logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
77
- return true;
78
- }
79
- }
80
- // 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
- if (response || error) {
84
- const statusCode = (_b = (_a = response === null || response === void 0 ? void 0 : response.status) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.statusCode) !== null && _b !== void 0 ? _b : 0;
85
- if (!isPrimaryRetry && statusCode === 404) {
86
- logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
87
- return true;
88
- }
89
- // Server internal error or server timeout
90
- if (statusCode === 503 || statusCode === 500) {
91
- logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
92
- return true;
93
- }
94
- }
95
- return false;
96
- }
97
- function calculateDelay(isPrimaryRetry, attempt) {
98
- let delayTimeInMs = 0;
99
- if (isPrimaryRetry) {
100
- switch (retryPolicyType) {
101
- case StorageRetryPolicyType.EXPONENTIAL:
102
- delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs);
103
- break;
104
- case StorageRetryPolicyType.FIXED:
105
- delayTimeInMs = retryDelayInMs;
106
- break;
107
- }
108
- }
109
- else {
110
- delayTimeInMs = Math.random() * 1000;
111
- }
112
- logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
113
- return delayTimeInMs;
114
- }
115
- return {
116
- name: storageRetryPolicyName,
117
- async sendRequest(request, next) {
118
- // Set the server-side timeout query parameter "timeout=[seconds]"
119
- if (tryTimeoutInMs) {
120
- request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1000)));
121
- }
122
- const primaryUrl = request.url;
123
- const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : undefined;
124
- let secondaryHas404 = false;
125
- let attempt = 1;
126
- let retryAgain = true;
127
- let response;
128
- let error;
129
- while (retryAgain) {
130
- const isPrimaryRetry = secondaryHas404 ||
131
- !secondaryUrl ||
132
- !["GET", "HEAD", "OPTIONS"].includes(request.method) ||
133
- attempt % 2 === 1;
134
- request.url = isPrimaryRetry ? primaryUrl : secondaryUrl;
135
- response = undefined;
136
- error = undefined;
137
- try {
138
- logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
139
- response = await next(request);
140
- secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
141
- }
142
- catch (e) {
143
- if (isRestError(e)) {
144
- logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`);
145
- error = e;
146
- }
147
- else {
148
- logger.error(`RetryPolicy: Caught error, message: ${getErrorMessage(e)}`);
149
- throw e;
150
- }
151
- }
152
- retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error });
153
- if (retryAgain) {
154
- await delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR);
155
- }
156
- attempt++;
157
- }
158
- if (response) {
159
- return response;
160
- }
161
- throw error !== null && error !== void 0 ? error : new RestError("RetryPolicy failed without known error.");
162
- },
163
- };
164
- }
165
- //# sourceMappingURL=StorageRetryPolicyV2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageRetryPolicyV2.js","sourceRoot":"","sources":["../../../../src/policies/StorageRetryPolicyV2.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortError } from \"@azure/abort-controller\";\nimport {\n PipelinePolicy,\n PipelineRequest,\n SendRequest,\n PipelineResponse,\n isRestError,\n RestError,\n} from \"@azure/core-rest-pipeline\";\nimport { getErrorMessage } from \"@azure/core-util\";\nimport { StorageRetryOptions } from \"../StorageRetryPolicyFactory\";\nimport { URLConstants } from \"../utils/constants\";\nimport { delay, setURLHost, setURLParameter } from \"../utils/utils.common\";\nimport { logger } from \"../log\";\n\n/**\n * Name of the {@link storageRetryPolicy}\n */\nexport const storageRetryPolicyName = \"storageRetryPolicy\";\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\n// Default values of StorageRetryOptions\nconst DEFAULT_RETRY_OPTIONS = {\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} as const;\n\nconst retriableErrors = [\n \"ETIMEDOUT\",\n \"ESOCKETTIMEDOUT\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"ENOENT\",\n \"ENOTFOUND\",\n \"TIMEOUT\",\n \"EPIPE\",\n \"REQUEST_SEND_ERROR\",\n] as const;\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 function storageRetryPolicy(options: StorageRetryOptions = {}): PipelinePolicy {\n const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType;\n const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries;\n const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs;\n const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;\n const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost;\n const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;\n\n function shouldRetry({\n isPrimaryRetry,\n attempt,\n response,\n error,\n }: {\n isPrimaryRetry: boolean;\n attempt: number;\n response?: PipelineResponse;\n error?: RestError;\n }): boolean {\n if (attempt >= maxTries) {\n logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);\n return false;\n }\n if (error) {\n for (const retriableError of retriableErrors) {\n if (\n error.name.toUpperCase().includes(retriableError) ||\n error.message.toUpperCase().includes(retriableError) ||\n (error.code && error.code.toString().toUpperCase() === retriableError)\n ) {\n logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);\n return true;\n }\n }\n if (\n error?.code === \"PARSE_ERROR\" &&\n error?.message.startsWith(`Error \"Error: Unclosed root tag`)\n ) {\n logger.info(\n \"RetryPolicy: Incomplete XML response likely due to service timeout, will retry.\"\n );\n return true;\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 || error) {\n const statusCode = response?.status ?? error?.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 return false;\n }\n function calculateDelay(isPrimaryRetry: boolean, attempt: number): number {\n let delayTimeInMs = 0;\n\n if (isPrimaryRetry) {\n switch (retryPolicyType) {\n case StorageRetryPolicyType.EXPONENTIAL:\n delayTimeInMs = Math.min(\n (Math.pow(2, attempt - 1) - 1) * retryDelayInMs,\n maxRetryDelayInMs\n );\n break;\n case StorageRetryPolicyType.FIXED:\n delayTimeInMs = retryDelayInMs;\n break;\n }\n } else {\n delayTimeInMs = Math.random() * 1000;\n }\n\n logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);\n return delayTimeInMs;\n }\n return {\n name: storageRetryPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // Set the server-side timeout query parameter \"timeout=[seconds]\"\n if (tryTimeoutInMs) {\n request.url = setURLParameter(\n request.url,\n URLConstants.Parameters.TIMEOUT,\n String(Math.floor(tryTimeoutInMs / 1000))\n );\n }\n const primaryUrl = request.url;\n const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : undefined;\n let secondaryHas404 = false;\n let attempt = 1;\n let retryAgain = true;\n let response: PipelineResponse | undefined;\n let error: RestError | undefined;\n while (retryAgain) {\n const isPrimaryRetry: boolean =\n secondaryHas404 ||\n !secondaryUrl ||\n ![\"GET\", \"HEAD\", \"OPTIONS\"].includes(request.method) ||\n attempt % 2 === 1;\n request.url = isPrimaryRetry ? primaryUrl : secondaryUrl!;\n response = undefined;\n error = undefined;\n try {\n logger.info(\n `RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? \"Primary\" : \"Secondary\"}`\n );\n response = await next(request);\n secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);\n } catch (e: unknown) {\n if (isRestError(e)) {\n logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`);\n error = e;\n } else {\n logger.error(`RetryPolicy: Caught error, message: ${getErrorMessage(e)}`);\n throw e;\n }\n }\n retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error });\n if (retryAgain) {\n await delay(\n calculateDelay(isPrimaryRetry, attempt),\n request.abortSignal,\n RETRY_ABORT_ERROR\n );\n }\n attempt++;\n }\n if (response) {\n return response;\n }\n throw error ?? new RestError(\"RetryPolicy failed without known error.\");\n },\n };\n}\n"]}
@@ -1,18 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- /**
4
- * The programmatic identifier of the storageSharedKeyCredentialPolicy.
5
- */
6
- export const storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy";
7
- /**
8
- * storageSharedKeyCredentialPolicy handles signing requests using storage account keys.
9
- */
10
- export function storageSharedKeyCredentialPolicy(_options) {
11
- return {
12
- name: storageSharedKeyCredentialPolicyName,
13
- async sendRequest(request, next) {
14
- return next(request);
15
- },
16
- };
17
- }
18
- //# sourceMappingURL=StorageSharedKeyCredentialPolicyV2.browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageSharedKeyCredentialPolicyV2.browser.js","sourceRoot":"","sources":["../../../../src/policies/StorageSharedKeyCredentialPolicyV2.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,kCAAkC,CAAC;AAUvF;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,QAAiD;IAEjD,OAAO;QACL,IAAI,EAAE,oCAAoC;QAC1C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,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 {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n/**\n * The programmatic identifier of the storageSharedKeyCredentialPolicy.\n */\nexport const storageSharedKeyCredentialPolicyName = \"storageSharedKeyCredentialPolicy\";\n\n/**\n * Options used to configure StorageSharedKeyCredentialPolicy.\n */\nexport interface StorageSharedKeyCredentialPolicyOptions {\n accountName: string;\n accountKey: Buffer;\n}\n\n/**\n * storageSharedKeyCredentialPolicy handles signing requests using storage account keys.\n */\nexport function storageSharedKeyCredentialPolicy(\n _options: StorageSharedKeyCredentialPolicyOptions\n): PipelinePolicy {\n return {\n name: storageSharedKeyCredentialPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n return next(request);\n },\n };\n}\n"]}