From 33a3d04a76d3b16e2d38c42a9a4c896c2f149c5b Mon Sep 17 00:00:00 2001 From: bzhang0 Date: Thu, 11 Nov 2021 23:21:06 -0800 Subject: [PATCH 1/2] sdk/storage/storage-blob --- .../storage-blob/src/BatchResponseParser.ts | 9 +-- sdk/storage/storage-blob/src/BatchUtils.ts | 2 +- sdk/storage/storage-blob/src/BlobBatch.ts | 20 ++--- .../storage-blob/src/BlobBatchClient.ts | 18 ++--- .../storage-blob/src/BlobDownloadResponse.ts | 10 +-- .../storage-blob/src/BlobLeaseClient.ts | 19 ++--- .../src/BlobQueryResponse.browser.ts | 5 +- .../storage-blob/src/BlobQueryResponse.ts | 5 +- .../storage-blob/src/BlobServiceClient.ts | 48 +++++------ sdk/storage/storage-blob/src/Clients.ts | 81 ++++++++----------- .../storage-blob/src/ContainerClient.ts | 58 ++++++------- .../storage-blob/src/PageBlobRangeResponse.ts | 2 +- sdk/storage/storage-blob/src/Pipeline.ts | 13 ++- sdk/storage/storage-blob/src/StorageClient.ts | 10 +-- .../src/TelemetryPolicyFactory.ts | 5 +- .../credentials/StorageSharedKeyCredential.ts | 5 +- .../UserDelegationKeyCredential.ts | 2 +- sdk/storage/storage-blob/src/models.ts | 2 +- .../src/policies/StorageRetryPolicy.ts | 6 +- .../StorageSharedKeyCredentialPolicy.ts | 4 +- .../src/pollers/BlobStartCopyFromUrlPoller.ts | 4 +- .../src/sas/AccountSASSignatureValues.ts | 6 +- .../src/sas/BlobSASSignatureValues.ts | 9 ++- .../src/sas/SASQueryParameters.ts | 2 +- .../src/utils/BlobQuickQueryStream.ts | 8 +- .../src/utils/RetriableReadableStream.ts | 2 +- .../storage-blob/src/utils/utils.common.ts | 11 +-- sdk/storage/storage-blob/test/aborter.spec.ts | 8 +- .../test/appendblobclient.spec.ts | 5 +- .../storage-blob/test/blobbatch.spec.ts | 20 ++--- .../storage-blob/test/blobclient.spec.ts | 27 ++++--- .../test/blobclientpollers.spec.ts | 8 +- .../test/blobserviceclient.spec.ts | 8 +- .../storage-blob/test/blobversioning.spec.ts | 9 ++- .../storage-blob/test/blockblobclient.spec.ts | 8 +- .../test/browser/highlevel.browser.spec.ts | 7 +- .../storage-blob/test/containerclient.spec.ts | 16 ++-- .../storage-blob/test/encrytion.spec.ts | 7 +- .../storage-blob/test/leaseclient.spec.ts | 6 +- .../test/node/appendblobclient.spec.ts | 7 +- .../storage-blob/test/node/blobclient.spec.ts | 14 ++-- .../test/node/blobserviceclient.spec.ts | 6 +- .../test/node/blockblobclient.spec.ts | 29 ++++--- .../test/node/containerclient.spec.ts | 9 +-- .../test/node/emulator-tests.spec.ts | 5 +- .../test/node/highlevel.node.spec.ts | 15 ++-- .../test/node/pageblobclient.spec.ts | 23 +++--- .../storage-blob/test/node/sas.spec.ts | 5 +- .../storage-blob/test/node/utils.spec.ts | 13 ++- .../storage-blob/test/pageblobclient.spec.ts | 17 ++-- .../storage-blob/test/retrypolicy.spec.ts | 13 ++- .../storage-blob/test/specialnaming.spec.ts | 9 ++- sdk/storage/storage-blob/test/utils.spec.ts | 3 +- .../test/utils/InjectorPolicyFactory.ts | 2 +- .../storage-blob/test/utils/index.browser.ts | 2 +- sdk/storage/storage-blob/test/utils/index.ts | 17 ++-- 56 files changed, 313 insertions(+), 371 deletions(-) diff --git a/sdk/storage/storage-blob/src/BatchResponseParser.ts b/sdk/storage/storage-blob/src/BatchResponseParser.ts index 3a9211e0bb61..d80e323e75f6 100644 --- a/sdk/storage/storage-blob/src/BatchResponseParser.ts +++ b/sdk/storage/storage-blob/src/BatchResponseParser.ts @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpHeaders } from "@azure/core-http"; - -import { ServiceSubmitBatchResponseModel } from "./generatedModels"; +import { BatchSubResponse, ParsedBatchResponse } from "./BatchResponse"; import { HTTP_VERSION_1_1, HTTP_LINE_ENDING, HeaderConstants, HTTPURLConnection } from "./utils/constants"; -import { getBodyAsText } from "./BatchUtils"; import { BatchSubRequest } from "./BlobBatch"; -import { BatchSubResponse, ParsedBatchResponse } from "./BatchResponse"; +import { HttpHeaders } from "@azure/core-http"; +import { ServiceSubmitBatchResponseModel } from "./generatedModels"; +import { getBodyAsText } from "./BatchUtils"; import { logger } from "./log"; const HTTP_HEADER_DELIMITER = ": "; diff --git a/sdk/storage/storage-blob/src/BatchUtils.ts b/sdk/storage/storage-blob/src/BatchUtils.ts index 0b1d49dbcb41..e4c8072703b0 100644 --- a/sdk/storage/storage-blob/src/BatchUtils.ts +++ b/sdk/storage/storage-blob/src/BatchUtils.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { BATCH_MAX_PAYLOAD_IN_BYTES } from "./utils/constants"; import { ServiceSubmitBatchResponseModel } from "./generatedModels"; import { streamToBuffer2 } from "./utils/utils.node"; -import { BATCH_MAX_PAYLOAD_IN_BYTES } from "./utils/constants"; export async function getBodyAsText( batchResponse: ServiceSubmitBatchResponseModel diff --git a/sdk/storage/storage-blob/src/BlobBatch.ts b/sdk/storage/storage-blob/src/BlobBatch.ts index d3506ebcd37f..82b43f2e0f69 100644 --- a/sdk/storage/storage-blob/src/BlobBatch.ts +++ b/sdk/storage/storage-blob/src/BlobBatch.ts @@ -1,6 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { + BATCH_MAX_REQUEST, + HTTP_LINE_ENDING, + HTTP_VERSION_1_1, + HeaderConstants, + StorageOAuthScopes +} from "./utils/constants"; import { BaseRequestPolicy, deserializationPolicy, @@ -16,20 +23,13 @@ import { bearerTokenAuthenticationPolicy, isNode } from "@azure/core-http"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { BlobClient, BlobDeleteOptions, BlobSetTierOptions } from "./Clients"; +import { attachCredential, getURLPath, getURLPathAndQuery, iEqual } from "./utils/utils.common"; import { AccessTier } from "./generatedModels"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { Mutex } from "./utils/Mutex"; import { Pipeline } from "./Pipeline"; -import { attachCredential, getURLPath, getURLPathAndQuery, iEqual } from "./utils/utils.common"; -import { - HeaderConstants, - BATCH_MAX_REQUEST, - HTTP_VERSION_1_1, - HTTP_LINE_ENDING, - StorageOAuthScopes -} from "./utils/constants"; +import { SpanStatusCode } from "@azure/core-tracing"; import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { createSpan } from "./utils/tracing"; diff --git a/sdk/storage/storage-blob/src/BlobBatchClient.ts b/sdk/storage/storage-blob/src/BlobBatchClient.ts index 67a677087aaa..d78796070034 100644 --- a/sdk/storage/storage-blob/src/BlobBatchClient.ts +++ b/sdk/storage/storage-blob/src/BlobBatchClient.ts @@ -7,20 +7,20 @@ import { ServiceSubmitBatchOptionalParamsModel, ServiceSubmitBatchResponseModel } from "./generatedModels"; -import { ParsedBatchResponse } from "./BatchResponse"; +import { BlobClient, BlobDeleteOptions, BlobSetTierOptions } from "./Clients"; +import { Container, Service } from "./generated/src/operations"; +import { HttpResponse, TokenCredential } from "@azure/core-http"; +import { PipelineLike, StoragePipelineOptions, isPipelineLike, newPipeline } from "./Pipeline"; +import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { BatchResponseParser } from "./BatchResponseParser"; -import { utf8ByteLength } from "./BatchUtils"; import { BlobBatch } from "./BlobBatch"; +import { ParsedBatchResponse } from "./BatchResponse"; import { SpanStatusCode } from "@azure/core-tracing"; -import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; -import { HttpResponse, TokenCredential } from "@azure/core-http"; -import { Service, Container } from "./generated/src/operations"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { BlobDeleteOptions, BlobClient, BlobSetTierOptions } from "./Clients"; import { StorageClientContext } from "./generated/src/storageClientContext"; -import { PipelineLike, StoragePipelineOptions, newPipeline, isPipelineLike } from "./Pipeline"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { getURLPath } from "./utils/utils.common"; +import { utf8ByteLength } from "./BatchUtils"; /** * Options to configure the Service - Submit Batch Optional Params. diff --git a/sdk/storage/storage-blob/src/BlobDownloadResponse.ts b/sdk/storage/storage-blob/src/BlobDownloadResponse.ts index 7a954200fd7d..9538f6c245c2 100644 --- a/sdk/storage/storage-blob/src/BlobDownloadResponse.ts +++ b/sdk/storage/storage-blob/src/BlobDownloadResponse.ts @@ -1,7 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse, isNode } from "@azure/core-http"; -import { BlobImmutabilityPolicyMode } from "./generatedModels"; import { BlobDownloadHeaders, @@ -12,11 +10,9 @@ import { LeaseStatusType } from "./generatedModels"; import { BlobDownloadResponseParsed, Metadata, ObjectReplicationPolicy } from "./models"; -import { - ReadableStreamGetter, - RetriableReadableStream, - RetriableReadableStreamOptions -} from "./utils/RetriableReadableStream"; +import { HttpResponse, isNode } from "@azure/core-http"; +import { ReadableStreamGetter, RetriableReadableStream, RetriableReadableStreamOptions } from "./utils/RetriableReadableStream"; +import { BlobImmutabilityPolicyMode } from "./generatedModels"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/BlobLeaseClient.ts b/sdk/storage/storage-blob/src/BlobLeaseClient.ts index 642e07d37d13..1589757a95c5 100644 --- a/sdk/storage/storage-blob/src/BlobLeaseClient.ts +++ b/sdk/storage/storage-blob/src/BlobLeaseClient.ts @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { generateUuid, HttpResponse } from "@azure/core-http"; -import { StorageClientContext } from "./generated/src/index"; -import { ContainerBreakLeaseOptionalParams } from "./generatedModels"; -import { AbortSignalLike } from "@azure/abort-controller"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { Blob as StorageBlob, Container } from "./generated/src/operations"; -import { ModifiedAccessConditions } from "./models"; -import { CommonOptions } from "./StorageClient"; -import { ETagNone } from "./utils/constants"; + +import { Container, Blob as StorageBlob } from "./generated/src/operations"; +import { HttpResponse, generateUuid } from "@azure/core-http"; import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { AbortSignalLike } from "@azure/abort-controller"; import { BlobClient } from "./Clients"; +import { CommonOptions } from "./StorageClient"; +import { ContainerBreakLeaseOptionalParams } from "./generatedModels"; import { ContainerClient } from "./ContainerClient"; +import { ETagNone } from "./utils/constants"; +import { ModifiedAccessConditions } from "./models"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageClientContext } from "./generated/src/index"; /** * The details for a specific lease. diff --git a/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts b/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts index 9fe474532e13..8fbe9d5c2dc5 100644 --- a/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts +++ b/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse } from "@azure/core-http"; - import { BlobDownloadResponseModel, BlobType, @@ -13,8 +11,9 @@ import { BlobDownloadHeaders, BlobQueryResponseModel } from "./generatedModels"; -import { Metadata } from "./models"; import { BlobQuickQueryStreamOptions } from "./utils/BlobQuickQueryStream"; +import { HttpResponse } from "@azure/core-http"; +import { Metadata } from "./models"; /** * ONLY AVAILABLE IN BROWSER RUNTIME. diff --git a/sdk/storage/storage-blob/src/BlobQueryResponse.ts b/sdk/storage/storage-blob/src/BlobQueryResponse.ts index d4509323ce1b..172317521983 100644 --- a/sdk/storage/storage-blob/src/BlobQueryResponse.ts +++ b/sdk/storage/storage-blob/src/BlobQueryResponse.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse, isNode } from "@azure/core-http"; - import { BlobDownloadResponseModel, BlobType, @@ -13,8 +11,9 @@ import { BlobDownloadHeaders, BlobQueryResponseModel } from "./generatedModels"; -import { Metadata } from "./models"; import { BlobQuickQueryStream, BlobQuickQueryStreamOptions } from "./utils/BlobQuickQueryStream"; +import { HttpResponse, isNode } from "@azure/core-http"; +import { Metadata } from "./models"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/BlobServiceClient.ts b/sdk/storage/storage-blob/src/BlobServiceClient.ts index 09c1498cb6be..76b3a7198a31 100644 --- a/sdk/storage/storage-blob/src/BlobServiceClient.ts +++ b/sdk/storage/storage-blob/src/BlobServiceClient.ts @@ -1,14 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - TokenCredential, - isTokenCredential, - isNode, - HttpResponse, - getDefaultProxySettings -} from "@azure/core-http"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { AbortSignalLike } from "@azure/abort-controller"; +import "@azure/core-paging"; import { ServiceGetUserDelegationKeyHeaders, ContainerCreateResponse, @@ -27,34 +19,32 @@ import { ContainerRenameResponse, LeaseAccessConditions } from "./generatedModels"; +import { CommonOptions, StorageClient } from "./StorageClient"; import { Container, Service } from "./generated/src/operations"; -import { newPipeline, StoragePipelineOptions, PipelineLike, isPipelineLike } from "./Pipeline"; -import { - ContainerClient, - ContainerCreateOptions, - ContainerDeleteMethodOptions -} from "./ContainerClient"; +import { ContainerClient, ContainerCreateOptions, ContainerDeleteMethodOptions } from "./ContainerClient"; import { - appendToURLPath, - appendToURLQuery, - extractConnectionStringParts, - toTags -} from "./utils/utils.common"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import "@azure/core-paging"; + HttpResponse, + TokenCredential, + getDefaultProxySettings, + isNode, + isTokenCredential +} from "@azure/core-http"; import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; -import { truncatedISO8061Date } from "./utils/utils.common"; +import { PipelineLike, StoragePipelineOptions, isPipelineLike, newPipeline } from "./Pipeline"; +import { appendToURLPath, appendToURLQuery, extractConnectionStringParts, toTags } from "./utils/utils.common"; import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; -import { BlobBatchClient } from "./BlobBatchClient"; -import { CommonOptions, StorageClient } from "./StorageClient"; -import { Tags } from "./models"; +import { AbortSignalLike } from "@azure/abort-controller"; import { AccountSASPermissions } from "./sas/AccountSASPermissions"; +import { AccountSASServices } from "./sas/AccountSASServices"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; +import { BlobBatchClient } from "./BlobBatchClient"; import { SASProtocol } from "./sas/SASQueryParameters"; import { SasIPRange } from "./sas/SasIPRange"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; +import { Tags } from "./models"; import { generateAccountSASQueryParameters } from "./sas/AccountSASSignatureValues"; -import { AccountSASServices } from "./sas/AccountSASServices"; -import { ListContainersIncludeType } from "./generated/src"; +import { truncatedISO8061Date } from "./utils/utils.common"; /** * Options to configure the {@link BlobServiceClient.getProperties} operation. diff --git a/sdk/storage/storage-blob/src/Clients.ts b/sdk/storage/storage-blob/src/Clients.ts index 4ff732085c06..227ea0a7b47f 100644 --- a/sdk/storage/storage-blob/src/Clients.ts +++ b/sdk/storage/storage-blob/src/Clients.ts @@ -1,26 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike } from "@azure/abort-controller"; -import { - generateUuid, - getDefaultProxySettings, - HttpRequestBody, - HttpResponse, - isNode, - isTokenCredential, - TokenCredential, - TransferProgressEvent, - URLBuilder -} from "@azure/core-http"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { Readable } from "stream"; -import { BlobDownloadResponse } from "./BlobDownloadResponse"; -import { BlobQueryResponse } from "./BlobQueryResponse"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AppendBlob, Blob as StorageBlob, BlockBlob, PageBlob } from "./generated/src/operations"; +import { AppendBlob, BlockBlob, PageBlob, Blob as StorageBlob } from "./generated/src/operations"; import { AppendBlobAppendBlockFromUrlResponse, AppendBlobAppendBlockResponse, @@ -82,21 +63,6 @@ import { BlobImmutabilityPolicy, HttpAuthorization } from "./models"; -import { - PageBlobGetPageRangesDiffResponse, - PageBlobGetPageRangesResponse, - rangeResponseFromModel -} from "./PageBlobRangeResponse"; -import { newPipeline, PipelineLike, isPipelineLike, StoragePipelineOptions } from "./Pipeline"; -import { - BlobBeginCopyFromUrlPoller, - BlobBeginCopyFromUrlPollState, - CopyPollerBlobClient -} from "./pollers/BlobStartCopyFromUrlPoller"; -import { Range, rangeToString } from "./Range"; -import { CommonOptions, StorageClient } from "./StorageClient"; -import { Batch } from "./utils/Batch"; -import { BufferScheduler } from "../../storage-common/src"; import { BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, @@ -107,7 +73,24 @@ import { ETagAny, URLConstants } from "./utils/constants"; -import { createSpan, convertTracingToRequestOptionsBase } from "./utils/tracing"; +import { BlobBeginCopyFromUrlPollState, BlobBeginCopyFromUrlPoller, CopyPollerBlobClient } from "./pollers/BlobStartCopyFromUrlPoller"; +import { BlobDeleteImmutabilityPolicyResponse, BlobSetImmutabilityPolicyResponse, BlobSetLegalHoldResponse } from "./generatedModels"; +import { CommonOptions, StorageClient } from "./StorageClient"; +import { + HttpRequestBody, + HttpResponse, + TokenCredential, + TransferProgressEvent, + URLBuilder, + generateUuid, + getDefaultProxySettings, + isNode, + isTokenCredential +} from "@azure/core-http"; +import { PageBlobGetPageRangesDiffResponse, PageBlobGetPageRangesResponse, rangeResponseFromModel } from "./PageBlobRangeResponse"; +import { PipelineLike, StoragePipelineOptions, isPipelineLike, newPipeline } from "./Pipeline"; +import { PollOperationState, PollerLike } from "@azure/core-lro"; +import { Range, rangeToString } from "./Range"; import { appendToURLPath, appendToURLQuery, @@ -123,22 +106,22 @@ import { toQuerySerialization, toTags } from "./utils/utils.common"; -import { - fsCreateReadStream, - fsStat, - readStreamToLocalFile, - streamToBuffer -} from "./utils/utils.node"; +import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { fsCreateReadStream, fsStat, readStreamToLocalFile, streamToBuffer } from "./utils/utils.node"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; +import { Batch } from "./utils/Batch"; +import { BlobDownloadResponse } from "./BlobDownloadResponse"; +import { BlobLeaseClient } from "./BlobLeaseClient"; +import { BlobQueryResponse } from "./BlobQueryResponse"; +import { BlobSASPermissions } from "./sas/BlobSASPermissions"; +import { BufferScheduler } from "../../storage-common/src"; +import { Readable } from "stream"; import { SASProtocol } from "./sas/SASQueryParameters"; import { SasIPRange } from "./sas/SasIPRange"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { generateBlobSASQueryParameters } from "./sas/BlobSASSignatureValues"; -import { BlobSASPermissions } from "./sas/BlobSASPermissions"; -import { BlobLeaseClient } from "./BlobLeaseClient"; -import { - BlobDeleteImmutabilityPolicyResponse, - BlobSetImmutabilityPolicyResponse, - BlobSetLegalHoldResponse -} from "./generatedModels"; /** * Options to configure the {@link BlobClient.beginCopyFromURL} operation. diff --git a/sdk/storage/storage-blob/src/ContainerClient.ts b/sdk/storage/storage-blob/src/ContainerClient.ts index 581541215263..650be0580566 100644 --- a/sdk/storage/storage-blob/src/ContainerClient.ts +++ b/sdk/storage/storage-blob/src/ContainerClient.ts @@ -1,20 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike } from "@azure/abort-controller"; + import { - getDefaultProxySettings, - HttpRequestBody, - HttpResponse, - isNode, - isTokenCredential, - TokenCredential, - URLBuilder -} from "@azure/core-http"; -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { Container } from "./generated/src/operations"; + AppendBlobClient, + BlobClient, + BlobDeleteOptions, + BlockBlobClient, + BlockBlobUploadOptions, + CommonGenerateSasUrlOptions, + PageBlobClient +} from "./Clients"; import { BlobDeleteResponse, BlobPrefix, @@ -35,6 +30,7 @@ import { PublicAccessType, SignedIdentifierModel } from "./generatedModels"; +import { CommonOptions, StorageClient } from "./StorageClient"; import { Metadata, ObjectReplicationPolicy, @@ -42,9 +38,17 @@ import { ContainerRequestConditions, ModifiedAccessConditions } from "./models"; -import { newPipeline, PipelineLike, isPipelineLike, StoragePipelineOptions } from "./Pipeline"; -import { CommonOptions, StorageClient } from "./StorageClient"; -import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { + HttpRequestBody, + HttpResponse, + TokenCredential, + URLBuilder, + getDefaultProxySettings, + isNode, + isTokenCredential +} from "@azure/core-http"; +import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PipelineLike, StoragePipelineOptions, isPipelineLike, newPipeline } from "./Pipeline"; import { appendToURLPath, appendToURLQuery, @@ -59,20 +63,16 @@ import { toTags, truncatedISO8061Date } from "./utils/utils.common"; +import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; +import { BlobBatchClient } from "./BlobBatchClient"; +import { BlobLeaseClient } from "./BlobLeaseClient"; +import { Container } from "./generated/src/operations"; import { ContainerSASPermissions } from "./sas/ContainerSASPermissions"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { generateBlobSASQueryParameters } from "./sas/BlobSASSignatureValues"; -import { BlobLeaseClient } from "./BlobLeaseClient"; -import { - AppendBlobClient, - BlobClient, - BlobDeleteOptions, - BlockBlobClient, - BlockBlobUploadOptions, - CommonGenerateSasUrlOptions, - PageBlobClient -} from "./Clients"; -import { BlobBatchClient } from "./BlobBatchClient"; -import { ListBlobsIncludeItem } from "./generated/src"; /** * Options to configure {@link ContainerClient.create} operation. diff --git a/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts b/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts index cae219869873..90c72647e0e2 100644 --- a/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts +++ b/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse } from "@azure/core-http"; import { PageBlobGetPageRangesHeaders, PageBlobGetPageRangesDiffHeaders, PageBlobGetPageRangesResponse as PageBlobGetPageRangesResponseModel, PageBlobGetPageRangesDiffResponse as PageBlobGetPageRangesDiffResponseModel } from "./generatedModels"; +import { HttpResponse } from "@azure/core-http"; import { Range } from "./Range"; /** diff --git a/sdk/storage/storage-blob/src/Pipeline.ts b/sdk/storage/storage-blob/src/Pipeline.ts index 6b13e41282ad..d05a0dbec6cd 100644 --- a/sdk/storage/storage-blob/src/Pipeline.ts +++ b/sdk/storage/storage-blob/src/Pipeline.ts @@ -27,20 +27,19 @@ import { generateClientRequestIdPolicy, UserAgentOptions } from "@azure/core-http"; - -import { logger } from "./log"; -import { StorageBrowserPolicyFactory } from "./StorageBrowserPolicyFactory"; -import { StorageRetryOptions, StorageRetryPolicyFactory } from "./StorageRetryPolicyFactory"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { StorageOAuthScopes, StorageBlobLoggingAllowedHeaderNames, StorageBlobLoggingAllowedQueryParameters } from "./utils/constants"; +import { StorageRetryOptions, StorageRetryPolicyFactory } from "./StorageRetryPolicyFactory"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; +import { StorageBrowserPolicyFactory } from "./StorageBrowserPolicyFactory"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; -import { getCachedDefaultHttpClient } from "./utils/cache"; import { attachCredential } from "./utils/utils.common"; +import { getCachedDefaultHttpClient } from "./utils/cache"; +import { logger } from "./log"; // Export following interfaces and types for customers who want to implement their // own RequestPolicy or HTTPClient diff --git a/sdk/storage/storage-blob/src/StorageClient.ts b/sdk/storage/storage-blob/src/StorageClient.ts index 11c63cb355bd..94bb2c5866fa 100644 --- a/sdk/storage/storage-blob/src/StorageClient.ts +++ b/sdk/storage/storage-blob/src/StorageClient.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { StorageClientContext } from "./generated/src/storageClientContext"; -import { PipelineLike } from "./Pipeline"; -import { escapeURLPath, getURLScheme, iEqual, getAccountNameFromUrl } from "./utils/utils.common"; +import { TokenCredential, isNode, isTokenCredential } from "@azure/core-http"; +import { escapeURLPath, getAccountNameFromUrl, getURLScheme, iEqual } from "./utils/utils.common"; import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { TokenCredential, isTokenCredential, isNode } from "@azure/core-http"; import { OperationTracingOptions } from "@azure/core-tracing"; +import { PipelineLike } from "./Pipeline"; +import { StorageClientContext } from "./generated/src/storageClientContext"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; /** * An interface for options common to every remote operation. diff --git a/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts b/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts index bb54d80feb88..da3525bc72fb 100644 --- a/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import * as os from "os"; import { isNode, RequestPolicy, @@ -8,10 +9,8 @@ import { RequestPolicyOptions, UserAgentOptions } from "@azure/core-http"; -import * as os from "os"; - -import { TelemetryPolicy } from "./policies/TelemetryPolicy"; import { SDK_VERSION } from "./utils/constants"; +import { TelemetryPolicy } from "./policies/TelemetryPolicy"; /** * TelemetryPolicyFactory is a factory class helping generating {@link TelemetryPolicy} objects. diff --git a/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts b/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts index 7e4ceab82cc5..24a4cc17cee2 100644 --- a/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts +++ b/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { createHmac } from "crypto"; import { RequestPolicy, RequestPolicyOptions } from "@azure/core-http"; - -import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy"; import { Credential } from "./Credential"; +import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy"; +import { createHmac } from "crypto"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts b/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts index 7617c1ac79d9..e058025452aa 100644 --- a/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts +++ b/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { createHmac } from "crypto"; import { UserDelegationKey } from "../BlobServiceClient"; +import { createHmac } from "crypto"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/models.ts b/sdk/storage/storage-blob/src/models.ts index 0ece7d857775..3d0f6ca26823 100644 --- a/sdk/storage/storage-blob/src/models.ts +++ b/sdk/storage/storage-blob/src/models.ts @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { BlobImmutabilityPolicyMode } from "./generatedModels"; import { LeaseAccessConditions, SequenceNumberAccessConditions, @@ -10,6 +9,7 @@ import { CpkInfo, BlobDownloadResponseModel } from "./generatedModels"; +import { BlobImmutabilityPolicyMode } from "./generatedModels"; import { EncryptionAlgorithmAES25 } from "./utils/constants"; /** diff --git a/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts b/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts index 3d6135609044..edcb563686dc 100644 --- a/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortError } from "@azure/abort-controller"; - import { AbortSignalLike, BaseRequestPolicy, @@ -13,10 +11,10 @@ import { RestError, WebResource } from "@azure/core-http"; - +import { delay, setURLHost, setURLParameter } from "../utils/utils.common"; +import { AbortError } from "@azure/abort-controller"; import { StorageRetryOptions } from "../StorageRetryPolicyFactory"; import { URLConstants } from "../utils/constants"; -import { delay, setURLHost, setURLParameter } from "../utils/utils.common"; import { logger } from "../log"; /** diff --git a/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts b/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts index 7ea3fde1720b..39ef0ad26f43 100644 --- a/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts @@ -2,10 +2,10 @@ // Licensed under the MIT license. import { RequestPolicy, RequestPolicyOptions, WebResource } from "@azure/core-http"; -import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; -import { HeaderConstants } from "../utils/constants"; import { getURLPath, getURLQueries } from "../utils/utils.common"; import { CredentialPolicy } from "./CredentialPolicy"; +import { HeaderConstants } from "../utils/constants"; +import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; /** * StorageSharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key. diff --git a/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts b/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts index d365a2e31a40..f6a0e3d39e04 100644 --- a/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts +++ b/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { delay } from "@azure/core-http"; +import { BlobBeginCopyFromURLResponse, BlobClient, BlobStartCopyFromURLOptions } from "../Clients"; import { PollOperation, PollOperationState, Poller } from "@azure/core-lro"; -import { BlobClient, BlobStartCopyFromURLOptions, BlobBeginCopyFromURLResponse } from "../Clients"; +import { delay } from "@azure/core-http"; /** * Defines the operations from a {@link BlobClient} that are needed for the poller diff --git a/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts b/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts index 4c7641c30be8..72c307d7ed22 100644 --- a/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts +++ b/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; +import { SasIPRange, ipRangeToString } from "./SasIPRange"; import { AccountSASPermissions } from "./AccountSASPermissions"; import { AccountSASResourceTypes } from "./AccountSASResourceTypes"; import { AccountSASServices } from "./AccountSASServices"; -import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; -import { SasIPRange, ipRangeToString } from "./SasIPRange"; -import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "../utils/constants"; +import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; import { truncatedISO8061Date } from "../utils/utils.common"; /** diff --git a/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts b/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts index 486ba4abdace..5fe7fd08335f 100644 --- a/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts +++ b/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. + +import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; +import { SasIPRange, ipRangeToString } from "./SasIPRange"; import { BlobSASPermissions } from "./BlobSASPermissions"; -import { UserDelegationKey } from "../BlobServiceClient"; import { ContainerSASPermissions } from "./ContainerSASPermissions"; +import { SERVICE_VERSION } from "../utils/constants"; import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; +import { UserDelegationKey } from "../BlobServiceClient"; import { UserDelegationKeyCredential } from "../credentials/UserDelegationKeyCredential"; -import { ipRangeToString, SasIPRange } from "./SasIPRange"; -import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; -import { SERVICE_VERSION } from "../utils/constants"; import { truncatedISO8061Date } from "../utils/utils.common"; /** diff --git a/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts b/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts index e4d3d1128efa..dec07d3fe9bc 100644 --- a/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts +++ b/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts @@ -2,8 +2,8 @@ // Licensed under the MIT license. import { SasIPRange, ipRangeToString } from "./SasIPRange"; -import { truncatedISO8061Date } from "../utils/utils.common"; import { UserDelegationKey } from "../BlobServiceClient"; +import { truncatedISO8061Date } from "../utils/utils.common"; /** * Protocols for generated SAS. diff --git a/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts b/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts index 85f6c8dc6764..13ec7c16621c 100644 --- a/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts +++ b/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { Readable } from "stream"; - -import { AbortSignalLike } from "@azure/abort-controller"; -import { TransferProgressEvent } from "@azure/core-http"; - import { AvroReadableFromStream, AvroReader } from "../../../storage-internal-avro/src"; +import { AbortSignalLike } from "@azure/abort-controller"; import { BlobQueryError } from "../Clients"; +import { Readable } from "stream"; +import { TransferProgressEvent } from "@azure/core-http"; export interface BlobQuickQueryStreamOptions { /** diff --git a/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts b/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts index 199749b4a123..06fbff940407 100644 --- a/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts +++ b/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { TransferProgressEvent } from "@azure/core-http"; import { Readable } from "stream"; +import { TransferProgressEvent } from "@azure/core-http"; export type ReadableStreamGetter = (offset: number) => Promise; diff --git a/sdk/storage/storage-blob/src/utils/utils.common.ts b/sdk/storage/storage-blob/src/utils/utils.common.ts index 8b312340b7b6..40500a47c305 100644 --- a/sdk/storage/storage-blob/src/utils/utils.common.ts +++ b/sdk/storage/storage-blob/src/utils/utils.common.ts @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike } from "@azure/abort-controller"; -import { HttpHeaders, isNode, URLBuilder, TokenCredential } from "@azure/core-http"; - import { BlobQueryArrowConfiguration, BlobQueryCsvTextConfiguration, @@ -37,12 +34,8 @@ import { ObjectReplicationStatus, HttpAuthorization } from "../models"; -import { - ListBlobsFlatSegmentResponseModel, - BlobItemInternal as BlobItemInternalModel, - ListBlobsHierarchySegmentResponseModel, - BlobPrefix as BlobPrefixModel -} from "../generatedModels"; +import { HttpHeaders, TokenCredential, URLBuilder, isNode } from "@azure/core-http"; +import { AbortSignalLike } from "@azure/abort-controller"; /** * Reserved URL characters must be properly escaped for Storage services like Blob or File. diff --git a/sdk/storage/storage-blob/test/aborter.spec.ts b/sdk/storage/storage-blob/test/aborter.spec.ts index 0f5e905d5a51..f30480bbcff0 100644 --- a/sdk/storage/storage-blob/test/aborter.spec.ts +++ b/sdk/storage/storage-blob/test/aborter.spec.ts @@ -2,13 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; - +import * as dotenv from "dotenv"; import { AbortController, AbortSignal } from "@azure/abort-controller"; -import { ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import * as dotenv from "dotenv"; +import { ContainerClient } from "../src"; import { Context } from "mocha"; + dotenv.config(); describe("Aborter", () => { diff --git a/sdk/storage/storage-blob/test/appendblobclient.spec.ts b/sdk/storage/storage-blob/test/appendblobclient.spec.ts index 2c6d9d55d618..4e217bdaaae9 100644 --- a/sdk/storage/storage-blob/test/appendblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/appendblobclient.spec.ts @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { record, Recorder } from "@azure-tools/test-recorder"; import * as assert from "assert"; import * as dotenv from "dotenv"; -import { Context } from "mocha"; - import { AppendBlobClient, ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { bodyToString, getBSU, getSASConnectionStringFromEnvironment, recorderEnvSetup } from "./utils"; +import { Context } from "mocha"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/blobbatch.spec.ts b/sdk/storage/storage-blob/test/blobbatch.spec.ts index 6329cf236709..959a43f283e4 100644 --- a/sdk/storage/storage-blob/test/blobbatch.spec.ts +++ b/sdk/storage/storage-blob/test/blobbatch.spec.ts @@ -4,23 +4,23 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import { + BlobBatchClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient, + StorageSharedKeyCredential, + newPipeline +} from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { + SimpleTokenCredential, getGenericBSU, getGenericCredential, getTokenCredential, - SimpleTokenCredential, recorderEnvSetup, getTokenBSU } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { BlobBatch } from "../src"; -import { - ContainerClient, - BlockBlobClient, - BlobServiceClient, - newPipeline, - BlobBatchClient, - StorageSharedKeyCredential -} from "../src"; import { Context } from "mocha"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/blobclient.spec.ts b/sdk/storage/storage-blob/test/blobclient.spec.ts index 24575b9da40a..8ebb5ab0a8b5 100644 --- a/sdk/storage/storage-blob/test/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/blobclient.spec.ts @@ -4,9 +4,17 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import * as fs from "fs"; -import { AbortController } from "@azure/abort-controller"; -import { isNode, URLBuilder, URLQuery } from "@azure/core-http"; +import { + BlobClient, + BlobServiceClient, + BlockBlobClient, + BlockBlobTier, + ContainerClient, + RehydratePriority +} from "../src"; +import { Recorder, delay, isLiveMode, record } from "@azure-tools/test-recorder"; import { SpanGraph, setTracer } from "@azure/test-utils"; +import { URLBuilder, URLQuery, isNode } from "@azure/core-http"; import { bodyToString, getBSU, @@ -15,19 +23,12 @@ import { getGenericBSU, getImmutableContainerName } from "./utils"; -import { record, delay, isLiveMode, Recorder } from "@azure-tools/test-recorder"; -import { - BlobClient, - BlockBlobClient, - ContainerClient, - BlockBlobTier, - BlobServiceClient, - RehydratePriority -} from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; -import { base64encode } from "../src/utils/utils.common"; import { context, setSpan } from "@azure/core-tracing"; +import { AbortController } from "@azure/abort-controller"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; +import { base64encode } from "../src/utils/utils.common"; + dotenv.config(); describe("BlobClient", () => { diff --git a/sdk/storage/storage-blob/test/blobclientpollers.spec.ts b/sdk/storage/storage-blob/test/blobclientpollers.spec.ts index c6e19850ec7a..3fb95101010d 100644 --- a/sdk/storage/storage-blob/test/blobclientpollers.spec.ts +++ b/sdk/storage/storage-blob/test/blobclientpollers.spec.ts @@ -3,10 +3,6 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; - -import { getBSU } from "./utils"; -import { record, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder"; -import { recorderEnvSetup, testPollerProperties } from "./utils/testutils.common"; import { BlobClient, BlockBlobClient, @@ -15,8 +11,12 @@ import { PollerLike, PollOperationState } from "../src"; +import { Recorder, isPlaybackMode, isRecordMode, record } from "@azure-tools/test-recorder"; import { URLBuilder, URLQuery } from "@azure/core-http"; +import { recorderEnvSetup, testPollerProperties } from "./utils/testutils.common"; import { Context } from "mocha"; +import { getBSU } from "./utils"; + dotenv.config(); describe("BlobClient beginCopyFromURL Poller", () => { diff --git a/sdk/storage/storage-blob/test/blobserviceclient.spec.ts b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts index 8815307cde54..48df8f6b3055 100644 --- a/sdk/storage/storage-blob/test/blobserviceclient.spec.ts +++ b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts @@ -2,9 +2,8 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; -import { BlobServiceClient } from "../src"; +import { Recorder, delay, isLiveMode, record } from "@azure-tools/test-recorder"; import { getAlternateBSU, getBSU, @@ -14,9 +13,10 @@ import { recorderEnvSetup, sleep } from "./utils"; -import { record, delay, Recorder, isLiveMode } from "@azure-tools/test-recorder"; -import { Tags } from "../src/models"; +import { BlobServiceClient } from "../src"; import { Context } from "mocha"; +import { Tags } from "../src/models"; + dotenv.config(); describe("BlobServiceClient", () => { diff --git a/sdk/storage/storage-blob/test/blobversioning.spec.ts b/sdk/storage/storage-blob/test/blobversioning.spec.ts index 7924cf40d6bb..6fa4e885eb4a 100644 --- a/sdk/storage/storage-blob/test/blobversioning.spec.ts +++ b/sdk/storage/storage-blob/test/blobversioning.spec.ts @@ -4,9 +4,6 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import * as fs from "fs"; -import { isNode, delay } from "@azure/core-http"; -import { getBSU, recorderEnvSetup, bodyToString, getGenericCredential } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { ContainerClient, BlobServiceClient, @@ -15,8 +12,12 @@ import { BlockBlobUploadResponse, BlobBatch } from "../src"; -import { setURLParameter } from "../src/utils/utils.common"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { bodyToString, getBSU, getGenericCredential, recorderEnvSetup } from "./utils"; +import { delay, isNode } from "@azure/core-http"; import { Context } from "mocha"; +import { setURLParameter } from "../src/utils/utils.common"; + dotenv.config({ path: "../.env" }); describe("Blob versioning", () => { diff --git a/sdk/storage/storage-blob/test/blockblobclient.spec.ts b/sdk/storage/storage-blob/test/blockblobclient.spec.ts index da72d8ded512..2449dcc80c77 100644 --- a/sdk/storage/storage-blob/test/blockblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/blockblobclient.spec.ts @@ -2,9 +2,9 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { record, Recorder } from "@azure-tools/test-recorder"; import * as dotenv from "dotenv"; +import { BlobClient, BlockBlobClient, ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { base64encode, bodyToString, @@ -12,11 +12,11 @@ import { getSASConnectionStringFromEnvironment, recorderEnvSetup } from "./utils"; -import { ContainerClient, BlobClient, BlockBlobClient } from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { BlockBlobTier } from "../src"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { isNode } from "@azure/core-http"; + dotenv.config(); describe("BlockBlobClient", () => { diff --git a/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts b/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts index 91e21b1d932f..cc7936bcbcb4 100644 --- a/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts +++ b/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts @@ -2,8 +2,8 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { AbortController } from "@azure/abort-controller"; +import { BlobClient, BlobServiceClient, BlockBlobClient, ContainerClient } from "../../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { arrayBufferEqual, blobToArrayBuffer, @@ -13,8 +13,7 @@ import { getBSU, recorderEnvSetup } from "../utils/index.browser"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { ContainerClient, BlobClient, BlockBlobClient, BlobServiceClient } from "../../src"; +import { AbortController } from "@azure/abort-controller"; import { Context } from "mocha"; describe("Highlevel", () => { diff --git a/sdk/storage/storage-blob/test/containerclient.spec.ts b/sdk/storage/storage-blob/test/containerclient.spec.ts index 13b985a5132e..2f5d27d6e771 100644 --- a/sdk/storage/storage-blob/test/containerclient.spec.ts +++ b/sdk/storage/storage-blob/test/containerclient.spec.ts @@ -3,7 +3,9 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { TestTracer, SpanGraph, setTracer } from "@azure/test-utils"; +import { BlobServiceClient, BlockBlobTier, ContainerClient, ContainerListBlobHierarchySegmentResponse } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { SpanGraph, TestTracer, setTracer } from "@azure/test-utils"; import { bodyToString, getBSU, @@ -11,17 +13,11 @@ import { isSuperSet, recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { URLBuilder } from "@azure/core-http"; -import { - ContainerClient, - BlockBlobTier, - ContainerListBlobHierarchySegmentResponse, - BlobServiceClient -} from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { context, setSpan } from "@azure/core-tracing"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; +import { URLBuilder } from "@azure/core-http"; + dotenv.config(); describe("ContainerClient", () => { diff --git a/sdk/storage/storage-blob/test/encrytion.spec.ts b/sdk/storage/storage-blob/test/encrytion.spec.ts index f9e4f9acdb28..17ae12214a3f 100644 --- a/sdk/storage/storage-blob/test/encrytion.spec.ts +++ b/sdk/storage/storage-blob/test/encrytion.spec.ts @@ -3,11 +3,12 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; +import { BlobClient, BlobServiceClient, BlockBlobClient, ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, getEncryptionScope_1, getEncryptionScope_2, recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { BlobServiceClient, BlobClient, BlockBlobClient, ContainerClient } from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; + dotenv.config(); describe("Encryption Scope", function() { diff --git a/sdk/storage/storage-blob/test/leaseclient.spec.ts b/sdk/storage/storage-blob/test/leaseclient.spec.ts index 2b13cbed108b..1725c65413f4 100644 --- a/sdk/storage/storage-blob/test/leaseclient.spec.ts +++ b/sdk/storage/storage-blob/test/leaseclient.spec.ts @@ -2,12 +2,12 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; +import { BlobClient, BlobServiceClient, BlockBlobClient, ContainerClient } from "../src"; +import { Recorder, delay, record } from "@azure-tools/test-recorder"; import { getBSU, recorderEnvSetup } from "./utils"; -import { record, delay, Recorder } from "@azure-tools/test-recorder"; -import { ContainerClient, BlobClient, BlockBlobClient, BlobServiceClient } from "../src"; import { Context } from "mocha"; + dotenv.config(); describe("LeaseClient from Container", () => { diff --git a/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts b/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts index ca11e7d2e06f..fca16cff10ec 100644 --- a/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts @@ -2,7 +2,6 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; import { AppendBlobClient, @@ -13,6 +12,7 @@ import { BlobSASPermissions, BlobServiceClient } from "../../src"; +import { Recorder, isPlaybackMode, record } from "@azure-tools/test-recorder"; import { getBSU, getConnectionStringFromEnvironment, @@ -21,11 +21,10 @@ import { getTokenBSU, getTokenCredential } from "../utils"; +import { Context } from "mocha"; +import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; -import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; -import { Context } from "mocha"; dotenv.config(); describe("AppendBlobClient Node.js only", () => { diff --git a/sdk/storage/storage-blob/test/node/blobclient.spec.ts b/sdk/storage/storage-blob/test/node/blobclient.spec.ts index fdeefad132ad..557d2e07cff5 100644 --- a/sdk/storage/storage-blob/test/node/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobclient.spec.ts @@ -3,13 +3,6 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { readFileSync, unlinkSync, existsSync, mkdirSync } from "fs"; -import { join } from "path"; - -import { AbortController } from "@azure/abort-controller"; -import { isNode, TokenCredential } from "@azure/core-http"; -import { delay, isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; - import { BlobClient, BlobSASPermissions, @@ -20,6 +13,8 @@ import { newPipeline, StorageSharedKeyCredential } from "../../src"; +import { Recorder, delay, isPlaybackMode, record } from "@azure-tools/test-recorder"; +import { TokenCredential, isNode } from "@azure/core-http"; import { bodyToString, createRandomLocalFile, @@ -31,10 +26,13 @@ import { getTokenCredential, recorderEnvSetup } from "../utils"; +import { existsSync, mkdirSync, readFileSync, unlinkSync } from "fs"; +import { AbortController } from "@azure/abort-controller"; +import { Context } from "mocha"; import { assertClientUsesTokenCredential } from "../utils/assert"; +import { join } from "path"; import { readStreamToLocalFileWithLogs } from "../utils/testutils.node"; import { streamToBuffer3 } from "../../src/utils/utils.node"; -import { Context } from "mocha"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts b/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts index fef357203d72..5c6757ac90db 100644 --- a/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts @@ -2,12 +2,12 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; -import { BlobServiceClient, newPipeline, StorageSharedKeyCredential } from "../../src"; +import { BlobServiceClient, StorageSharedKeyCredential, newPipeline } from "../../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; + dotenv.config(); describe("BlobServiceClient Node.js only", () => { diff --git a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts index b7b6a5de4359..bbc37714c304 100644 --- a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts @@ -2,18 +2,8 @@ // Licensed under the MIT license. import * as assert from "assert"; +import * as crypto from "crypto"; import * as zlib from "zlib"; - -import { - base64encode, - bodyToString, - genearteRandomUint8Array, - getBSU, - getConnectionStringFromEnvironment, - getTokenBSU, - getTokenCredential, - recorderEnvSetup -} from "../utils"; import { BlockBlobClient, newPipeline, @@ -24,13 +14,22 @@ import { generateBlobSASQueryParameters, BlobSASPermissions } from "../../src"; +import { Recorder, isPlaybackMode, record } from "@azure-tools/test-recorder"; +import { + base64encode, + bodyToString, + genearteRandomUint8Array, + getBSU, + getConnectionStringFromEnvironment, + getTokenBSU, + getTokenCredential, + recorderEnvSetup +} from "../utils"; +import { BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "../../src/utils/constants"; +import { Context } from "mocha"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; import { streamToBuffer3 } from "../../src/utils/utils.node"; -import * as crypto from "crypto"; -import { BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "../../src/utils/constants"; -import { Context } from "mocha"; describe("BlockBlobClient Node.js only", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/containerclient.spec.ts b/sdk/storage/storage-blob/test/node/containerclient.spec.ts index 066780b98fff..2d15ae8f668a 100644 --- a/sdk/storage/storage-blob/test/node/containerclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/containerclient.spec.ts @@ -2,9 +2,6 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; -import { PublicAccessType } from "../../src"; import { ContainerClient, newPipeline, @@ -12,10 +9,12 @@ import { ContainerSASPermissions, BlobServiceClient } from "../../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; +import { Context } from "mocha"; +import { PublicAccessType } from "../../src"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { Context } from "mocha"; describe("ContainerClient Node.js only", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts b/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts index 57df690872eb..c9edc955161f 100644 --- a/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts +++ b/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts @@ -10,9 +10,10 @@ import { BlockBlobClient, PageBlobClient } from "../../src"; -import { getBSU, getConnectionStringFromEnvironment, bodyToString, getUniqueName } from "../utils"; -import { env } from "@azure-tools/test-recorder"; +import { bodyToString, getBSU, getConnectionStringFromEnvironment, getUniqueName } from "../utils"; import { Context } from "mocha"; +import { env } from "@azure-tools/test-recorder"; + dotenv.config(); // Expected environment variable to run this test-suite diff --git a/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts b/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts index 4d5e1a2d4c6a..cd74efe2a1d1 100644 --- a/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts +++ b/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts @@ -5,9 +5,9 @@ import * as assert from "assert"; import * as buffer from "buffer"; import * as fs from "fs"; import * as path from "path"; +import { BlobClient, BlobServiceClient, BlockBlobClient, ContainerClient } from "../../src"; import { PassThrough, Readable } from "stream"; - -import { AbortController } from "@azure/abort-controller"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { createRandomLocalFile, recorderEnvSetup, @@ -15,15 +15,14 @@ import { getBSU, createRandomLocalFileWithTotalSize } from "../utils"; -import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { ContainerClient, BlobClient, BlockBlobClient, BlobServiceClient } from "../../src"; -import { readStreamToLocalFileWithLogs } from "../utils/testutils.node"; +import { AbortController } from "@azure/abort-controller"; import { BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES } from "../../src/utils/constants"; +import { Context } from "mocha"; +import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; -import { streamToBuffer2 } from "../../src/utils/utils.node"; import { delay } from "../../src/utils/utils.common"; -import { Context } from "mocha"; +import { readStreamToLocalFileWithLogs } from "../utils/testutils.node"; +import { streamToBuffer2 } from "../../src/utils/utils.node"; describe("Highlevel", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts index 29427d3c9279..c4248acb2ffb 100644 --- a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts @@ -2,15 +2,6 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { - getBSU, - getConnectionStringFromEnvironment, - bodyToString, - recorderEnvSetup, - getTokenBSU, - getTokenCredential -} from "../utils"; import { newPipeline, PageBlobClient, @@ -21,11 +12,19 @@ import { BlobSASPermissions, BlobServiceClient } from "../../src"; +import { Recorder, delay, isPlaybackMode, record } from "@azure-tools/test-recorder"; +import { + bodyToString, + getBSU, + getConnectionStringFromEnvironment, + getTokenBSU, + getTokenCredential, + recorderEnvSetup +} from "../utils"; +import { Context } from "mocha"; +import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { record, delay, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; -import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; -import { Context } from "mocha"; describe("PageBlobClient Node.js only", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/sas.spec.ts b/sdk/storage/storage-blob/test/node/sas.spec.ts index 76b1a46b7a4f..05ad4e90730b 100644 --- a/sdk/storage/storage-blob/test/node/sas.spec.ts +++ b/sdk/storage/storage-blob/test/node/sas.spec.ts @@ -2,7 +2,6 @@ // Licensed under the MIT license. import * as assert from "assert"; - import { AccountSASPermissions, AccountSASResourceTypes, @@ -23,6 +22,7 @@ import { UserDelegationKey, BlobBatch } from "../../src"; +import { Recorder, delay, isLiveMode, record } from "@azure-tools/test-recorder"; import { getBSU, getEncryptionScope_1, @@ -31,9 +31,8 @@ import { recorderEnvSetup, sleep } from "../utils"; -import { delay, isLiveMode, record, Recorder } from "@azure-tools/test-recorder"; -import { SERVICE_VERSION } from "../../src/utils/constants"; import { Context } from "mocha"; +import { SERVICE_VERSION } from "../../src/utils/constants"; describe("Shared Access Signature (SAS) generation Node.js only", () => { let recorder: Recorder; diff --git a/sdk/storage/storage-blob/test/node/utils.spec.ts b/sdk/storage/storage-blob/test/node/utils.spec.ts index 84a015c6eab4..4646b8c7e67a 100644 --- a/sdk/storage/storage-blob/test/node/utils.spec.ts +++ b/sdk/storage/storage-blob/test/node/utils.spec.ts @@ -2,21 +2,18 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { randomBytes } from "crypto"; import * as dotenv from "dotenv"; import * as fs from "fs"; import * as path from "path"; -import { delay, extractConnectionStringParts } from "../../src/utils/utils.common"; -import { Readable, ReadableOptions, PassThrough } from "stream"; -import { - readStreamToLocalFile, - streamToBuffer2, - streamToBuffer3 -} from "../../src/utils/utils.node"; +import { PassThrough, Readable, ReadableOptions } from "stream"; import { ReadableStreamGetter, RetriableReadableStream } from "../../src/utils/RetriableReadableStream"; +import { delay, extractConnectionStringParts } from "../../src/utils/utils.common"; +import { readStreamToLocalFile, streamToBuffer2, streamToBuffer3 } from "../../src/utils/utils.node"; +import { randomBytes } from "crypto"; + dotenv.config(); describe("Utility Helpers Node.js only", () => { diff --git a/sdk/storage/storage-blob/test/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/pageblobclient.spec.ts index 35a78be4de12..b72a6f6ff3e6 100644 --- a/sdk/storage/storage-blob/test/pageblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/pageblobclient.spec.ts @@ -3,6 +3,14 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; +import { + BlobClient, + BlobServiceClient, + ContainerClient, + PageBlobClient, + PremiumPageBlobTier, +} from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { bodyToString, getBSU, @@ -10,15 +18,8 @@ import { getSASConnectionStringFromEnvironment, recorderEnvSetup } from "./utils"; -import { - ContainerClient, - BlobClient, - PageBlobClient, - PremiumPageBlobTier, - BlobServiceClient -} from "../src"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; + dotenv.config(); describe("PageBlobClient", () => { diff --git a/sdk/storage/storage-blob/test/retrypolicy.spec.ts b/sdk/storage/storage-blob/test/retrypolicy.spec.ts index c5aa75a38086..b0abaf6c77a0 100644 --- a/sdk/storage/storage-blob/test/retrypolicy.spec.ts +++ b/sdk/storage/storage-blob/test/retrypolicy.spec.ts @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { URLBuilder } from "@azure/core-http"; import * as assert from "assert"; import * as dotenv from "dotenv"; - -import { AbortController } from "@azure/abort-controller"; -import { ContainerClient, RestError, BlobServiceClient } from "../src"; -import { newPipeline, Pipeline } from "../src"; +import { BlobServiceClient, ContainerClient, RestError } from "../src"; +import { Pipeline, newPipeline } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, recorderEnvSetup } from "./utils"; -import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; -import { record, Recorder } from "@azure-tools/test-recorder"; +import { AbortController } from "@azure/abort-controller"; import { Context } from "mocha"; +import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; +import { URLBuilder } from "@azure/core-http"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/specialnaming.spec.ts b/sdk/storage/storage-blob/test/specialnaming.spec.ts index 0657d66002d7..a0cd5eb27319 100644 --- a/sdk/storage/storage-blob/test/specialnaming.spec.ts +++ b/sdk/storage/storage-blob/test/specialnaming.spec.ts @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { BlockBlobClient, BlobServiceClient } from "../src"; -import { getBSU, recorderEnvSetup } from "./utils/index"; import * as assert from "assert"; -import { appendToURLPath } from "../src/utils/utils.common"; -import { record, Recorder } from "@azure-tools/test-recorder"; import * as dotenv from "dotenv"; +import { BlobServiceClient, BlockBlobClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { getBSU, recorderEnvSetup } from "./utils/index"; import { ContainerClient } from "../src"; import { Context } from "mocha"; +import { appendToURLPath } from "../src/utils/utils.common"; + dotenv.config(); describe("Special Naming Tests", () => { diff --git a/sdk/storage/storage-blob/test/utils.spec.ts b/sdk/storage/storage-blob/test/utils.spec.ts index 9c651de22fab..ca00928d3acb 100644 --- a/sdk/storage/storage-blob/test/utils.spec.ts +++ b/sdk/storage/storage-blob/test/utils.spec.ts @@ -3,14 +3,15 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { HttpHeaders } from "../src"; import { sanitizeHeaders, sanitizeURL, extractConnectionStringParts, isIpEndpointStyle } from "../src/utils/utils.common"; +import { HttpHeaders } from "../src"; import { URLBuilder } from "@azure/core-http"; + dotenv.config(); describe("Utility Helpers", () => { diff --git a/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts b/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts index b0c36c384558..7279529f2790 100644 --- a/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts +++ b/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { Injector, InjectorPolicy } from "./InjectorPolicy"; import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "../../src"; -import { InjectorPolicy, Injector } from "./InjectorPolicy"; /** * InjectorPolicyFactory is a factory class which injects customized errors for retry policy testing. diff --git a/sdk/storage/storage-blob/test/utils/index.browser.ts b/sdk/storage/storage-blob/test/utils/index.browser.ts index afe64ee7081d..e3b4921ccbcd 100644 --- a/sdk/storage/storage-blob/test/utils/index.browser.ts +++ b/sdk/storage/storage-blob/test/utils/index.browser.ts @@ -3,9 +3,9 @@ import { AnonymousCredential } from "../../src"; import { BlobServiceClient } from "../../src"; -import { newPipeline } from "../../src"; import { SimpleTokenCredential } from "./testutils.common"; import { TokenCredential } from "@azure/core-http"; +import { newPipeline } from "../../src"; export * from "./testutils.common"; diff --git a/sdk/storage/storage-blob/test/utils/index.ts b/sdk/storage/storage-blob/test/utils/index.ts index b20ec1d4ae3c..7ef6d16259ae 100644 --- a/sdk/storage/storage-blob/test/utils/index.ts +++ b/sdk/storage/storage-blob/test/utils/index.ts @@ -1,16 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { randomBytes } from "crypto"; import * as dotenv from "dotenv"; import * as fs from "fs"; import * as path from "path"; - -import { SimpleTokenCredential } from "./testutils.common"; -import { StoragePipelineOptions, StorageSharedKeyCredential } from "../../src"; -import { BlobServiceClient } from "../../src"; -import { getUniqueName } from "./testutils.common"; -import { newPipeline } from "../../src"; import { generateAccountSASQueryParameters, AccountSASPermissions, @@ -18,10 +11,16 @@ import { AccountSASResourceTypes, AccountSASServices } from "../../src"; -import { extractConnectionStringParts } from "../../src/utils/utils.common"; +import { StoragePipelineOptions, StorageSharedKeyCredential } from "../../src"; +import { BlobServiceClient } from "../../src"; +import { DefaultAzureCredential } from "@azure/identity"; +import { SimpleTokenCredential } from "./testutils.common"; import { TokenCredential } from "@azure/core-http"; import { env } from "@azure-tools/test-recorder"; -import { DefaultAzureCredential } from "@azure/identity"; +import { extractConnectionStringParts } from "../../src/utils/utils.common"; +import { getUniqueName } from "./testutils.common"; +import { newPipeline } from "../../src"; +import { randomBytes } from "crypto"; dotenv.config(); From d2cf75ba116e3ca1cc1b87b86c243b35a094f7bc Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Sun, 5 Dec 2021 10:52:53 -0800 Subject: [PATCH 2/2] updated with respect to ```sort-imports``` rule --- sdk/storage/storage-blob/package.json | 2 +- .../storage-blob/src/BatchResponseParser.ts | 15 ++- sdk/storage/storage-blob/src/BatchUtils.ts | 2 +- sdk/storage/storage-blob/src/BlobBatch.ts | 35 +++--- .../storage-blob/src/BlobBatchClient.ts | 23 ++-- .../storage-blob/src/BlobDownloadResponse.ts | 10 +- .../storage-blob/src/BlobLeaseClient.ts | 19 +-- .../src/BlobQueryResponse.browser.ts | 11 +- .../storage-blob/src/BlobQueryResponse.ts | 11 +- .../storage-blob/src/BlobServiceClient.ts | 70 ++++++------ sdk/storage/storage-blob/src/Clients.ts | 108 +++++++++--------- .../storage-blob/src/ContainerClient.ts | 84 +++++++------- .../storage-blob/src/PageBlobRangeResponse.ts | 8 +- sdk/storage/storage-blob/src/Pipeline.ts | 39 +++---- sdk/storage/storage-blob/src/StorageClient.ts | 15 ++- .../src/TelemetryPolicyFactory.ts | 9 +- .../credentials/StorageSharedKeyCredential.ts | 5 +- .../UserDelegationKeyCredential.ts | 2 +- .../storage-blob/src/generatedModels.ts | 2 +- sdk/storage/storage-blob/src/models.ts | 10 +- .../src/policies/StorageBrowserPolicy.ts | 4 +- .../src/policies/StorageRetryPolicy.ts | 6 +- .../StorageSharedKeyCredentialPolicy.ts | 4 +- .../src/policies/TelemetryPolicy.ts | 4 +- .../src/pollers/BlobStartCopyFromUrlPoller.ts | 4 +- .../src/sas/AccountSASSignatureValues.ts | 6 +- .../src/sas/BlobSASSignatureValues.ts | 9 +- .../src/sas/SASQueryParameters.ts | 2 +- .../src/utils/BlobQuickQueryStream.ts | 8 +- .../src/utils/RetriableReadableStream.ts | 2 +- .../storage-blob/src/utils/utils.common.ts | 62 +++++----- sdk/storage/storage-blob/test/aborter.spec.ts | 8 +- .../test/appendblobclient.spec.ts | 5 +- .../storage-blob/test/blobbatch.spec.ts | 24 ++-- .../storage-blob/test/blobclient.spec.ts | 38 +++--- .../test/blobclientpollers.spec.ts | 19 +-- .../test/blobserviceclient.spec.ts | 13 ++- .../storage-blob/test/blobversioning.spec.ts | 20 ++-- .../storage-blob/test/blockblobclient.spec.ts | 8 +- .../test/browser/highlevel.browser.spec.ts | 14 ++- .../storage-blob/test/containerclient.spec.ts | 21 ++-- .../storage-blob/test/encrytion.spec.ts | 19 ++- .../storage-blob/test/leaseclient.spec.ts | 11 +- .../test/node/appendblobclient.spec.ts | 22 ++-- .../storage-blob/test/node/blobclient.spec.ts | 28 +++-- .../test/node/blobserviceclient.spec.ts | 6 +- .../test/node/blockblobclient.spec.ts | 29 +++-- .../test/node/containerclient.spec.ts | 15 ++- .../test/node/emulator-tests.spec.ts | 12 +- .../test/node/highlevel.node.spec.ts | 26 +++-- .../test/node/pageblobclient.spec.ts | 38 +++--- .../storage-blob/test/node/sas.spec.ts | 26 +++-- .../storage-blob/test/node/utils.spec.ts | 16 +-- .../storage-blob/test/pageblobclient.spec.ts | 17 +-- .../storage-blob/test/retrypolicy.spec.ts | 13 +-- .../storage-blob/test/specialnaming.spec.ts | 9 +- sdk/storage/storage-blob/test/utils.spec.ts | 9 +- .../storage-blob/test/utils/InjectorPolicy.ts | 4 +- .../test/utils/InjectorPolicyFactory.ts | 2 +- .../storage-blob/test/utils/index.browser.ts | 2 +- sdk/storage/storage-blob/test/utils/index.ts | 23 ++-- .../test/utils/testutils.common.ts | 4 +- 62 files changed, 581 insertions(+), 511 deletions(-) diff --git a/sdk/storage/storage-blob/package.json b/sdk/storage/storage-blob/package.json index f26f9df64984..36168d9004af 100644 --- a/sdk/storage/storage-blob/package.json +++ b/sdk/storage/storage-blob/package.json @@ -4,7 +4,7 @@ "version": "12.9.0-beta.2", "description": "Microsoft Azure Storage SDK for JavaScript - Blob", "main": "./dist/index.js", - "module": "./dist-esm/storage-blob/src/index.js", + "module": "dist-esm/src/index.js", "browser": { "./dist-esm/storage-blob/src/index.js": "./dist-esm/storage-blob/src/index.browser.js", "./dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js": "./dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js", diff --git a/sdk/storage/storage-blob/src/BatchResponseParser.ts b/sdk/storage/storage-blob/src/BatchResponseParser.ts index 3a9211e0bb61..8464e6aef8f2 100644 --- a/sdk/storage/storage-blob/src/BatchResponseParser.ts +++ b/sdk/storage/storage-blob/src/BatchResponseParser.ts @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpHeaders } from "@azure/core-http"; - -import { ServiceSubmitBatchResponseModel } from "./generatedModels"; +import { BatchSubResponse, ParsedBatchResponse } from "./BatchResponse"; import { - HTTP_VERSION_1_1, + HTTPURLConnection, HTTP_LINE_ENDING, - HeaderConstants, - HTTPURLConnection + HTTP_VERSION_1_1, + HeaderConstants } from "./utils/constants"; -import { getBodyAsText } from "./BatchUtils"; import { BatchSubRequest } from "./BlobBatch"; -import { BatchSubResponse, ParsedBatchResponse } from "./BatchResponse"; +import { HttpHeaders } from "@azure/core-http"; +import { ServiceSubmitBatchResponseModel } from "./generatedModels"; +import { getBodyAsText } from "./BatchUtils"; import { logger } from "./log"; const HTTP_HEADER_DELIMITER = ": "; diff --git a/sdk/storage/storage-blob/src/BatchUtils.ts b/sdk/storage/storage-blob/src/BatchUtils.ts index 0b1d49dbcb41..e4c8072703b0 100644 --- a/sdk/storage/storage-blob/src/BatchUtils.ts +++ b/sdk/storage/storage-blob/src/BatchUtils.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { BATCH_MAX_PAYLOAD_IN_BYTES } from "./utils/constants"; import { ServiceSubmitBatchResponseModel } from "./generatedModels"; import { streamToBuffer2 } from "./utils/utils.node"; -import { BATCH_MAX_PAYLOAD_IN_BYTES } from "./utils/constants"; export async function getBodyAsText( batchResponse: ServiceSubmitBatchResponseModel diff --git a/sdk/storage/storage-blob/src/BlobBatch.ts b/sdk/storage/storage-blob/src/BlobBatch.ts index d3506ebcd37f..d50ab749fe42 100644 --- a/sdk/storage/storage-blob/src/BlobBatch.ts +++ b/sdk/storage/storage-blob/src/BlobBatch.ts @@ -1,35 +1,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { + BATCH_MAX_REQUEST, + HTTP_LINE_ENDING, + HTTP_VERSION_1_1, + HeaderConstants, + StorageOAuthScopes +} from "./utils/constants"; import { BaseRequestPolicy, - deserializationPolicy, - generateUuid, HttpHeaders, HttpOperationResponse, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, - WebResource, TokenCredential, - isTokenCredential, + WebResource, bearerTokenAuthenticationPolicy, - isNode + deserializationPolicy, + generateUuid, + isNode, + isTokenCredential } from "@azure/core-http"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { BlobClient, BlobDeleteOptions, BlobSetTierOptions } from "./Clients"; +import { + attachCredential, + getURLPath, + getURLPathAndQuery, + iEqual +} from "./utils/utils.common"; import { AccessTier } from "./generatedModels"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { Mutex } from "./utils/Mutex"; import { Pipeline } from "./Pipeline"; -import { attachCredential, getURLPath, getURLPathAndQuery, iEqual } from "./utils/utils.common"; -import { - HeaderConstants, - BATCH_MAX_REQUEST, - HTTP_VERSION_1_1, - HTTP_LINE_ENDING, - StorageOAuthScopes -} from "./utils/constants"; +import { SpanStatusCode } from "@azure/core-tracing"; import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { createSpan } from "./utils/tracing"; diff --git a/sdk/storage/storage-blob/src/BlobBatchClient.ts b/sdk/storage/storage-blob/src/BlobBatchClient.ts index 67a677087aaa..74b6f4492fe9 100644 --- a/sdk/storage/storage-blob/src/BlobBatchClient.ts +++ b/sdk/storage/storage-blob/src/BlobBatchClient.ts @@ -7,20 +7,25 @@ import { ServiceSubmitBatchOptionalParamsModel, ServiceSubmitBatchResponseModel } from "./generatedModels"; -import { ParsedBatchResponse } from "./BatchResponse"; +import { BlobClient, BlobDeleteOptions, BlobSetTierOptions } from "./Clients"; +import { Container, Service } from "./generated/src/operations"; +import { HttpResponse, TokenCredential } from "@azure/core-http"; +import { + PipelineLike, + StoragePipelineOptions, + isPipelineLike, + newPipeline +} from "./Pipeline"; +import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { BatchResponseParser } from "./BatchResponseParser"; -import { utf8ByteLength } from "./BatchUtils"; import { BlobBatch } from "./BlobBatch"; +import { ParsedBatchResponse } from "./BatchResponse"; import { SpanStatusCode } from "@azure/core-tracing"; -import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; -import { HttpResponse, TokenCredential } from "@azure/core-http"; -import { Service, Container } from "./generated/src/operations"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { BlobDeleteOptions, BlobClient, BlobSetTierOptions } from "./Clients"; import { StorageClientContext } from "./generated/src/storageClientContext"; -import { PipelineLike, StoragePipelineOptions, newPipeline, isPipelineLike } from "./Pipeline"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { getURLPath } from "./utils/utils.common"; +import { utf8ByteLength } from "./BatchUtils"; /** * Options to configure the Service - Submit Batch Optional Params. diff --git a/sdk/storage/storage-blob/src/BlobDownloadResponse.ts b/sdk/storage/storage-blob/src/BlobDownloadResponse.ts index 7a954200fd7d..9538f6c245c2 100644 --- a/sdk/storage/storage-blob/src/BlobDownloadResponse.ts +++ b/sdk/storage/storage-blob/src/BlobDownloadResponse.ts @@ -1,7 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse, isNode } from "@azure/core-http"; -import { BlobImmutabilityPolicyMode } from "./generatedModels"; import { BlobDownloadHeaders, @@ -12,11 +10,9 @@ import { LeaseStatusType } from "./generatedModels"; import { BlobDownloadResponseParsed, Metadata, ObjectReplicationPolicy } from "./models"; -import { - ReadableStreamGetter, - RetriableReadableStream, - RetriableReadableStreamOptions -} from "./utils/RetriableReadableStream"; +import { HttpResponse, isNode } from "@azure/core-http"; +import { ReadableStreamGetter, RetriableReadableStream, RetriableReadableStreamOptions } from "./utils/RetriableReadableStream"; +import { BlobImmutabilityPolicyMode } from "./generatedModels"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/BlobLeaseClient.ts b/sdk/storage/storage-blob/src/BlobLeaseClient.ts index 642e07d37d13..1589757a95c5 100644 --- a/sdk/storage/storage-blob/src/BlobLeaseClient.ts +++ b/sdk/storage/storage-blob/src/BlobLeaseClient.ts @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { generateUuid, HttpResponse } from "@azure/core-http"; -import { StorageClientContext } from "./generated/src/index"; -import { ContainerBreakLeaseOptionalParams } from "./generatedModels"; -import { AbortSignalLike } from "@azure/abort-controller"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { Blob as StorageBlob, Container } from "./generated/src/operations"; -import { ModifiedAccessConditions } from "./models"; -import { CommonOptions } from "./StorageClient"; -import { ETagNone } from "./utils/constants"; + +import { Container, Blob as StorageBlob } from "./generated/src/operations"; +import { HttpResponse, generateUuid } from "@azure/core-http"; import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { AbortSignalLike } from "@azure/abort-controller"; import { BlobClient } from "./Clients"; +import { CommonOptions } from "./StorageClient"; +import { ContainerBreakLeaseOptionalParams } from "./generatedModels"; import { ContainerClient } from "./ContainerClient"; +import { ETagNone } from "./utils/constants"; +import { ModifiedAccessConditions } from "./models"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageClientContext } from "./generated/src/index"; /** * The details for a specific lease. diff --git a/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts b/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts index 9fe474532e13..b3d3c7d9b43d 100644 --- a/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts +++ b/sdk/storage/storage-blob/src/BlobQueryResponse.browser.ts @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse } from "@azure/core-http"; - import { + BlobDownloadHeaders, BlobDownloadResponseModel, + BlobQueryResponseModel, BlobType, CopyStatusType, LeaseDurationType, LeaseStateType, - LeaseStatusType, - BlobDownloadHeaders, - BlobQueryResponseModel + LeaseStatusType } from "./generatedModels"; -import { Metadata } from "./models"; import { BlobQuickQueryStreamOptions } from "./utils/BlobQuickQueryStream"; +import { HttpResponse } from "@azure/core-http"; +import { Metadata } from "./models"; /** * ONLY AVAILABLE IN BROWSER RUNTIME. diff --git a/sdk/storage/storage-blob/src/BlobQueryResponse.ts b/sdk/storage/storage-blob/src/BlobQueryResponse.ts index d4509323ce1b..d1f93267d7a3 100644 --- a/sdk/storage/storage-blob/src/BlobQueryResponse.ts +++ b/sdk/storage/storage-blob/src/BlobQueryResponse.ts @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse, isNode } from "@azure/core-http"; - import { + BlobDownloadHeaders, BlobDownloadResponseModel, + BlobQueryResponseModel, BlobType, CopyStatusType, LeaseDurationType, LeaseStateType, - LeaseStatusType, - BlobDownloadHeaders, - BlobQueryResponseModel + LeaseStatusType } from "./generatedModels"; -import { Metadata } from "./models"; import { BlobQuickQueryStream, BlobQuickQueryStreamOptions } from "./utils/BlobQuickQueryStream"; +import { HttpResponse, isNode } from "@azure/core-http"; +import { Metadata } from "./models"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/BlobServiceClient.ts b/sdk/storage/storage-blob/src/BlobServiceClient.ts index 09c1498cb6be..1b89ee90863a 100644 --- a/sdk/storage/storage-blob/src/BlobServiceClient.ts +++ b/sdk/storage/storage-blob/src/BlobServiceClient.ts @@ -1,60 +1,62 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. + +import "@azure/core-paging"; import { - TokenCredential, - isTokenCredential, - isNode, - HttpResponse, - getDefaultProxySettings -} from "@azure/core-http"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { AbortSignalLike } from "@azure/abort-controller"; -import { - ServiceGetUserDelegationKeyHeaders, + BlobServiceProperties, ContainerCreateResponse, ContainerDeleteResponse, - ServiceGetPropertiesResponse, - BlobServiceProperties, - ServiceSetPropertiesResponse, - ServiceGetStatisticsResponse, - ServiceGetAccountInfoResponse, - ServiceListContainersSegmentResponse, ContainerItem, - UserDelegationKeyModel, + ContainerRenameResponse, ContainerUndeleteResponse, FilterBlobSegmentModel, + LeaseAccessConditions, ServiceFilterBlobsHeaders, - ContainerRenameResponse, - LeaseAccessConditions + ServiceGetAccountInfoResponse, + ServiceGetPropertiesResponse, + ServiceGetStatisticsResponse, + ServiceGetUserDelegationKeyHeaders, + ServiceListContainersSegmentResponse, + ServiceSetPropertiesResponse, + UserDelegationKeyModel } from "./generatedModels"; +import { CommonOptions, StorageClient } from "./StorageClient"; import { Container, Service } from "./generated/src/operations"; -import { newPipeline, StoragePipelineOptions, PipelineLike, isPipelineLike } from "./Pipeline"; +import { ContainerClient, ContainerCreateOptions, ContainerDeleteMethodOptions } from "./ContainerClient"; import { - ContainerClient, - ContainerCreateOptions, - ContainerDeleteMethodOptions -} from "./ContainerClient"; + HttpResponse, + TokenCredential, + getDefaultProxySettings, + isNode, + isTokenCredential +} from "@azure/core-http"; +import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PipelineLike, + StoragePipelineOptions, + isPipelineLike, + newPipeline +} from "./Pipeline"; import { appendToURLPath, appendToURLQuery, extractConnectionStringParts, toTags } from "./utils/utils.common"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import "@azure/core-paging"; -import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; -import { truncatedISO8061Date } from "./utils/utils.common"; import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; -import { BlobBatchClient } from "./BlobBatchClient"; -import { CommonOptions, StorageClient } from "./StorageClient"; -import { Tags } from "./models"; +import { AbortSignalLike } from "@azure/abort-controller"; import { AccountSASPermissions } from "./sas/AccountSASPermissions"; +import { AccountSASServices } from "./sas/AccountSASServices"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; +import { BlobBatchClient } from "./BlobBatchClient"; +import { ListContainersIncludeType } from "./generated/src"; import { SASProtocol } from "./sas/SASQueryParameters"; import { SasIPRange } from "./sas/SasIPRange"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; +import { Tags } from "./models"; import { generateAccountSASQueryParameters } from "./sas/AccountSASSignatureValues"; -import { AccountSASServices } from "./sas/AccountSASServices"; -import { ListContainersIncludeType } from "./generated/src"; +import { truncatedISO8061Date } from "./utils/utils.common"; /** * Options to configure the {@link BlobServiceClient.getProperties} operation. diff --git a/sdk/storage/storage-blob/src/Clients.ts b/sdk/storage/storage-blob/src/Clients.ts index 4ff732085c06..ac33c8dee27b 100644 --- a/sdk/storage/storage-blob/src/Clients.ts +++ b/sdk/storage/storage-blob/src/Clients.ts @@ -1,26 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike } from "@azure/abort-controller"; -import { - generateUuid, - getDefaultProxySettings, - HttpRequestBody, - HttpResponse, - isNode, - isTokenCredential, - TokenCredential, - TransferProgressEvent, - URLBuilder -} from "@azure/core-http"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { Readable } from "stream"; -import { BlobDownloadResponse } from "./BlobDownloadResponse"; -import { BlobQueryResponse } from "./BlobQueryResponse"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { AppendBlob, Blob as StorageBlob, BlockBlob, PageBlob } from "./generated/src/operations"; +import { + AppendBlob, + BlockBlob, + PageBlob, + Blob as StorageBlob +} from "./generated/src/operations"; import { AppendBlobAppendBlockFromUrlResponse, AppendBlobAppendBlockResponse, @@ -33,6 +19,7 @@ import { BlobDownloadResponseModel, BlobGetPropertiesResponseModel, BlobGetTagsHeaders, + BlobHTTPHeaders, BlobSetHTTPHeadersResponse, BlobSetMetadataResponse, BlobSetTagsResponse, @@ -42,6 +29,7 @@ import { BlobUndeleteResponse, BlockBlobCommitBlockListResponse, BlockBlobGetBlockListResponse, + BlockBlobPutBlobFromUrlResponse, BlockBlobStageBlockFromURLResponse, BlockBlobStageBlockResponse, BlockBlobUploadHeaders, @@ -58,45 +46,28 @@ import { PageBlobUploadPagesFromURLResponse, PageBlobUploadPagesResponse, RehydratePriority, - SequenceNumberActionType, - BlockBlobPutBlobFromUrlResponse, - BlobHTTPHeaders + SequenceNumberActionType } from "./generatedModels"; import { AppendBlobRequestConditions, BlobDownloadResponseParsed, + BlobImmutabilityPolicy, + BlobQueryArrowField, BlobRequestConditions, BlockBlobTier, - ensureCpkIfSpecified, + HttpAuthorization, + MatchConditions, Metadata, + ModificationConditions, + ModifiedAccessConditions, ObjectReplicationPolicy, PageBlobRequestConditions, PremiumPageBlobTier, - Tags, - toAccessTier, TagConditions, - MatchConditions, - ModificationConditions, - ModifiedAccessConditions, - BlobQueryArrowField, - BlobImmutabilityPolicy, - HttpAuthorization + Tags, + ensureCpkIfSpecified, + toAccessTier } from "./models"; -import { - PageBlobGetPageRangesDiffResponse, - PageBlobGetPageRangesResponse, - rangeResponseFromModel -} from "./PageBlobRangeResponse"; -import { newPipeline, PipelineLike, isPipelineLike, StoragePipelineOptions } from "./Pipeline"; -import { - BlobBeginCopyFromUrlPoller, - BlobBeginCopyFromUrlPollState, - CopyPollerBlobClient -} from "./pollers/BlobStartCopyFromUrlPoller"; -import { Range, rangeToString } from "./Range"; -import { CommonOptions, StorageClient } from "./StorageClient"; -import { Batch } from "./utils/Batch"; -import { BufferScheduler } from "../../storage-common/src"; import { BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, @@ -107,7 +78,29 @@ import { ETagAny, URLConstants } from "./utils/constants"; -import { createSpan, convertTracingToRequestOptionsBase } from "./utils/tracing"; +import { BlobBeginCopyFromUrlPollState, BlobBeginCopyFromUrlPoller, CopyPollerBlobClient } from "./pollers/BlobStartCopyFromUrlPoller"; +import { BlobDeleteImmutabilityPolicyResponse, BlobSetImmutabilityPolicyResponse, BlobSetLegalHoldResponse } from "./generatedModels"; +import { CommonOptions, StorageClient } from "./StorageClient"; +import { + HttpRequestBody, + HttpResponse, + TokenCredential, + TransferProgressEvent, + URLBuilder, + generateUuid, + getDefaultProxySettings, + isNode, + isTokenCredential +} from "@azure/core-http"; +import { PageBlobGetPageRangesDiffResponse, PageBlobGetPageRangesResponse, rangeResponseFromModel } from "./PageBlobRangeResponse"; +import { + PipelineLike, + StoragePipelineOptions, + isPipelineLike, + newPipeline +} from "./Pipeline"; +import { PollOperationState, PollerLike } from "@azure/core-lro"; +import { Range, rangeToString } from "./Range"; import { appendToURLPath, appendToURLQuery, @@ -123,22 +116,27 @@ import { toQuerySerialization, toTags } from "./utils/utils.common"; +import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; import { fsCreateReadStream, fsStat, readStreamToLocalFile, streamToBuffer } from "./utils/utils.node"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; +import { Batch } from "./utils/Batch"; +import { BlobDownloadResponse } from "./BlobDownloadResponse"; +import { BlobLeaseClient } from "./BlobLeaseClient"; +import { BlobQueryResponse } from "./BlobQueryResponse"; +import { BlobSASPermissions } from "./sas/BlobSASPermissions"; +import { BufferScheduler } from "../../storage-common/src"; +import { Readable } from "stream"; import { SASProtocol } from "./sas/SASQueryParameters"; import { SasIPRange } from "./sas/SasIPRange"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { generateBlobSASQueryParameters } from "./sas/BlobSASSignatureValues"; -import { BlobSASPermissions } from "./sas/BlobSASPermissions"; -import { BlobLeaseClient } from "./BlobLeaseClient"; -import { - BlobDeleteImmutabilityPolicyResponse, - BlobSetImmutabilityPolicyResponse, - BlobSetLegalHoldResponse -} from "./generatedModels"; /** * Options to configure the {@link BlobClient.beginCopyFromURL} operation. diff --git a/sdk/storage/storage-blob/src/ContainerClient.ts b/sdk/storage/storage-blob/src/ContainerClient.ts index 581541215263..a13b23899764 100644 --- a/sdk/storage/storage-blob/src/ContainerClient.ts +++ b/sdk/storage/storage-blob/src/ContainerClient.ts @@ -1,20 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike } from "@azure/abort-controller"; + import { - getDefaultProxySettings, - HttpRequestBody, - HttpResponse, - isNode, - isTokenCredential, - TokenCredential, - URLBuilder -} from "@azure/core-http"; -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { SpanStatusCode } from "@azure/core-tracing"; -import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { Container } from "./generated/src/operations"; + AppendBlobClient, + BlobClient, + BlobDeleteOptions, + BlockBlobClient, + BlockBlobUploadOptions, + CommonGenerateSasUrlOptions, + PageBlobClient +} from "./Clients"; import { BlobDeleteResponse, BlobPrefix, @@ -36,43 +31,54 @@ import { SignedIdentifierModel } from "./generatedModels"; import { - Metadata, - ObjectReplicationPolicy, - Tags, - ContainerRequestConditions, - ModifiedAccessConditions -} from "./models"; -import { newPipeline, PipelineLike, isPipelineLike, StoragePipelineOptions } from "./Pipeline"; -import { CommonOptions, StorageClient } from "./StorageClient"; -import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; -import { - appendToURLPath, - appendToURLQuery, BlobNameToString, ConvertInternalResponseOfListBlobFlat, ConvertInternalResponseOfListBlobHierarchy, + ProcessBlobItems, + ProcessBlobPrefixes, + appendToURLPath, + appendToURLQuery, extractConnectionStringParts, isIpEndpointStyle, parseObjectReplicationRecord, - ProcessBlobItems, - ProcessBlobPrefixes, toTags, truncatedISO8061Date } from "./utils/utils.common"; -import { ContainerSASPermissions } from "./sas/ContainerSASPermissions"; -import { generateBlobSASQueryParameters } from "./sas/BlobSASSignatureValues"; -import { BlobLeaseClient } from "./BlobLeaseClient"; +import { CommonOptions, StorageClient } from "./StorageClient"; import { - AppendBlobClient, - BlobClient, - BlobDeleteOptions, - BlockBlobClient, - BlockBlobUploadOptions, - CommonGenerateSasUrlOptions, - PageBlobClient -} from "./Clients"; + ContainerRequestConditions, + Metadata, + ModifiedAccessConditions, + ObjectReplicationPolicy, + Tags +} from "./models"; +import { + HttpRequestBody, + HttpResponse, + TokenCredential, + URLBuilder, + getDefaultProxySettings, + isNode, + isTokenCredential +} from "@azure/core-http"; +import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PipelineLike, + StoragePipelineOptions, + isPipelineLike, + newPipeline +} from "./Pipeline"; +import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { AnonymousCredential } from "./credentials/AnonymousCredential"; import { BlobBatchClient } from "./BlobBatchClient"; +import { BlobLeaseClient } from "./BlobLeaseClient"; +import { Container } from "./generated/src/operations"; +import { ContainerSASPermissions } from "./sas/ContainerSASPermissions"; import { ListBlobsIncludeItem } from "./generated/src"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; +import { generateBlobSASQueryParameters } from "./sas/BlobSASSignatureValues"; /** * Options to configure {@link ContainerClient.create} operation. diff --git a/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts b/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts index cae219869873..d4fb364cc4e0 100644 --- a/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts +++ b/sdk/storage/storage-blob/src/PageBlobRangeResponse.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { HttpResponse } from "@azure/core-http"; import { - PageBlobGetPageRangesHeaders, PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesResponse as PageBlobGetPageRangesResponseModel, - PageBlobGetPageRangesDiffResponse as PageBlobGetPageRangesDiffResponseModel + PageBlobGetPageRangesDiffResponse as PageBlobGetPageRangesDiffResponseModel, + PageBlobGetPageRangesHeaders, + PageBlobGetPageRangesResponse as PageBlobGetPageRangesResponseModel } from "./generatedModels"; +import { HttpResponse } from "@azure/core-http"; import { Range } from "./Range"; /** diff --git a/sdk/storage/storage-blob/src/Pipeline.ts b/sdk/storage/storage-blob/src/Pipeline.ts index 6b13e41282ad..873a29d5dae4 100644 --- a/sdk/storage/storage-blob/src/Pipeline.ts +++ b/sdk/storage/storage-blob/src/Pipeline.ts @@ -3,44 +3,39 @@ import { BaseRequestPolicy, - deserializationPolicy, - disableResponseDecompressionPolicy, - HttpClient as IHttpClient, HttpHeaders, HttpOperationResponse, HttpRequestBody, + HttpClient as IHttpClient, + KeepAliveOptions, + ProxyOptions, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, ServiceClientOptions, + TokenCredential, + UserAgentOptions, WebResource, - proxyPolicy, + bearerTokenAuthenticationPolicy, + deserializationPolicy, + disableResponseDecompressionPolicy, + generateClientRequestIdPolicy, isNode, - TokenCredential, isTokenCredential, - bearerTokenAuthenticationPolicy, - tracingPolicy, - logPolicy, - ProxyOptions, keepAlivePolicy, - KeepAliveOptions, - generateClientRequestIdPolicy, - UserAgentOptions + logPolicy, + proxyPolicy, + tracingPolicy } from "@azure/core-http"; - -import { logger } from "./log"; -import { StorageBrowserPolicyFactory } from "./StorageBrowserPolicyFactory"; +import { StorageBlobLoggingAllowedHeaderNames, StorageBlobLoggingAllowedQueryParameters, StorageOAuthScopes } from "./utils/constants"; import { StorageRetryOptions, StorageRetryPolicyFactory } from "./StorageRetryPolicyFactory"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { - StorageOAuthScopes, - StorageBlobLoggingAllowedHeaderNames, - StorageBlobLoggingAllowedQueryParameters -} from "./utils/constants"; +import { StorageBrowserPolicyFactory } from "./StorageBrowserPolicyFactory"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; import { TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; -import { getCachedDefaultHttpClient } from "./utils/cache"; import { attachCredential } from "./utils/utils.common"; +import { getCachedDefaultHttpClient } from "./utils/cache"; +import { logger } from "./log"; // Export following interfaces and types for customers who want to implement their // own RequestPolicy or HTTPClient diff --git a/sdk/storage/storage-blob/src/StorageClient.ts b/sdk/storage/storage-blob/src/StorageClient.ts index 11c63cb355bd..1aa2c6b4d2d0 100644 --- a/sdk/storage/storage-blob/src/StorageClient.ts +++ b/sdk/storage/storage-blob/src/StorageClient.ts @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { StorageClientContext } from "./generated/src/storageClientContext"; -import { PipelineLike } from "./Pipeline"; -import { escapeURLPath, getURLScheme, iEqual, getAccountNameFromUrl } from "./utils/utils.common"; +import { TokenCredential, isNode, isTokenCredential } from "@azure/core-http"; +import { + escapeURLPath, + getAccountNameFromUrl, + getURLScheme, + iEqual +} from "./utils/utils.common"; import { AnonymousCredential } from "./credentials/AnonymousCredential"; -import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; -import { TokenCredential, isTokenCredential, isNode } from "@azure/core-http"; import { OperationTracingOptions } from "@azure/core-tracing"; +import { PipelineLike } from "./Pipeline"; +import { StorageClientContext } from "./generated/src/storageClientContext"; +import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential"; /** * An interface for options common to every remote operation. diff --git a/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts b/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts index bb54d80feb88..849a65799042 100644 --- a/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import * as os from "os"; import { - isNode, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, - UserAgentOptions + UserAgentOptions, + isNode } from "@azure/core-http"; -import * as os from "os"; - -import { TelemetryPolicy } from "./policies/TelemetryPolicy"; import { SDK_VERSION } from "./utils/constants"; +import { TelemetryPolicy } from "./policies/TelemetryPolicy"; /** * TelemetryPolicyFactory is a factory class helping generating {@link TelemetryPolicy} objects. diff --git a/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts b/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts index 7e4ceab82cc5..24a4cc17cee2 100644 --- a/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts +++ b/sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { createHmac } from "crypto"; import { RequestPolicy, RequestPolicyOptions } from "@azure/core-http"; - -import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy"; import { Credential } from "./Credential"; +import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy"; +import { createHmac } from "crypto"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts b/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts index 7617c1ac79d9..e058025452aa 100644 --- a/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts +++ b/sdk/storage/storage-blob/src/credentials/UserDelegationKeyCredential.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { createHmac } from "crypto"; import { UserDelegationKey } from "../BlobServiceClient"; +import { createHmac } from "crypto"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. diff --git a/sdk/storage/storage-blob/src/generatedModels.ts b/sdk/storage/storage-blob/src/generatedModels.ts index 595c8c88ec75..6bb1b84ba71d 100644 --- a/sdk/storage/storage-blob/src/generatedModels.ts +++ b/sdk/storage/storage-blob/src/generatedModels.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { BlobTags, BlobPropertiesInternal as BlobProperties } from "./generated/src/models"; +import { BlobPropertiesInternal as BlobProperties, BlobTags } from "./generated/src/models"; export { AccessPolicy, diff --git a/sdk/storage/storage-blob/src/models.ts b/sdk/storage/storage-blob/src/models.ts index 0ece7d857775..b2e759e02803 100644 --- a/sdk/storage/storage-blob/src/models.ts +++ b/sdk/storage/storage-blob/src/models.ts @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { BlobImmutabilityPolicyMode } from "./generatedModels"; import { - LeaseAccessConditions, - SequenceNumberAccessConditions, - AppendPositionAccessConditions, AccessTier, + AppendPositionAccessConditions, + BlobDownloadResponseModel, CpkInfo, - BlobDownloadResponseModel + LeaseAccessConditions, + SequenceNumberAccessConditions } from "./generatedModels"; +import { BlobImmutabilityPolicyMode } from "./generatedModels"; import { EncryptionAlgorithmAES25 } from "./utils/constants"; /** diff --git a/sdk/storage/storage-blob/src/policies/StorageBrowserPolicy.ts b/sdk/storage/storage-blob/src/policies/StorageBrowserPolicy.ts index 814b65e6a05b..3ec0226ac5eb 100644 --- a/sdk/storage/storage-blob/src/policies/StorageBrowserPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/StorageBrowserPolicy.ts @@ -4,10 +4,10 @@ import { BaseRequestPolicy, HttpOperationResponse, - isNode, RequestPolicy, RequestPolicyOptions, - WebResource + WebResource, + isNode } from "@azure/core-http"; import { HeaderConstants, URLConstants } from "../utils/constants"; diff --git a/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts b/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts index 3d6135609044..edcb563686dc 100644 --- a/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortError } from "@azure/abort-controller"; - import { AbortSignalLike, BaseRequestPolicy, @@ -13,10 +11,10 @@ import { RestError, WebResource } from "@azure/core-http"; - +import { delay, setURLHost, setURLParameter } from "../utils/utils.common"; +import { AbortError } from "@azure/abort-controller"; import { StorageRetryOptions } from "../StorageRetryPolicyFactory"; import { URLConstants } from "../utils/constants"; -import { delay, setURLHost, setURLParameter } from "../utils/utils.common"; import { logger } from "../log"; /** diff --git a/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts b/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts index 7ea3fde1720b..39ef0ad26f43 100644 --- a/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts @@ -2,10 +2,10 @@ // Licensed under the MIT license. import { RequestPolicy, RequestPolicyOptions, WebResource } from "@azure/core-http"; -import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; -import { HeaderConstants } from "../utils/constants"; import { getURLPath, getURLQueries } from "../utils/utils.common"; import { CredentialPolicy } from "./CredentialPolicy"; +import { HeaderConstants } from "../utils/constants"; +import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; /** * StorageSharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key. diff --git a/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts b/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts index 8ec37fecc2c7..3530b03b0c5d 100644 --- a/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts @@ -5,10 +5,10 @@ import { BaseRequestPolicy, HttpHeaders, HttpOperationResponse, - isNode, RequestPolicy, RequestPolicyOptions, - WebResource + WebResource, + isNode } from "@azure/core-http"; import { HeaderConstants } from "../utils/constants"; diff --git a/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts b/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts index d365a2e31a40..f6a0e3d39e04 100644 --- a/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts +++ b/sdk/storage/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { delay } from "@azure/core-http"; +import { BlobBeginCopyFromURLResponse, BlobClient, BlobStartCopyFromURLOptions } from "../Clients"; import { PollOperation, PollOperationState, Poller } from "@azure/core-lro"; -import { BlobClient, BlobStartCopyFromURLOptions, BlobBeginCopyFromURLResponse } from "../Clients"; +import { delay } from "@azure/core-http"; /** * Defines the operations from a {@link BlobClient} that are needed for the poller diff --git a/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts b/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts index 4c7641c30be8..72c307d7ed22 100644 --- a/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts +++ b/sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; +import { SasIPRange, ipRangeToString } from "./SasIPRange"; import { AccountSASPermissions } from "./AccountSASPermissions"; import { AccountSASResourceTypes } from "./AccountSASResourceTypes"; import { AccountSASServices } from "./AccountSASServices"; -import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; -import { SasIPRange, ipRangeToString } from "./SasIPRange"; -import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "../utils/constants"; +import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; import { truncatedISO8061Date } from "../utils/utils.common"; /** diff --git a/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts b/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts index 486ba4abdace..5fe7fd08335f 100644 --- a/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts +++ b/sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. + +import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; +import { SasIPRange, ipRangeToString } from "./SasIPRange"; import { BlobSASPermissions } from "./BlobSASPermissions"; -import { UserDelegationKey } from "../BlobServiceClient"; import { ContainerSASPermissions } from "./ContainerSASPermissions"; +import { SERVICE_VERSION } from "../utils/constants"; import { StorageSharedKeyCredential } from "../credentials/StorageSharedKeyCredential"; +import { UserDelegationKey } from "../BlobServiceClient"; import { UserDelegationKeyCredential } from "../credentials/UserDelegationKeyCredential"; -import { ipRangeToString, SasIPRange } from "./SasIPRange"; -import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; -import { SERVICE_VERSION } from "../utils/constants"; import { truncatedISO8061Date } from "../utils/utils.common"; /** diff --git a/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts b/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts index e4d3d1128efa..dec07d3fe9bc 100644 --- a/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts +++ b/sdk/storage/storage-blob/src/sas/SASQueryParameters.ts @@ -2,8 +2,8 @@ // Licensed under the MIT license. import { SasIPRange, ipRangeToString } from "./SasIPRange"; -import { truncatedISO8061Date } from "../utils/utils.common"; import { UserDelegationKey } from "../BlobServiceClient"; +import { truncatedISO8061Date } from "../utils/utils.common"; /** * Protocols for generated SAS. diff --git a/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts b/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts index 85f6c8dc6764..13ec7c16621c 100644 --- a/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts +++ b/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { Readable } from "stream"; - -import { AbortSignalLike } from "@azure/abort-controller"; -import { TransferProgressEvent } from "@azure/core-http"; - import { AvroReadableFromStream, AvroReader } from "../../../storage-internal-avro/src"; +import { AbortSignalLike } from "@azure/abort-controller"; import { BlobQueryError } from "../Clients"; +import { Readable } from "stream"; +import { TransferProgressEvent } from "@azure/core-http"; export interface BlobQuickQueryStreamOptions { /** diff --git a/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts b/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts index 199749b4a123..06fbff940407 100644 --- a/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts +++ b/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { TransferProgressEvent } from "@azure/core-http"; import { Readable } from "stream"; +import { TransferProgressEvent } from "@azure/core-http"; export type ReadableStreamGetter = (offset: number) => Promise; diff --git a/sdk/storage/storage-blob/src/utils/utils.common.ts b/sdk/storage/storage-blob/src/utils/utils.common.ts index 8b312340b7b6..ca2ead151028 100644 --- a/sdk/storage/storage-blob/src/utils/utils.common.ts +++ b/sdk/storage/storage-blob/src/utils/utils.common.ts @@ -1,48 +1,52 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike } from "@azure/abort-controller"; -import { HttpHeaders, isNode, URLBuilder, TokenCredential } from "@azure/core-http"; - import { - BlobQueryArrowConfiguration, - BlobQueryCsvTextConfiguration, - BlobQueryJsonTextConfiguration, - BlobQueryParquetConfiguration -} from "../Clients"; -import { - QuerySerialization, - BlobTags, - BlobName, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, + AccessTier, + ArchiveStatus, + BlobImmutabilityPolicyMode, BlobItemInternal, + BlobName, BlobPrefix, + BlobTag, + BlobTags, BlobType, - LeaseStatusType, - LeaseStateType, - LeaseDurationType, CopyStatusType, - AccessTier, - ArchiveStatus, - RehydratePriority, - BlobImmutabilityPolicyMode, - BlobTag + LeaseDurationType, + LeaseStateType, + LeaseStatusType, + ListBlobsFlatSegmentResponse, + ListBlobsHierarchySegmentResponse, + QuerySerialization, + RehydratePriority } from "../generated/src/models"; +import { + BlobItemInternal as BlobItemInternalModel, + BlobPrefix as BlobPrefixModel, + ListBlobsFlatSegmentResponseModel, + ListBlobsHierarchySegmentResponseModel +} from "../generatedModels"; +import { + BlobQueryArrowConfiguration, + BlobQueryCsvTextConfiguration, + BlobQueryJsonTextConfiguration, + BlobQueryParquetConfiguration +} from "../Clients"; import { DevelopmentConnectionString, HeaderConstants, URLConstants } from "./constants"; import { - Tags, + HttpAuthorization, ObjectReplicationPolicy, ObjectReplicationRule, ObjectReplicationStatus, - HttpAuthorization + Tags } from "../models"; import { - ListBlobsFlatSegmentResponseModel, - BlobItemInternal as BlobItemInternalModel, - ListBlobsHierarchySegmentResponseModel, - BlobPrefix as BlobPrefixModel -} from "../generatedModels"; + HttpHeaders, + TokenCredential, + URLBuilder, + isNode +} from "@azure/core-http"; +import { AbortSignalLike } from "@azure/abort-controller"; /** * Reserved URL characters must be properly escaped for Storage services like Blob or File. diff --git a/sdk/storage/storage-blob/test/aborter.spec.ts b/sdk/storage/storage-blob/test/aborter.spec.ts index 0f5e905d5a51..f30480bbcff0 100644 --- a/sdk/storage/storage-blob/test/aborter.spec.ts +++ b/sdk/storage/storage-blob/test/aborter.spec.ts @@ -2,13 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; - +import * as dotenv from "dotenv"; import { AbortController, AbortSignal } from "@azure/abort-controller"; -import { ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import * as dotenv from "dotenv"; +import { ContainerClient } from "../src"; import { Context } from "mocha"; + dotenv.config(); describe("Aborter", () => { diff --git a/sdk/storage/storage-blob/test/appendblobclient.spec.ts b/sdk/storage/storage-blob/test/appendblobclient.spec.ts index 2c6d9d55d618..4e217bdaaae9 100644 --- a/sdk/storage/storage-blob/test/appendblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/appendblobclient.spec.ts @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { record, Recorder } from "@azure-tools/test-recorder"; import * as assert from "assert"; import * as dotenv from "dotenv"; -import { Context } from "mocha"; - import { AppendBlobClient, ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { bodyToString, getBSU, getSASConnectionStringFromEnvironment, recorderEnvSetup } from "./utils"; +import { Context } from "mocha"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/blobbatch.spec.ts b/sdk/storage/storage-blob/test/blobbatch.spec.ts index 6329cf236709..b2b2ba586e7f 100644 --- a/sdk/storage/storage-blob/test/blobbatch.spec.ts +++ b/sdk/storage/storage-blob/test/blobbatch.spec.ts @@ -4,23 +4,23 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import { + BlobBatchClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient, + StorageSharedKeyCredential, + newPipeline +} from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { + SimpleTokenCredential, getGenericBSU, getGenericCredential, + getTokenBSU, getTokenCredential, - SimpleTokenCredential, - recorderEnvSetup, - getTokenBSU + recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { BlobBatch } from "../src"; -import { - ContainerClient, - BlockBlobClient, - BlobServiceClient, - newPipeline, - BlobBatchClient, - StorageSharedKeyCredential -} from "../src"; import { Context } from "mocha"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/blobclient.spec.ts b/sdk/storage/storage-blob/test/blobclient.spec.ts index 24575b9da40a..5ea60cf62eb2 100644 --- a/sdk/storage/storage-blob/test/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/blobclient.spec.ts @@ -4,30 +4,36 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import * as fs from "fs"; -import { AbortController } from "@azure/abort-controller"; -import { isNode, URLBuilder, URLQuery } from "@azure/core-http"; -import { SpanGraph, setTracer } from "@azure/test-utils"; -import { - bodyToString, - getBSU, - getSASConnectionStringFromEnvironment, - recorderEnvSetup, - getGenericBSU, - getImmutableContainerName -} from "./utils"; -import { record, delay, isLiveMode, Recorder } from "@azure-tools/test-recorder"; import { BlobClient, + BlobServiceClient, BlockBlobClient, - ContainerClient, BlockBlobTier, - BlobServiceClient, + ContainerClient, RehydratePriority } from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; -import { base64encode } from "../src/utils/utils.common"; +import { + Recorder, + delay, + isLiveMode, + record +} from "@azure-tools/test-recorder"; +import { SpanGraph, setTracer } from "@azure/test-utils"; +import { URLBuilder, URLQuery, isNode } from "@azure/core-http"; +import { + bodyToString, + getBSU, + getGenericBSU, + getImmutableContainerName, + getSASConnectionStringFromEnvironment, + recorderEnvSetup +} from "./utils"; import { context, setSpan } from "@azure/core-tracing"; +import { AbortController } from "@azure/abort-controller"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; +import { base64encode } from "../src/utils/utils.common"; + dotenv.config(); describe("BlobClient", () => { diff --git a/sdk/storage/storage-blob/test/blobclientpollers.spec.ts b/sdk/storage/storage-blob/test/blobclientpollers.spec.ts index c6e19850ec7a..40f34e6fc1c1 100644 --- a/sdk/storage/storage-blob/test/blobclientpollers.spec.ts +++ b/sdk/storage/storage-blob/test/blobclientpollers.spec.ts @@ -3,20 +3,25 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; - -import { getBSU } from "./utils"; -import { record, Recorder, isRecordMode, isPlaybackMode } from "@azure-tools/test-recorder"; -import { recorderEnvSetup, testPollerProperties } from "./utils/testutils.common"; import { + BlobBeginCopyFromURLResponse, BlobClient, BlockBlobClient, ContainerClient, - BlobBeginCopyFromURLResponse, - PollerLike, - PollOperationState + PollOperationState, + PollerLike } from "../src"; +import { + Recorder, + isPlaybackMode, + isRecordMode, + record +} from "@azure-tools/test-recorder"; import { URLBuilder, URLQuery } from "@azure/core-http"; +import { recorderEnvSetup, testPollerProperties } from "./utils/testutils.common"; import { Context } from "mocha"; +import { getBSU } from "./utils"; + dotenv.config(); describe("BlobClient beginCopyFromURL Poller", () => { diff --git a/sdk/storage/storage-blob/test/blobserviceclient.spec.ts b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts index 8815307cde54..e45cccbcddf3 100644 --- a/sdk/storage/storage-blob/test/blobserviceclient.spec.ts +++ b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts @@ -2,9 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; -import { BlobServiceClient } from "../src"; +import { + Recorder, + delay, + isLiveMode, + record +} from "@azure-tools/test-recorder"; import { getAlternateBSU, getBSU, @@ -14,9 +18,10 @@ import { recorderEnvSetup, sleep } from "./utils"; -import { record, delay, Recorder, isLiveMode } from "@azure-tools/test-recorder"; -import { Tags } from "../src/models"; +import { BlobServiceClient } from "../src"; import { Context } from "mocha"; +import { Tags } from "../src/models"; + dotenv.config(); describe("BlobServiceClient", () => { diff --git a/sdk/storage/storage-blob/test/blobversioning.spec.ts b/sdk/storage/storage-blob/test/blobversioning.spec.ts index 7924cf40d6bb..836fbc6fb339 100644 --- a/sdk/storage/storage-blob/test/blobversioning.spec.ts +++ b/sdk/storage/storage-blob/test/blobversioning.spec.ts @@ -4,19 +4,25 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import * as fs from "fs"; -import { isNode, delay } from "@azure/core-http"; -import { getBSU, recorderEnvSetup, bodyToString, getGenericCredential } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { - ContainerClient, - BlobServiceClient, + BlobBatch, BlobClient, + BlobServiceClient, BlockBlobClient, BlockBlobUploadResponse, - BlobBatch + ContainerClient } from "../src"; -import { setURLParameter } from "../src/utils/utils.common"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { + bodyToString, + getBSU, + getGenericCredential, + recorderEnvSetup +} from "./utils"; +import { delay, isNode } from "@azure/core-http"; import { Context } from "mocha"; +import { setURLParameter } from "../src/utils/utils.common"; + dotenv.config({ path: "../.env" }); describe("Blob versioning", () => { diff --git a/sdk/storage/storage-blob/test/blockblobclient.spec.ts b/sdk/storage/storage-blob/test/blockblobclient.spec.ts index da72d8ded512..2449dcc80c77 100644 --- a/sdk/storage/storage-blob/test/blockblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/blockblobclient.spec.ts @@ -2,9 +2,9 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { record, Recorder } from "@azure-tools/test-recorder"; import * as dotenv from "dotenv"; +import { BlobClient, BlockBlobClient, ContainerClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { base64encode, bodyToString, @@ -12,11 +12,11 @@ import { getSASConnectionStringFromEnvironment, recorderEnvSetup } from "./utils"; -import { ContainerClient, BlobClient, BlockBlobClient } from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { BlockBlobTier } from "../src"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { isNode } from "@azure/core-http"; + dotenv.config(); describe("BlockBlobClient", () => { diff --git a/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts b/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts index 91e21b1d932f..0f1066785d48 100644 --- a/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts +++ b/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts @@ -2,19 +2,23 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { AbortController } from "@azure/abort-controller"; +import { + BlobClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient +} from "../../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { arrayBufferEqual, blobToArrayBuffer, blobToString, bodyToString, - getBrowserFile, getBSU, + getBrowserFile, recorderEnvSetup } from "../utils/index.browser"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { ContainerClient, BlobClient, BlockBlobClient, BlobServiceClient } from "../../src"; +import { AbortController } from "@azure/abort-controller"; import { Context } from "mocha"; describe("Highlevel", () => { diff --git a/sdk/storage/storage-blob/test/containerclient.spec.ts b/sdk/storage/storage-blob/test/containerclient.spec.ts index 13b985a5132e..65a3401e2a4b 100644 --- a/sdk/storage/storage-blob/test/containerclient.spec.ts +++ b/sdk/storage/storage-blob/test/containerclient.spec.ts @@ -3,7 +3,14 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { TestTracer, SpanGraph, setTracer } from "@azure/test-utils"; +import { + BlobServiceClient, + BlockBlobTier, + ContainerClient, + ContainerListBlobHierarchySegmentResponse +} from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { SpanGraph, TestTracer, setTracer } from "@azure/test-utils"; import { bodyToString, getBSU, @@ -11,17 +18,11 @@ import { isSuperSet, recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { URLBuilder } from "@azure/core-http"; -import { - ContainerClient, - BlockBlobTier, - ContainerListBlobHierarchySegmentResponse, - BlobServiceClient -} from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; import { context, setSpan } from "@azure/core-tracing"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; +import { URLBuilder } from "@azure/core-http"; + dotenv.config(); describe("ContainerClient", () => { diff --git a/sdk/storage/storage-blob/test/encrytion.spec.ts b/sdk/storage/storage-blob/test/encrytion.spec.ts index f9e4f9acdb28..ea3ae4ba21f4 100644 --- a/sdk/storage/storage-blob/test/encrytion.spec.ts +++ b/sdk/storage/storage-blob/test/encrytion.spec.ts @@ -3,11 +3,22 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { getBSU, getEncryptionScope_1, getEncryptionScope_2, recorderEnvSetup } from "./utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { BlobServiceClient, BlobClient, BlockBlobClient, ContainerClient } from "../src"; -import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; +import { + BlobClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient +} from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { + getBSU, + getEncryptionScope_1, + getEncryptionScope_2, + recorderEnvSetup +} from "./utils"; import { Context } from "mocha"; +import { Test_CPK_INFO } from "./utils/fakeTestSecrets"; + dotenv.config(); describe("Encryption Scope", function() { diff --git a/sdk/storage/storage-blob/test/leaseclient.spec.ts b/sdk/storage/storage-blob/test/leaseclient.spec.ts index 2b13cbed108b..999ac1225a85 100644 --- a/sdk/storage/storage-blob/test/leaseclient.spec.ts +++ b/sdk/storage/storage-blob/test/leaseclient.spec.ts @@ -2,12 +2,17 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; +import { + BlobClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient +} from "../src"; +import { Recorder, delay, record } from "@azure-tools/test-recorder"; import { getBSU, recorderEnvSetup } from "./utils"; -import { record, delay, Recorder } from "@azure-tools/test-recorder"; -import { ContainerClient, BlobClient, BlockBlobClient, BlobServiceClient } from "../src"; import { Context } from "mocha"; + dotenv.config(); describe("LeaseClient from Container", () => { diff --git a/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts b/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts index ca11e7d2e06f..2d333e84b818 100644 --- a/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts @@ -2,30 +2,30 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; import { AppendBlobClient, - newPipeline, - StorageSharedKeyCredential, + BlobSASPermissions, + BlobServiceClient, ContainerClient, + StorageSharedKeyCredential, generateBlobSASQueryParameters, - BlobSASPermissions, - BlobServiceClient + newPipeline } from "../../src"; +import { Recorder, isPlaybackMode, record } from "@azure-tools/test-recorder"; import { + bodyToString, getBSU, getConnectionStringFromEnvironment, - bodyToString, - recorderEnvSetup, getTokenBSU, - getTokenCredential + getTokenCredential, + recorderEnvSetup } from "../utils"; +import { Context } from "mocha"; +import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; -import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; -import { Context } from "mocha"; + dotenv.config(); describe("AppendBlobClient Node.js only", () => { diff --git a/sdk/storage/storage-blob/test/node/blobclient.spec.ts b/sdk/storage/storage-blob/test/node/blobclient.spec.ts index fdeefad132ad..f4cf5dd76efc 100644 --- a/sdk/storage/storage-blob/test/node/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobclient.spec.ts @@ -3,23 +3,23 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { readFileSync, unlinkSync, existsSync, mkdirSync } from "fs"; -import { join } from "path"; - -import { AbortController } from "@azure/abort-controller"; -import { isNode, TokenCredential } from "@azure/core-http"; -import { delay, isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; - import { BlobClient, BlobSASPermissions, BlobServiceClient, BlockBlobClient, ContainerClient, + StorageSharedKeyCredential, generateBlobSASQueryParameters, - newPipeline, - StorageSharedKeyCredential + newPipeline } from "../../src"; +import { + Recorder, + delay, + isPlaybackMode, + record +} from "@azure-tools/test-recorder"; +import { TokenCredential, isNode } from "@azure/core-http"; import { bodyToString, createRandomLocalFile, @@ -31,10 +31,18 @@ import { getTokenCredential, recorderEnvSetup } from "../utils"; +import { + existsSync, + mkdirSync, + readFileSync, + unlinkSync +} from "fs"; +import { AbortController } from "@azure/abort-controller"; +import { Context } from "mocha"; import { assertClientUsesTokenCredential } from "../utils/assert"; +import { join } from "path"; import { readStreamToLocalFileWithLogs } from "../utils/testutils.node"; import { streamToBuffer3 } from "../../src/utils/utils.node"; -import { Context } from "mocha"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts b/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts index fef357203d72..5c6757ac90db 100644 --- a/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts @@ -2,12 +2,12 @@ // Licensed under the MIT license. import * as assert from "assert"; - import * as dotenv from "dotenv"; -import { BlobServiceClient, newPipeline, StorageSharedKeyCredential } from "../../src"; +import { BlobServiceClient, StorageSharedKeyCredential, newPipeline } from "../../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; + dotenv.config(); describe("BlobServiceClient Node.js only", () => { diff --git a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts index b7b6a5de4359..2e9ed9a8b79d 100644 --- a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts @@ -2,8 +2,19 @@ // Licensed under the MIT license. import * as assert from "assert"; +import * as crypto from "crypto"; import * as zlib from "zlib"; - +import { + BlobClient, + BlobSASPermissions, + BlobServiceClient, + BlockBlobClient, + ContainerClient, + StorageSharedKeyCredential, + generateBlobSASQueryParameters, + newPipeline +} from "../../src"; +import { Recorder, isPlaybackMode, record } from "@azure-tools/test-recorder"; import { base64encode, bodyToString, @@ -14,23 +25,11 @@ import { getTokenCredential, recorderEnvSetup } from "../utils"; -import { - BlockBlobClient, - newPipeline, - StorageSharedKeyCredential, - BlobClient, - ContainerClient, - BlobServiceClient, - generateBlobSASQueryParameters, - BlobSASPermissions -} from "../../src"; +import { BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "../../src/utils/constants"; +import { Context } from "mocha"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; import { streamToBuffer3 } from "../../src/utils/utils.node"; -import * as crypto from "crypto"; -import { BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "../../src/utils/constants"; -import { Context } from "mocha"; describe("BlockBlobClient Node.js only", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/containerclient.spec.ts b/sdk/storage/storage-blob/test/node/containerclient.spec.ts index 066780b98fff..9f833bf015a3 100644 --- a/sdk/storage/storage-blob/test/node/containerclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/containerclient.spec.ts @@ -2,20 +2,19 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; -import { PublicAccessType } from "../../src"; import { + BlobServiceClient, ContainerClient, - newPipeline, - StorageSharedKeyCredential, ContainerSASPermissions, - BlobServiceClient + StorageSharedKeyCredential, + newPipeline } from "../../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; +import { Context } from "mocha"; +import { PublicAccessType } from "../../src"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { Context } from "mocha"; describe("ContainerClient Node.js only", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts b/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts index 57df690872eb..67dad6cca48d 100644 --- a/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts +++ b/sdk/storage/storage-blob/test/node/emulator-tests.spec.ts @@ -5,14 +5,20 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; import { BlobClient, - ContainerClient, BlobServiceClient, BlockBlobClient, + ContainerClient, PageBlobClient } from "../../src"; -import { getBSU, getConnectionStringFromEnvironment, bodyToString, getUniqueName } from "../utils"; -import { env } from "@azure-tools/test-recorder"; +import { + bodyToString, + getBSU, + getConnectionStringFromEnvironment, + getUniqueName +} from "../utils"; import { Context } from "mocha"; +import { env } from "@azure-tools/test-recorder"; + dotenv.config(); // Expected environment variable to run this test-suite diff --git a/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts b/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts index 4d5e1a2d4c6a..cc0ef70e4e6c 100644 --- a/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts +++ b/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts @@ -5,25 +5,29 @@ import * as assert from "assert"; import * as buffer from "buffer"; import * as fs from "fs"; import * as path from "path"; +import { + BlobClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient +} from "../../src"; import { PassThrough, Readable } from "stream"; - -import { AbortController } from "@azure/abort-controller"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { - createRandomLocalFile, - recorderEnvSetup, bodyToString, + createRandomLocalFile, + createRandomLocalFileWithTotalSize, getBSU, - createRandomLocalFileWithTotalSize + recorderEnvSetup } from "../utils"; -import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; -import { record, Recorder } from "@azure-tools/test-recorder"; -import { ContainerClient, BlobClient, BlockBlobClient, BlobServiceClient } from "../../src"; -import { readStreamToLocalFileWithLogs } from "../utils/testutils.node"; +import { AbortController } from "@azure/abort-controller"; import { BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES } from "../../src/utils/constants"; +import { Context } from "mocha"; +import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; -import { streamToBuffer2 } from "../../src/utils/utils.node"; import { delay } from "../../src/utils/utils.common"; -import { Context } from "mocha"; +import { readStreamToLocalFileWithLogs } from "../utils/testutils.node"; +import { streamToBuffer2 } from "../../src/utils/utils.node"; describe("Highlevel", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts index 29427d3c9279..8a14c1fdb2c7 100644 --- a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts @@ -2,30 +2,34 @@ // Licensed under the MIT license. import * as assert from "assert"; - -import { - getBSU, - getConnectionStringFromEnvironment, - bodyToString, - recorderEnvSetup, - getTokenBSU, - getTokenCredential -} from "../utils"; import { - newPipeline, + BlobClient, + BlobSASPermissions, + BlobServiceClient, + ContainerClient, PageBlobClient, StorageSharedKeyCredential, - ContainerClient, - BlobClient, generateBlobSASQueryParameters, - BlobSASPermissions, - BlobServiceClient + newPipeline } from "../../src"; +import { + Recorder, + delay, + isPlaybackMode, + record +} from "@azure-tools/test-recorder"; +import { + bodyToString, + getBSU, + getConnectionStringFromEnvironment, + getTokenBSU, + getTokenCredential, + recorderEnvSetup +} from "../utils"; +import { Context } from "mocha"; +import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { record, delay, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; -import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; -import { Context } from "mocha"; describe("PageBlobClient Node.js only", () => { let containerName: string; diff --git a/sdk/storage/storage-blob/test/node/sas.spec.ts b/sdk/storage/storage-blob/test/node/sas.spec.ts index 76b1a46b7a4f..fe3ede114a73 100644 --- a/sdk/storage/storage-blob/test/node/sas.spec.ts +++ b/sdk/storage/storage-blob/test/node/sas.spec.ts @@ -2,27 +2,32 @@ // Licensed under the MIT license. import * as assert from "assert"; - import { AccountSASPermissions, AccountSASResourceTypes, AccountSASServices, AnonymousCredential, + BlobBatch, + BlobClient, BlobSASPermissions, - ContainerSASPermissions, + BlobServiceClient, ContainerClient, - generateAccountSASQueryParameters, - generateBlobSASQueryParameters, + ContainerSASPermissions, PageBlobClient, - BlobServiceClient, + SASProtocol, StorageSharedKeyCredential, - newPipeline, - BlobClient, Tags, - SASProtocol, UserDelegationKey, - BlobBatch + generateAccountSASQueryParameters, + generateBlobSASQueryParameters, + newPipeline } from "../../src"; +import { + Recorder, + delay, + isLiveMode, + record +} from "@azure-tools/test-recorder"; import { getBSU, getEncryptionScope_1, @@ -31,9 +36,8 @@ import { recorderEnvSetup, sleep } from "../utils"; -import { delay, isLiveMode, record, Recorder } from "@azure-tools/test-recorder"; -import { SERVICE_VERSION } from "../../src/utils/constants"; import { Context } from "mocha"; +import { SERVICE_VERSION } from "../../src/utils/constants"; describe("Shared Access Signature (SAS) generation Node.js only", () => { let recorder: Recorder; diff --git a/sdk/storage/storage-blob/test/node/utils.spec.ts b/sdk/storage/storage-blob/test/node/utils.spec.ts index 84a015c6eab4..f6181766360d 100644 --- a/sdk/storage/storage-blob/test/node/utils.spec.ts +++ b/sdk/storage/storage-blob/test/node/utils.spec.ts @@ -2,21 +2,15 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { randomBytes } from "crypto"; import * as dotenv from "dotenv"; import * as fs from "fs"; import * as path from "path"; +import { PassThrough, Readable, ReadableOptions } from "stream"; +import { ReadableStreamGetter, RetriableReadableStream } from "../../src/utils/RetriableReadableStream"; import { delay, extractConnectionStringParts } from "../../src/utils/utils.common"; -import { Readable, ReadableOptions, PassThrough } from "stream"; -import { - readStreamToLocalFile, - streamToBuffer2, - streamToBuffer3 -} from "../../src/utils/utils.node"; -import { - ReadableStreamGetter, - RetriableReadableStream -} from "../../src/utils/RetriableReadableStream"; +import { readStreamToLocalFile, streamToBuffer2, streamToBuffer3 } from "../../src/utils/utils.node"; +import { randomBytes } from "crypto"; + dotenv.config(); describe("Utility Helpers Node.js only", () => { diff --git a/sdk/storage/storage-blob/test/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/pageblobclient.spec.ts index 35a78be4de12..5cf6fc4a2bd9 100644 --- a/sdk/storage/storage-blob/test/pageblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/pageblobclient.spec.ts @@ -3,6 +3,14 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; +import { + BlobClient, + BlobServiceClient, + ContainerClient, + PageBlobClient, + PremiumPageBlobTier +} from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { bodyToString, getBSU, @@ -10,15 +18,8 @@ import { getSASConnectionStringFromEnvironment, recorderEnvSetup } from "./utils"; -import { - ContainerClient, - BlobClient, - PageBlobClient, - PremiumPageBlobTier, - BlobServiceClient -} from "../src"; -import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; + dotenv.config(); describe("PageBlobClient", () => { diff --git a/sdk/storage/storage-blob/test/retrypolicy.spec.ts b/sdk/storage/storage-blob/test/retrypolicy.spec.ts index c5aa75a38086..b0abaf6c77a0 100644 --- a/sdk/storage/storage-blob/test/retrypolicy.spec.ts +++ b/sdk/storage/storage-blob/test/retrypolicy.spec.ts @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { URLBuilder } from "@azure/core-http"; import * as assert from "assert"; import * as dotenv from "dotenv"; - -import { AbortController } from "@azure/abort-controller"; -import { ContainerClient, RestError, BlobServiceClient } from "../src"; -import { newPipeline, Pipeline } from "../src"; +import { BlobServiceClient, ContainerClient, RestError } from "../src"; +import { Pipeline, newPipeline } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; import { getBSU, recorderEnvSetup } from "./utils"; -import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; -import { record, Recorder } from "@azure-tools/test-recorder"; +import { AbortController } from "@azure/abort-controller"; import { Context } from "mocha"; +import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; +import { URLBuilder } from "@azure/core-http"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/specialnaming.spec.ts b/sdk/storage/storage-blob/test/specialnaming.spec.ts index 0657d66002d7..a0cd5eb27319 100644 --- a/sdk/storage/storage-blob/test/specialnaming.spec.ts +++ b/sdk/storage/storage-blob/test/specialnaming.spec.ts @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { BlockBlobClient, BlobServiceClient } from "../src"; -import { getBSU, recorderEnvSetup } from "./utils/index"; import * as assert from "assert"; -import { appendToURLPath } from "../src/utils/utils.common"; -import { record, Recorder } from "@azure-tools/test-recorder"; import * as dotenv from "dotenv"; +import { BlobServiceClient, BlockBlobClient } from "../src"; +import { Recorder, record } from "@azure-tools/test-recorder"; +import { getBSU, recorderEnvSetup } from "./utils/index"; import { ContainerClient } from "../src"; import { Context } from "mocha"; +import { appendToURLPath } from "../src/utils/utils.common"; + dotenv.config(); describe("Special Naming Tests", () => { diff --git a/sdk/storage/storage-blob/test/utils.spec.ts b/sdk/storage/storage-blob/test/utils.spec.ts index 9c651de22fab..cf67344025d2 100644 --- a/sdk/storage/storage-blob/test/utils.spec.ts +++ b/sdk/storage/storage-blob/test/utils.spec.ts @@ -3,14 +3,15 @@ import * as assert from "assert"; import * as dotenv from "dotenv"; -import { HttpHeaders } from "../src"; import { - sanitizeHeaders, - sanitizeURL, extractConnectionStringParts, - isIpEndpointStyle + isIpEndpointStyle, + sanitizeHeaders, + sanitizeURL } from "../src/utils/utils.common"; +import { HttpHeaders } from "../src"; import { URLBuilder } from "@azure/core-http"; + dotenv.config(); describe("Utility Helpers", () => { diff --git a/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts b/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts index a4a7e192b413..61291b94c0a5 100644 --- a/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts +++ b/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts @@ -6,8 +6,8 @@ import { HttpOperationResponse, RequestPolicy, RequestPolicyOptions, - WebResource, - RestError + RestError, + WebResource } from "../../src"; export interface NextInjectErrorHolder { diff --git a/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts b/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts index b0c36c384558..7279529f2790 100644 --- a/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts +++ b/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { Injector, InjectorPolicy } from "./InjectorPolicy"; import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "../../src"; -import { InjectorPolicy, Injector } from "./InjectorPolicy"; /** * InjectorPolicyFactory is a factory class which injects customized errors for retry policy testing. diff --git a/sdk/storage/storage-blob/test/utils/index.browser.ts b/sdk/storage/storage-blob/test/utils/index.browser.ts index afe64ee7081d..e3b4921ccbcd 100644 --- a/sdk/storage/storage-blob/test/utils/index.browser.ts +++ b/sdk/storage/storage-blob/test/utils/index.browser.ts @@ -3,9 +3,9 @@ import { AnonymousCredential } from "../../src"; import { BlobServiceClient } from "../../src"; -import { newPipeline } from "../../src"; import { SimpleTokenCredential } from "./testutils.common"; import { TokenCredential } from "@azure/core-http"; +import { newPipeline } from "../../src"; export * from "./testutils.common"; diff --git a/sdk/storage/storage-blob/test/utils/index.ts b/sdk/storage/storage-blob/test/utils/index.ts index b20ec1d4ae3c..ace1ab212e39 100644 --- a/sdk/storage/storage-blob/test/utils/index.ts +++ b/sdk/storage/storage-blob/test/utils/index.ts @@ -1,27 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { randomBytes } from "crypto"; import * as dotenv from "dotenv"; import * as fs from "fs"; import * as path from "path"; - -import { SimpleTokenCredential } from "./testutils.common"; -import { StoragePipelineOptions, StorageSharedKeyCredential } from "../../src"; -import { BlobServiceClient } from "../../src"; -import { getUniqueName } from "./testutils.common"; -import { newPipeline } from "../../src"; import { - generateAccountSASQueryParameters, AccountSASPermissions, - SASProtocol, AccountSASResourceTypes, - AccountSASServices + AccountSASServices, + SASProtocol, + generateAccountSASQueryParameters } from "../../src"; -import { extractConnectionStringParts } from "../../src/utils/utils.common"; +import { StoragePipelineOptions, StorageSharedKeyCredential } from "../../src"; +import { BlobServiceClient } from "../../src"; +import { DefaultAzureCredential } from "@azure/identity"; +import { SimpleTokenCredential } from "./testutils.common"; import { TokenCredential } from "@azure/core-http"; import { env } from "@azure-tools/test-recorder"; -import { DefaultAzureCredential } from "@azure/identity"; +import { extractConnectionStringParts } from "../../src/utils/utils.common"; +import { getUniqueName } from "./testutils.common"; +import { newPipeline } from "../../src"; +import { randomBytes } from "crypto"; dotenv.config(); diff --git a/sdk/storage/storage-blob/test/utils/testutils.common.ts b/sdk/storage/storage-blob/test/utils/testutils.common.ts index 221da1645178..ec61c3d0da3e 100644 --- a/sdk/storage/storage-blob/test/utils/testutils.common.ts +++ b/sdk/storage/storage-blob/test/utils/testutils.common.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-http"; +import { RecorderEnvironmentSetup, env, isPlaybackMode } from "@azure-tools/test-recorder"; import { padStart } from "../../src/utils/utils.common"; -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -import { isPlaybackMode, env, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; export const testPollerProperties = { intervalInMs: isPlaybackMode() ? 0 : undefined