From ed07e611afd416ca5639273aa735ac3f3d07704c Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Thu, 16 May 2019 14:52:13 -0700 Subject: [PATCH] [Storage-file] Remove I- prefix from interface names --- .../storage-file/src/AccountSASPermissions.ts | 2 +- .../src/AccountSASResourceTypes.ts | 2 +- .../storage-file/src/AccountSASServices.ts | 2 +- ...Values.ts => AccountSASSignatureValues.ts} | 32 ++++---- .../storage-file/src/DirectoryClient.ts | 28 +++---- sdk/storage/storage-file/src/FileClient.ts | 76 +++++++++---------- .../storage-file/src/FileDownloadResponse.ts | 12 +-- .../storage-file/src/FileSASPermissions.ts | 2 +- ...ureValues.ts => FileSASSignatureValues.ts} | 44 +++++------ .../storage-file/src/FileServiceClient.ts | 12 +-- .../src/{IIPRange.ts => IPRange.ts} | 8 +- .../storage-file/src/LoggingPolicyFactory.ts | 10 +-- sdk/storage/storage-file/src/Pipeline.ts | 10 +-- .../storage-file/src/{IRange.ts => Range.ts} | 26 +++---- .../storage-file/src/RetryPolicyFactory.ts | 18 ++--- .../storage-file/src/SASQueryParameters.ts | 20 ++--- sdk/storage/storage-file/src/ShareClient.ts | 40 +++++----- .../storage-file/src/ShareSASPermissions.ts | 2 +- sdk/storage/storage-file/src/StorageClient.ts | 20 ++--- .../src/TelemetryPolicyFactory.ts | 8 +- .../storage-file/src/highlevel.browser.ts | 10 +-- .../storage-file/src/highlevel.common.ts | 36 ++++----- .../storage-file/src/highlevel.node.ts | 38 +++++----- sdk/storage/storage-file/src/index.browser.ts | 4 +- sdk/storage/storage-file/src/index.ts | 8 +- sdk/storage/storage-file/src/models.ts | 4 +- .../src/policies/LoggingPolicy.ts | 12 +-- .../storage-file/src/policies/RetryPolicy.ts | 18 ++--- .../src/policies/TelemetryPolicy.ts | 2 +- .../src/utils/RetriableReadableStream.ts | 14 ++-- .../test/node/highlevel.node.spec.ts | 12 +-- .../storage-file/test/node/sas.spec.ts | 2 +- .../test/node/shareclient.spec.ts | 4 +- .../storage-file/test/utils/InjectorPolicy.ts | 2 +- sdk/storage/storage-file/tslint.json | 3 +- 35 files changed, 272 insertions(+), 271 deletions(-) rename sdk/storage/storage-file/src/{IAccountSASSignatureValues.ts => AccountSASSignatureValues.ts} (85%) rename sdk/storage/storage-file/src/{IFileSASSignatureValues.ts => FileSASSignatureValues.ts} (86%) rename sdk/storage/storage-file/src/{IIPRange.ts => IPRange.ts} (81%) rename sdk/storage/storage-file/src/{IRange.ts => Range.ts} (54%) diff --git a/sdk/storage/storage-file/src/AccountSASPermissions.ts b/sdk/storage/storage-file/src/AccountSASPermissions.ts index 402f0cc9bec0..b5b66c116dbe 100644 --- a/sdk/storage/storage-file/src/AccountSASPermissions.ts +++ b/sdk/storage/storage-file/src/AccountSASPermissions.ts @@ -4,7 +4,7 @@ * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the * values are set, this should be serialized with toString and set as the permissions field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/AccountSASResourceTypes.ts b/sdk/storage/storage-file/src/AccountSASResourceTypes.ts index 4c2f35bb256d..d98715edbbdf 100644 --- a/sdk/storage/storage-file/src/AccountSASResourceTypes.ts +++ b/sdk/storage/storage-file/src/AccountSASResourceTypes.ts @@ -4,7 +4,7 @@ * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the * values are set, this should be serialized with toString and set as the resources field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the resources string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but * the order of the resources is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/AccountSASServices.ts b/sdk/storage/storage-file/src/AccountSASServices.ts index 60d43e0a2db8..1dc9f5e974ac 100644 --- a/sdk/storage/storage-file/src/AccountSASServices.ts +++ b/sdk/storage/storage-file/src/AccountSASServices.ts @@ -4,7 +4,7 @@ * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that service. Once all the * values are set, this should be serialized with toString and set as the services field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the services string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but * the order of the services is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/IAccountSASSignatureValues.ts b/sdk/storage/storage-file/src/AccountSASSignatureValues.ts similarity index 85% rename from sdk/storage/storage-file/src/IAccountSASSignatureValues.ts rename to sdk/storage/storage-file/src/AccountSASSignatureValues.ts index 8e440b0a1341..d7dd4406446e 100644 --- a/sdk/storage/storage-file/src/IAccountSASSignatureValues.ts +++ b/sdk/storage/storage-file/src/AccountSASSignatureValues.ts @@ -2,7 +2,7 @@ import { AccountSASPermissions } from "./AccountSASPermissions"; import { AccountSASResourceTypes } from "./AccountSASResourceTypes"; import { AccountSASServices } from "./AccountSASServices"; import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "./utils/constants"; import { truncatedISO8061Date } from "./utils/utils.common"; @@ -10,7 +10,7 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IAccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once + * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS * which can actually be applied to file urls. Note: that both this class and {@link SASQueryParameters} exist because * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST @@ -23,14 +23,14 @@ import { truncatedISO8061Date } from "./utils/utils.common"; * for descriptions of the parameters, including which are required * * @export - * @class IAccountSASSignatureValues + * @class AccountSASSignatureValues */ -export interface IAccountSASSignatureValues { +export interface AccountSASSignatureValues { /** * If not provided, this defaults to the service version targeted by this version of the library. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ version?: string; @@ -38,7 +38,7 @@ export interface IAccountSASSignatureValues { * Optional. SAS protocols allowed. * * @type {SASProtocol} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ protocol?: SASProtocol; @@ -46,7 +46,7 @@ export interface IAccountSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ startTime?: Date; @@ -54,7 +54,7 @@ export interface IAccountSASSignatureValues { * The time after which the SAS will no longer work. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ expiryTime: Date; @@ -63,24 +63,24 @@ export interface IAccountSASSignatureValues { * constructing the permissions string. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ permissions: string; /** * Optional. IP range allowed. * - * @type {IIPRange} - * @memberof IAccountSASSignatureValues + * @type {IPRange} + * @memberof AccountSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to * construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ services: string; @@ -89,7 +89,7 @@ export interface IAccountSASSignatureValues { * to {@link AccountSASResourceTypes} to construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ resourceTypes: string; } @@ -104,10 +104,10 @@ export interface IAccountSASSignatureValues { * * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ export function generateAccountSASQueryParameters( - accountSASSignatureValues: IAccountSASSignatureValues, + accountSASSignatureValues: AccountSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { const version = accountSASSignatureValues.version diff --git a/sdk/storage/storage-file/src/DirectoryClient.ts b/sdk/storage/storage-file/src/DirectoryClient.ts index 7f1bb74522b8..6e0078037e47 100644 --- a/sdk/storage/storage-file/src/DirectoryClient.ts +++ b/sdk/storage/storage-file/src/DirectoryClient.ts @@ -1,30 +1,30 @@ import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; import { Directory } from "./generated/lib/operations"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { Pipeline } from "./Pipeline"; import { ShareClient } from "./ShareClient"; import { StorageClient } from "./StorageClient"; import { appendToURLPath } from "./utils/utils.common"; -export interface IDirectoryCreateOptions { +export interface DirectoryCreateOptions { /** * A name-value pair * to associate with a file storage object. * - * @type {IMetadata} - * @memberof IDirectoryCreateOptions + * @type {Metadata} + * @memberof DirectoryCreateOptions */ - metadata?: IMetadata; + metadata?: Metadata; } -export interface IDirectoryListFilesAndDirectoriesSegmentOptions { +export interface DirectoryListFilesAndDirectoriesSegmentOptions { /** * Filters the results to return only entries whose * name begins with the specified prefix. * * @type {string} - * @memberof IDirectoryListFilesAndDirectoriesSegmentOptions + * @memberof DirectoryListFilesAndDirectoriesSegmentOptions */ prefix?: string; @@ -34,7 +34,7 @@ export interface IDirectoryListFilesAndDirectoriesSegmentOptions { * greater than 5,000, the server will return up to 5,000 items. * * @type {number} - * @memberof IDirectoryListFilesAndDirectoriesSegmentOptions + * @memberof DirectoryListFilesAndDirectoriesSegmentOptions */ maxresults?: number; } @@ -123,13 +123,13 @@ export class DirectoryClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IDirectoryCreateOptions} [options] + * @param {DirectoryCreateOptions} [options] * @returns {Promise} * @memberof DirectoryClient */ public async create( aborter: Aborter, - options: IDirectoryCreateOptions = {} + options: DirectoryCreateOptions = {} ): Promise { return this.context.create({ ...options, @@ -176,13 +176,13 @@ export class DirectoryClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed + * @param {Metadata} [metadata] If no metadata provided, all existing directory metadata will be removed * @returns {Promise} * @memberof DirectoryClient */ public async setMetadata( aborter: Aborter, - metadata?: IMetadata + metadata?: Metadata ): Promise { return this.context.setMetadata({ abortSignal: aborter, @@ -198,14 +198,14 @@ export class DirectoryClient extends StorageClient { * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation * @param {string} [marker] - * @param {IDirectoryListFilesAndDirectoriesSegmentOptions} [options] + * @param {DirectoryListFilesAndDirectoriesSegmentOptions} [options] * @returns {Promise} * @memberof DirectoryClient */ public async listFilesAndDirectoriesSegment( aborter: Aborter, marker?: string, - options: IDirectoryListFilesAndDirectoriesSegmentOptions = {} + options: DirectoryListFilesAndDirectoriesSegmentOptions = {} ): Promise { return this.context.listFilesAndDirectoriesSegment({ abortSignal: aborter, diff --git a/sdk/storage/storage-file/src/FileClient.ts b/sdk/storage/storage-file/src/FileClient.ts index ab4b6024d40c..559d896b7397 100644 --- a/sdk/storage/storage-file/src/FileClient.ts +++ b/sdk/storage/storage-file/src/FileClient.ts @@ -4,8 +4,8 @@ import { DirectoryClient } from "./DirectoryClient"; import { FileDownloadResponse } from "./FileDownloadResponse"; import * as Models from "./generated/lib/models"; import { File } from "./generated/lib/operations"; -import { IRange, rangeToString } from "./IRange"; -import { IFileHTTPHeaders, IMetadata } from "./models"; +import { Range, rangeToString } from "./Range"; +import { FileHTTPHeaders, Metadata } from "./models"; import { Pipeline } from "./Pipeline"; import { StorageClient } from "./StorageClient"; import { @@ -15,26 +15,26 @@ import { } from "./utils/constants"; import { appendToURLPath } from "./utils/utils.common"; -export interface IFileCreateOptions { +export interface FileCreateOptions { /** * File HTTP headers like Content-Type. * - * @type {IFileHTTPHeaders} - * @memberof IFileCreateOptions + * @type {FileHTTPHeaders} + * @memberof FileCreateOptions */ - fileHTTPHeaders?: IFileHTTPHeaders; + fileHTTPHeaders?: FileHTTPHeaders; /** * A name-value pair * to associate with a file storage object. * - * @type {IMetadata} - * @memberof IFileCreateOptions + * @type {Metadata} + * @memberof FileCreateOptions */ - metadata?: IMetadata; + metadata?: Metadata; } -export interface IFileDownloadOptions { +export interface FileDownloadOptions { /** * Optional. ONLY AVAILABLE IN NODE.JS. * @@ -48,7 +48,7 @@ export interface IFileDownloadOptions { * Default value is 5, please set a larger value when loading large files in poor network. * * @type {number} - * @memberof IFileDownloadOptions + * @memberof FileDownloadOptions */ maxRetryRequests?: number; @@ -58,19 +58,19 @@ export interface IFileDownloadOptions { * for the range, as long as the range is less than or equal to 4 MB in size. * * @type {boolean} - * @memberof IFileDownloadOptions + * @memberof FileDownloadOptions */ rangeGetContentMD5?: boolean; /** * Download progress updating event handler. * - * @memberof IFileDownloadOptions + * @memberof FileDownloadOptions */ progress?: (progress: TransferProgressEvent) => void; } -export interface IFileUploadRangeOptions { +export interface FileUploadRangeOptions { /** * An MD5 hash of the content. This hash is * used to verify the integrity of the data during transport. When the @@ -80,26 +80,26 @@ export interface IFileUploadRangeOptions { * Request). * * @type {Uint8Array} - * @memberof IFileUploadRangeOptions + * @memberof FileUploadRangeOptions */ contentMD5?: Uint8Array; /** * Progress updating event handler. * - * @memberof IFileUploadRangeOptions + * @memberof FileUploadRangeOptions */ progress?: (progress: TransferProgressEvent) => void; } -export interface IFileGetRangeListOptions { +export interface FileGetRangeListOptions { /** * Optional. Specifies the range of bytes over which to list ranges, inclusively. * - * @type {IRange} - * @memberof IFileGetRangeListOptions + * @type {Range} + * @memberof FileGetRangeListOptions */ - range?: IRange; + range?: Range; } /** @@ -132,15 +132,15 @@ export type FileGetRangeListResponse = Models.FileGetRangeListHeaders & { }; }; -export interface IFileStartCopyOptions { +export interface FileStartCopyOptions { /** * A name-value pair * to associate with a file storage object. * - * @type {IMetadata} - * @memberof IFileCreateOptions + * @type {Metadata} + * @memberof FileCreateOptions */ - metadata?: IMetadata; + metadata?: Metadata; } /** @@ -215,14 +215,14 @@ export class FileClient extends StorageClient { * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation * @param {number} size Specifies the maximum size in bytes for the file, up to 1 TB. - * @param {IFileCreateOptions} [options] + * @param {FileCreateOptions} [options] * @returns {Promise} * @memberof FileClient */ public async create( aborter: Aborter, size: number, - options: IFileCreateOptions = {} + options: FileCreateOptions = {} ): Promise { if (size < 0 || size > FILE_MAX_SIZE_BYTES) { throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`); @@ -248,7 +248,7 @@ export class FileClient extends StorageClient { * goto documents of Aborter for more examples about request cancellation * @param {number} offset From which position of the file to download, >= 0 * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined - * @param {IFileDownloadOptions} [options] + * @param {FileDownloadOptions} [options] * @returns {Promise} * @memberof FileClient */ @@ -256,7 +256,7 @@ export class FileClient extends StorageClient { aborter: Aborter, offset: number, count?: number, - options: IFileDownloadOptions = {} + options: FileDownloadOptions = {} ): Promise { if (options.rangeGetContentMD5 && offset === 0 && count === undefined) { throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`); @@ -371,14 +371,14 @@ export class FileClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {fileHTTPHeaders} [IFileHTTPHeaders] File HTTP headers like Content-Type. + * @param {fileHTTPHeaders} [FileHTTPHeaders] File HTTP headers like Content-Type. * Provide undefined will remove existing HTTP headers. * @returns {Promise} * @memberof FileClient */ public async setHTTPHeaders( aborter: Aborter, - fileHTTPHeaders: IFileHTTPHeaders = {} + fileHTTPHeaders: FileHTTPHeaders = {} ): Promise { return this.context.setHTTPHeaders({ abortSignal: aborter, @@ -421,13 +421,13 @@ export class FileClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed + * @param {Metadata} [metadata] If no metadata provided, all existing directory metadata will be removed * @returns {Promise} * @memberof FileClient */ public async setMetadata( aborter: Aborter, - metadata: IMetadata = {} + metadata: Metadata = {} ): Promise { return this.context.setMetadata({ abortSignal: aborter, @@ -446,7 +446,7 @@ export class FileClient extends StorageClient { * @param {number} offset Offset position of the destination Azure File to upload. * @param {number} contentLength Length of body in bytes. Use Buffer.byteLength() to calculate body length for a * string including non non-Base64/Hex-encoded characters. - * @param {IFileUploadRangeOptions} [options] + * @param {FileUploadRangeOptions} [options] * @returns {Promise} * @memberof FileClient */ @@ -455,7 +455,7 @@ export class FileClient extends StorageClient { body: HttpRequestBody, offset: number, contentLength: number, - options: IFileUploadRangeOptions = {} + options: FileUploadRangeOptions = {} ): Promise { if (offset < 0 || contentLength <= 0) { throw new RangeError(`offset must >= 0 and contentLength must be > 0`); @@ -508,13 +508,13 @@ export class FileClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IFileGetRangeListOptions} [options] + * @param {FileGetRangeListOptions} [options] * @returns {Promise} * @memberof FileClient */ public async getRangeList( aborter: Aborter, - options: IFileGetRangeListOptions = {} + options: FileGetRangeListOptions = {} ): Promise { const originalResponse = await this.context.getRangeList({ abortSignal: aborter, @@ -547,14 +547,14 @@ export class FileClient extends StorageClient { * authenticate the source file or blob using a shared access signature. If the source is a public * blob, no authentication is required to perform the copy operation. A file in a share snapshot * can also be specified as a copy source. - * @param {IFileStartCopyOptions} [options] + * @param {FileStartCopyOptions} [options] * @returns {Promise} * @memberof FileClient */ public async startCopyFromURL( aborter: Aborter, copySource: string, - options: IFileStartCopyOptions = {} + options: FileStartCopyOptions = {} ): Promise { return this.context.startCopy(copySource, { abortSignal: aborter, diff --git a/sdk/storage/storage-file/src/FileDownloadResponse.ts b/sdk/storage/storage-file/src/FileDownloadResponse.ts index 02ea33db42c6..bec7f6dfdd24 100644 --- a/sdk/storage/storage-file/src/FileDownloadResponse.ts +++ b/sdk/storage/storage-file/src/FileDownloadResponse.ts @@ -2,11 +2,11 @@ import { HttpResponse, isNode } from "@azure/ms-rest-js"; import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { ReadableStreamGetter, RetriableReadableStream, - IRetriableReadableStreamOptions + RetriableReadableStreamOptions } from "./utils/RetriableReadableStream"; /** @@ -294,10 +294,10 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * to associate with a file storage object. * * @readonly - * @type {(IMetadata | undefined)} + * @type {(Metadata | undefined)} * @memberof FileDownloadResponse */ - public get metadata(): IMetadata | undefined { + public get metadata(): Metadata | undefined { return this.originalResponse.metadata; } @@ -368,7 +368,7 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * @param {ReadableStreamGetter} getter * @param {number} offset * @param {number} count - * @param {IRetriableReadableStreamOptions} [options={}] + * @param {RetriableReadableStreamOptions} [options={}] * @memberof FileDownloadResponse */ public constructor( @@ -377,7 +377,7 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { getter: ReadableStreamGetter, offset: number, count: number, - options: IRetriableReadableStreamOptions = {} + options: RetriableReadableStreamOptions = {} ) { this.originalResponse = originalResponse; this.fileDownloadStream = new RetriableReadableStream( diff --git a/sdk/storage/storage-file/src/FileSASPermissions.ts b/sdk/storage/storage-file/src/FileSASPermissions.ts index ac7592720614..e52c930046bd 100644 --- a/sdk/storage/storage-file/src/FileSASPermissions.ts +++ b/sdk/storage/storage-file/src/FileSASPermissions.ts @@ -4,7 +4,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a file. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IFileSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link FileSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/IFileSASSignatureValues.ts b/sdk/storage/storage-file/src/FileSASSignatureValues.ts similarity index 86% rename from sdk/storage/storage-file/src/IFileSASSignatureValues.ts rename to sdk/storage/storage-file/src/FileSASSignatureValues.ts index 68254b24f022..3f1080f0c1e6 100644 --- a/sdk/storage/storage-file/src/IFileSASSignatureValues.ts +++ b/sdk/storage/storage-file/src/FileSASSignatureValues.ts @@ -1,6 +1,6 @@ import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; import { FileSASPermissions } from "./FileSASPermissions"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { ShareSASPermissions } from "./ShareSASPermissions"; import { SERVICE_VERSION } from "./utils/constants"; @@ -9,19 +9,19 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IFileSASSignatureValues is used to help generating File service SAS tokens for shares or files. + * FileSASSignatureValues is used to help generating File service SAS tokens for shares or files. * * @export - * @class IFileSASSignatureValues + * @class FileSASSignatureValues */ -export interface IFileSASSignatureValues { +export interface FileSASSignatureValues { /** * The version of the service this SAS will target. If not specified, it will default to the version targeted by the * library. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ version?: string; @@ -29,7 +29,7 @@ export interface IFileSASSignatureValues { * Optional. SAS protocols, HTTPS only or HTTPSandHTTP * * @type {SASProtocol} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ protocol?: SASProtocol; @@ -37,7 +37,7 @@ export interface IFileSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ startTime?: Date; @@ -45,7 +45,7 @@ export interface IFileSASSignatureValues { * Optional only when identifier is provided. The time after which the SAS will no longer work. * * @type {Date} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ expiryTime?: Date; @@ -55,23 +55,23 @@ export interface IFileSASSignatureValues { * being accessed for help constructing the permissions string. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ permissions?: string; /** * Optional. IP ranges allowed in this SAS. * - * @type {IIPRange} - * @memberof IFileSASSignatureValues + * @type {IPRange} + * @memberof FileSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The name of the share the SAS user may access. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ shareName: string; @@ -79,7 +79,7 @@ export interface IFileSASSignatureValues { * Optional. The path of the file like, "directory/FileName" or "FileName". * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ filePath?: string; @@ -89,7 +89,7 @@ export interface IFileSASSignatureValues { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ identifier?: string; @@ -97,7 +97,7 @@ export interface IFileSASSignatureValues { * Optional. The cache-control header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ cacheControl?: string; @@ -105,7 +105,7 @@ export interface IFileSASSignatureValues { * Optional. The content-disposition header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentDisposition?: string; @@ -113,7 +113,7 @@ export interface IFileSASSignatureValues { * Optional. The content-encoding header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentEncoding?: string; @@ -121,7 +121,7 @@ export interface IFileSASSignatureValues { * Optional. The content-language header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentLanguage?: string; @@ -129,7 +129,7 @@ export interface IFileSASSignatureValues { * Optional. The content-type header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentType?: string; } @@ -147,12 +147,12 @@ export interface IFileSASSignatureValues { * this constructor. * * @export - * @param {IFileSASSignatureValues} fileSASSignatureValues + * @param {FileSASSignatureValues} fileSASSignatureValues * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} */ export function generateFileSASQueryParameters( - fileSASSignatureValues: IFileSASSignatureValues, + fileSASSignatureValues: FileSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { if ( diff --git a/sdk/storage/storage-file/src/FileServiceClient.ts b/sdk/storage/storage-file/src/FileServiceClient.ts index e5b4db3e8ba9..a9e2545ce3a0 100644 --- a/sdk/storage/storage-file/src/FileServiceClient.ts +++ b/sdk/storage/storage-file/src/FileServiceClient.ts @@ -4,13 +4,13 @@ import { Service } from "./generated/lib/operations"; import { Pipeline } from "./Pipeline"; import { StorageClient } from "./StorageClient"; -export interface IServiceListSharesSegmentOptions { +export interface ServiceListSharesSegmentOptions { /** * Filters the results to return only entries whose * name begins with the specified prefix. * * @type {string} - * @memberof IServiceListSharesSegmentOptions + * @memberof ServiceListSharesSegmentOptions */ prefix?: string; @@ -20,7 +20,7 @@ export interface IServiceListSharesSegmentOptions { * greater than 5,000, the server will return up to 5,000 items. * * @type {number} - * @memberof IServiceListSharesSegmentOptions + * @memberof ServiceListSharesSegmentOptions */ maxresults?: number; @@ -29,7 +29,7 @@ export interface IServiceListSharesSegmentOptions { * specify one or more datasets to include in the response. * * @type {Models.ListSharesIncludeType[]} - * @memberof IServiceListSharesSegmentOptions + * @memberof ServiceListSharesSegmentOptions */ include?: Models.ListSharesIncludeType[]; } @@ -127,14 +127,14 @@ export class FileServiceClient extends StorageClient { * not complete. The marker value may then be used in a subsequent call to * request the next set of list items. The marker value is opaque to the * client. - * @param {IServiceListSharesSegmentOptions} [options={}] + * @param {ServiceListSharesSegmentOptions} [options={}] * @returns {Promise} * @memberof FileServiceClient */ public async listSharesSegment( aborter: Aborter, marker?: string, - options: IServiceListSharesSegmentOptions = {} + options: ServiceListSharesSegmentOptions = {} ): Promise { return this.serviceContext.listSharesSegment({ abortSignal: aborter, diff --git a/sdk/storage/storage-file/src/IIPRange.ts b/sdk/storage/storage-file/src/IPRange.ts similarity index 81% rename from sdk/storage/storage-file/src/IIPRange.ts rename to sdk/storage/storage-file/src/IPRange.ts index aa15037871e6..0386f2db7bd8 100644 --- a/sdk/storage/storage-file/src/IIPRange.ts +++ b/sdk/storage/storage-file/src/IPRange.ts @@ -2,9 +2,9 @@ * Allowed IP range for a SAS. * * @export - * @interface IIPRange + * @interface IPRange */ -export interface IIPRange { +export interface IPRange { /** * Starting IP address in the IP range. * If end IP doesn't provide, start IP will the only IP allowed. @@ -29,9 +29,9 @@ export interface IIPRange { * "8.8.8.8" or "1.1.1.1-255.255.255.255" * * @export - * @param {IIPRange} ipRange + * @param {IPRange} ipRange * @returns {string} */ -export function ipRangeToString(ipRange: IIPRange): string { +export function ipRangeToString(ipRange: IPRange): string { return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; } diff --git a/sdk/storage/storage-file/src/LoggingPolicyFactory.ts b/sdk/storage/storage-file/src/LoggingPolicyFactory.ts index d6f1057480b4..60862297ad05 100644 --- a/sdk/storage/storage-file/src/LoggingPolicyFactory.ts +++ b/sdk/storage/storage-file/src/LoggingPolicyFactory.ts @@ -6,14 +6,14 @@ import { LoggingPolicy } from "./policies/LoggingPolicy"; * RequestLogOptions configures the retry policy's behavior. * * @export - * @interface IRequestLogOptions + * @interface RequestLogOptions */ -export interface IRequestLogOptions { +export interface RequestLogOptions { /** * LogWarningIfTryOverThreshold logs a warning if a tried operation takes longer than the specified * duration in ms. Default is 3000ms. * @type {number} - * @memberof IRequestLogOptions + * @memberof RequestLogOptions */ logWarningIfTryOverThreshold: number; } @@ -26,9 +26,9 @@ export interface IRequestLogOptions { * @implements {RequestPolicyFactory} */ export class LoggingPolicyFactory implements RequestPolicyFactory { - private readonly loggingOptions?: IRequestLogOptions; + private readonly loggingOptions?: RequestLogOptions; - constructor(loggingOptions?: IRequestLogOptions) { + constructor(loggingOptions?: RequestLogOptions) { this.loggingOptions = loggingOptions; } diff --git a/sdk/storage/storage-file/src/Pipeline.ts b/sdk/storage/storage-file/src/Pipeline.ts index 8e116c127c55..fd22548ccf99 100644 --- a/sdk/storage/storage-file/src/Pipeline.ts +++ b/sdk/storage/storage-file/src/Pipeline.ts @@ -33,9 +33,9 @@ export { * Option interface for Pipeline constructor. * * @export - * @interface IPipelineOptions + * @interface PipelineOptions */ -export interface IPipelineOptions { +export interface PipelineOptions { logger?: IHttpPipelineLogger; HTTPClient?: IHttpClient; } @@ -52,16 +52,16 @@ export interface IPipelineOptions { */ export class Pipeline { public readonly factories: RequestPolicyFactory[]; - public readonly options: IPipelineOptions; + public readonly options: PipelineOptions; /** * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. * * @param {RequestPolicyFactory[]} factories - * @param {IPipelineOptions} [options={}] + * @param {PipelineOptions} [options={}] * @memberof Pipeline */ - constructor(factories: RequestPolicyFactory[], options: IPipelineOptions = {}) { + constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) { this.factories = factories; this.options = options; } diff --git a/sdk/storage/storage-file/src/IRange.ts b/sdk/storage/storage-file/src/Range.ts similarity index 54% rename from sdk/storage/storage-file/src/IRange.ts rename to sdk/storage/storage-file/src/Range.ts index eed207421e30..f226a32dfe3b 100644 --- a/sdk/storage/storage-file/src/IRange.ts +++ b/sdk/storage/storage-file/src/Range.ts @@ -4,14 +4,14 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-the-range-header-for-file-service-operations * * @export - * @interface IRange + * @interface Range */ -export interface IRange { +export interface Range { /** * StartByte, larger than or equal 0. * * @type {string} - * @memberof IRange + * @memberof Range */ offset: number; /** @@ -19,7 +19,7 @@ export interface IRange { * If not provided, will return bytes from offset to the end. * * @type {string} - * @memberof IRange + * @memberof Range */ count?: number; } @@ -30,19 +30,19 @@ export interface IRange { * "bytes=255-" or "bytes=0-511" * * @export - * @param {IRange} iRange + * @param {Range} range * @returns {string} */ -export function rangeToString(iRange: IRange): string { - if (iRange.offset < 0) { - throw new RangeError(`IRange.offset cannot be smaller than 0.`); +export function rangeToString(range: Range): string { + if (range.offset < 0) { + throw new RangeError(`Range.offset cannot be smaller than 0.`); } - if (iRange.count && iRange.count <= 0) { + if (range.count && range.count <= 0) { throw new RangeError( - `IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` + `Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` ); } - return iRange.count - ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` - : `bytes=${iRange.offset}-`; + return range.count + ? `bytes=${range.offset}-${range.offset + range.count - 1}` + : `bytes=${range.offset}-`; } diff --git a/sdk/storage/storage-file/src/RetryPolicyFactory.ts b/sdk/storage/storage-file/src/RetryPolicyFactory.ts index 64b9b7d7c1f1..a9ceb2b9a092 100644 --- a/sdk/storage/storage-file/src/RetryPolicyFactory.ts +++ b/sdk/storage/storage-file/src/RetryPolicyFactory.ts @@ -6,9 +6,9 @@ import { RetryPolicy, RetryPolicyType } from "./policies/RetryPolicy"; * Retry options interface. * * @export - * @interface IRetryOptions + * @interface RetryOptions */ -export interface IRetryOptions { +export interface RetryOptions { /** * Optional. RetryPolicyType, default is exponential retry policy. * @@ -23,7 +23,7 @@ export interface IRetryOptions { * A value smaller than 1 means default retry number of attempts. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxTries?: number; @@ -37,7 +37,7 @@ export interface IRetryOptions { * like (60 seconds per MB of anticipated-payload-size) * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly tryTimeoutInMs?: number; @@ -47,7 +47,7 @@ export interface IRetryOptions { * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly retryDelayInMs?: number; @@ -56,7 +56,7 @@ export interface IRetryOptions { * If you specify 0, then you must also specify 0 for retryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxRetryDelayInMs?: number; } @@ -69,14 +69,14 @@ export interface IRetryOptions { * @implements {RequestPolicyFactory} */ export class RetryPolicyFactory implements RequestPolicyFactory { - private retryOptions?: IRetryOptions; + private retryOptions?: RetryOptions; /** * Creates an instance of RetryPolicyFactory. - * @param {IRetryOptions} [retryOptions] + * @param {RetryOptions} [retryOptions] * @memberof RetryPolicyFactory */ - constructor(retryOptions?: IRetryOptions) { + constructor(retryOptions?: RetryOptions) { this.retryOptions = retryOptions; } diff --git a/sdk/storage/storage-file/src/SASQueryParameters.ts b/sdk/storage/storage-file/src/SASQueryParameters.ts index c116438b9050..83d695ed46ce 100644 --- a/sdk/storage/storage-file/src/SASQueryParameters.ts +++ b/sdk/storage/storage-file/src/SASQueryParameters.ts @@ -1,4 +1,4 @@ -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { truncatedISO8061Date } from "./utils/utils.common"; /** @@ -21,7 +21,7 @@ export enum SASProtocol { /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link IAccountSASSignatureValues} and {@link IFileSASSignatureValues} + * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link FileSASSignatureValues} * types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should * be taken here in case there are existing query parameters, which might affect the appropriate means of appending * these query parameters). @@ -93,7 +93,7 @@ export class SASQueryParameters { public readonly resourceTypes?: string; /** - * Optional. The signed identifier (only for {@link IFileSASSignatureValues}). + * Optional. The signed identifier (only for {@link FileSASSignatureValues}). * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * @@ -103,7 +103,7 @@ export class SASQueryParameters { public readonly identifier?: string; /** - * Optional. The storage share or file path (only for {@link IFileSASSignatureValues}). + * Optional. The storage share or file path (only for {@link FileSASSignatureValues}). * * @type {string} * @memberof SASQueryParameters @@ -162,19 +162,19 @@ export class SASQueryParameters { * Inner value of getter ipRange. * * @private - * @type {IIPRange} + * @type {IPRange} * @memberof SASQueryParameters */ - private readonly ipRangeInner?: IIPRange; + private readonly ipRangeInner?: IPRange; /** * Optional. IP range allowed for this SAS. * * @readonly - * @type {(IIPRange | undefined)} + * @type {(IPRange | undefined)} * @memberof SASQueryParameters */ - public get ipRange(): IIPRange | undefined { + public get ipRange(): IPRange | undefined { if (this.ipRangeInner) { return { end: this.ipRangeInner.end, @@ -195,7 +195,7 @@ export class SASQueryParameters { * @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s) * @param {Date} [startTime] Representing the start time for this SAS token * @param {Date} [expiryTime] Representing the expiry time for this SAS token - * @param {IIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token + * @param {IPRange} [ipRange] Representing the range of valid IP addresses for this SAS token * @param {string} [identifier] Representing the signed identifier (only for Service SAS) * @param {string} [resource] Representing the storage container or blob (only for Service SAS) * @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS) @@ -214,7 +214,7 @@ export class SASQueryParameters { protocol?: SASProtocol, startTime?: Date, expiryTime?: Date, - ipRange?: IIPRange, + ipRange?: IPRange, identifier?: string, resource?: string, cacheControl?: string, diff --git a/sdk/storage/storage-file/src/ShareClient.ts b/sdk/storage/storage-file/src/ShareClient.ts index 7d717e1670b0..46a04246e1c8 100644 --- a/sdk/storage/storage-file/src/ShareClient.ts +++ b/sdk/storage/storage-file/src/ShareClient.ts @@ -3,19 +3,19 @@ import { HttpResponse } from "@azure/ms-rest-js"; import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; import { Share } from "./generated/lib/operations"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { Pipeline } from "./Pipeline"; import { FileServiceClient } from "./FileServiceClient"; import { StorageClient } from "./StorageClient"; import { URLConstants } from "./utils/constants"; import { appendToURLPath, setURLParameter, truncatedISO8061Date } from "./utils/utils.common"; -export interface IShareCreateOptions { +export interface ShareCreateOptions { /** * A name-value pair to associate with a file storage object. * * @type {{ [propertyName: string]: string }} - * @memberof IShareCreateOptions + * @memberof ShareCreateOptions */ metadata?: { [propertyName: string]: string }; @@ -24,24 +24,24 @@ export interface IShareCreateOptions { * gigabytes. * * @type {number} - * @memberof IShareCreateOptions + * @memberof ShareCreateOptions */ quota?: number; } -export interface IShareDeleteMethodOptions { +export interface ShareDeleteMethodOptions { /** * Specifies the option * include to delete the base share and all of its snapshots. Possible values * include: 'include' * * @type {Models.DeleteSnapshotsOptionType} - * @memberof IShareDeleteMethodOptions + * @memberof ShareDeleteMethodOptions */ deleteSnapshots?: Models.DeleteSnapshotsOptionType; } -export interface ISignedIdentifier { +export interface SignedIdentifier { /** * @member {string} id a unique id */ @@ -67,7 +67,7 @@ export interface ISignedIdentifier { } export declare type ShareGetAccessPolicyResponse = { - signedIdentifiers: ISignedIdentifier[]; + signedIdentifiers: SignedIdentifier[]; } & Models.ShareGetAccessPolicyHeaders & { /** * The underlying HTTP response. @@ -88,12 +88,12 @@ export declare type ShareGetAccessPolicyResponse = { }; }; -export interface IShareCreateSnapshotOptions { +export interface ShareCreateSnapshotOptions { /** * A name-value pair to associate with a file storage object. * * @type {{ [propertyName: string]: string }} - * @memberof IShareCreateOptions + * @memberof ShareCreateOptions */ metadata?: { [propertyName: string]: string }; } @@ -182,13 +182,13 @@ export class ShareClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IShareCreateOptions} [options] + * @param {ShareCreateOptions} [options] * @returns {Promise} * @memberof ShareClient */ public async create( aborter: Aborter, - options: IShareCreateOptions = {} + options: ShareCreateOptions = {} ): Promise { return this.context.create({ ...options, @@ -219,13 +219,13 @@ export class ShareClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {Models.IShareDeleteMethodOptions} [options] + * @param {Models.ShareDeleteMethodOptions} [options] * @returns {Promise} * @memberof ShareClient */ public async delete( aborter: Aborter, - options: IShareDeleteMethodOptions = {} + options: ShareDeleteMethodOptions = {} ): Promise { return this.context.deleteMethod({ abortSignal: aborter, @@ -242,13 +242,13 @@ export class ShareClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed + * @param {Metadata} [metadata] If no metadata provided, all existing directory metadata will be removed * @returns {Promise} * @memberof ShareClient */ public async setMetadata( aborter: Aborter, - metadata?: IMetadata + metadata?: Metadata ): Promise { return this.context.setMetadata({ abortSignal: aborter, @@ -310,13 +310,13 @@ export class ShareClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {ISignedIdentifier[]} [shareAcl] + * @param {SignedIdentifier[]} [shareAcl] * @returns {Promise} * @memberof ShareClient */ public async setAccessPolicy( aborter: Aborter, - shareAcl?: ISignedIdentifier[] + shareAcl?: SignedIdentifier[] ): Promise { const acl: Models.SignedIdentifier[] = []; for (const identifier of shareAcl || []) { @@ -341,13 +341,13 @@ export class ShareClient extends StorageClient { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {IShareCreateSnapshotOptions} [options={}] + * @param {ShareCreateSnapshotOptions} [options={}] * @returns {Promise} * @memberof ShareClient */ public async createSnapshot( aborter: Aborter, - options: IShareCreateSnapshotOptions = {} + options: ShareCreateSnapshotOptions = {} ): Promise { return this.context.createSnapshot({ abortSignal: aborter, diff --git a/sdk/storage/storage-file/src/ShareSASPermissions.ts b/sdk/storage/storage-file/src/ShareSASPermissions.ts index 83dafdf24d95..68a6731e3bd8 100644 --- a/sdk/storage/storage-file/src/ShareSASPermissions.ts +++ b/sdk/storage/storage-file/src/ShareSASPermissions.ts @@ -2,7 +2,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a share. * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. * Once all the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IFileSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link FileSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/StorageClient.ts b/sdk/storage/storage-file/src/StorageClient.ts index 08abac17e185..31be2cc95b5c 100644 --- a/sdk/storage/storage-file/src/StorageClient.ts +++ b/sdk/storage/storage-file/src/StorageClient.ts @@ -5,8 +5,8 @@ import { Credential } from "./credentials/Credential"; import { StorageClientContext } from "./generated/lib/storageClientContext"; import { LoggingPolicyFactory } from "./LoggingPolicyFactory"; import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline"; -import { IRetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; -import { ITelemetryOptions, TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; +import { RetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; +import { TelemetryOptions, TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; import { UniqueRequestIDPolicyFactory } from "./UniqueRequestIDPolicyFactory"; import { escapeURLPath } from "./utils/utils.common"; @@ -16,17 +16,17 @@ export { deserializationPolicy }; * Option interface for Pipeline.newPipeline method. * * @export - * @interface INewPipelineOptions + * @interface NewPipelineOptions */ -export interface INewPipelineOptions { +export interface NewPipelineOptions { /** * Telemetry configures the built-in telemetry policy behavior. * - * @type {ITelemetryOptions} - * @memberof INewPipelineOptions + * @type {TelemetryOptions} + * @memberof NewPipelineOptions */ - telemetry?: ITelemetryOptions; - retryOptions?: IRetryOptions; + telemetry?: TelemetryOptions; + retryOptions?: RetryOptions; logger?: IHttpPipelineLogger; httpClient?: IHttpClient; @@ -44,13 +44,13 @@ export abstract class StorageClient { * * @static * @param {Credential} credential Such as AnonymousCredential, SharedKeyCredential. - * @param {INewPipelineOptions} [pipelineOptions] Optional. Options. + * @param {NewPipelineOptions} [pipelineOptions] Optional. Options. * @returns {Pipeline} A new Pipeline object. * @memberof Pipeline */ public static newPipeline( credential: Credential, - pipelineOptions: INewPipelineOptions = {} + pipelineOptions: NewPipelineOptions = {} ): Pipeline { // Order is important. Closer to the API at the top & closer to the network at the bottom. // The credential's policy factory must appear close to the wire so it can sign any diff --git a/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts b/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts index a75dad719028..28acfba15f2b 100644 --- a/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts +++ b/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts @@ -13,9 +13,9 @@ import { SDK_VERSION } from "./utils/constants"; * Interface of TelemetryPolicy options. * * @export - * @interface ITelemetryOptions + * @interface TelemetryOptions */ -export interface ITelemetryOptions { +export interface TelemetryOptions { value: string; } @@ -31,10 +31,10 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { /** * Creates an instance of TelemetryPolicyFactory. - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicyFactory */ - constructor(telemetry?: ITelemetryOptions) { + constructor(telemetry?: TelemetryOptions) { const userAgentInfo: string[] = []; if (isNode) { diff --git a/sdk/storage/storage-file/src/highlevel.browser.ts b/sdk/storage/storage-file/src/highlevel.browser.ts index 06f2d7c29371..2dabe9fa150b 100644 --- a/sdk/storage/storage-file/src/highlevel.browser.ts +++ b/sdk/storage/storage-file/src/highlevel.browser.ts @@ -1,6 +1,6 @@ import { Aborter } from "./Aborter"; import { FileClient } from "./FileClient"; -import { IUploadToAzureFileOptions } from "./highlevel.common"; +import { UploadToAzureFileOptions } from "./highlevel.common"; import { Batch } from "./utils/Batch"; import { FILE_RANGE_MAX_SIZE_BYTES, DEFAULT_HIGH_LEVEL_PARALLELISM } from "./utils/constants"; @@ -14,14 +14,14 @@ import { FILE_RANGE_MAX_SIZE_BYTES, DEFAULT_HIGH_LEVEL_PARALLELISM } from "./uti * goto documents of Aborter for more examples about request cancellation * @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView * @param {FileClient} fileClient - * @param {IUploadToAzureFileOptions} [options] + * @param {UploadToAzureFileOptions} [options] * @returns {Promise} */ export async function uploadBrowserDataToAzureFile( aborter: Aborter, browserData: Blob | ArrayBuffer | ArrayBufferView, fileClient: FileClient, - options?: IUploadToAzureFileOptions + options?: UploadToAzureFileOptions ): Promise { const browserBlob = new Blob([browserData]); return UploadSeekableBlobToAzureFile( @@ -46,7 +46,7 @@ export async function uploadBrowserDataToAzureFile( * @param {(offset: number, size: number) => Blob} blobFactory * @param {number} size * @param {FileClient} fileClient - * @param {IUploadToAzureFileOptions} [options] + * @param {UploadToAzureFileOptions} [options] * @returns {Promise} */ async function UploadSeekableBlobToAzureFile( @@ -54,7 +54,7 @@ async function UploadSeekableBlobToAzureFile( blobFactory: (offset: number, size: number) => Blob, size: number, fileClient: FileClient, - options: IUploadToAzureFileOptions = {} + options: UploadToAzureFileOptions = {} ): Promise { if (!options.rangeSize) { options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES; diff --git a/sdk/storage/storage-file/src/highlevel.common.ts b/sdk/storage/storage-file/src/highlevel.common.ts index 7b35406d5688..6e2d830c1214 100644 --- a/sdk/storage/storage-file/src/highlevel.common.ts +++ b/sdk/storage/storage-file/src/highlevel.common.ts @@ -1,52 +1,52 @@ import { TransferProgressEvent } from "@azure/ms-rest-js"; -import { IFileHTTPHeaders, IMetadata } from "./models"; +import { FileHTTPHeaders, Metadata } from "./models"; /** * Option interface for uploadFileToAzureFile and uploadSeekableStreamToAzureFile. * * @export - * @interface IUploadToAzureFileOptions + * @interface UploadToAzureFileOptions */ -export interface IUploadToAzureFileOptions { +export interface UploadToAzureFileOptions { /** * RangeSize specifies the range size to use in each parallel upload, * the default (and maximum size) is FILE_RANGE_MAX_SIZE_BYTES. * * @type {number} - * @memberof IUploadToAzureFileOptions + * @memberof UploadToAzureFileOptions */ rangeSize?: number; /** * Progress updater. * - * @memberof IUploadToAzureFileOptions + * @memberof UploadToAzureFileOptions */ progress?: (progress: TransferProgressEvent) => void; /** * File HTTP Headers. * - * @type {IFileHTTPHeaders} - * @memberof IUploadToAzureFileOptions + * @type {FileHTTPHeaders} + * @memberof UploadToAzureFileOptions */ - fileHTTPHeaders?: IFileHTTPHeaders; + fileHTTPHeaders?: FileHTTPHeaders; /** * Metadata of an Azure file. * - * @type {IMetadata} - * @memberof IUploadToAzureFileOptions + * @type {Metadata} + * @memberof UploadToAzureFileOptions */ - metadata?: IMetadata; + metadata?: Metadata; /** * Parallelism indicates the maximum number of ranges to upload in parallel. * If not provided, 5 parallelism will be used by default. * * @type {number} - * @memberof IUploadToAzureFileOptions + * @memberof UploadToAzureFileOptions */ parallelism?: number; } @@ -55,9 +55,9 @@ export interface IUploadToAzureFileOptions { * Option interface for DownloadAzurefileToBuffer. * * @export - * @interface IDownloadFromAzureFileOptions + * @interface DownloadFromAzureFileOptions */ -export interface IDownloadFromAzureFileOptions { +export interface DownloadFromAzureFileOptions { /** * When downloading Azure files, download method will try to split large file into small ranges. * Every small range will be downloaded via a separte request. @@ -65,7 +65,7 @@ export interface IDownloadFromAzureFileOptions { * Must be > 0, will use the default value if undefined, * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ rangeSize?: number; @@ -83,14 +83,14 @@ export interface IDownloadFromAzureFileOptions { * Default value is 5, please set a larger value when in poor network. * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ maxRetryRequestsPerRange?: number; /** * Progress updater. * - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ progress?: (progress: TransferProgressEvent) => void; @@ -99,7 +99,7 @@ export interface IDownloadFromAzureFileOptions { * If not provided, 5 parallelism will be used by default. * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ parallelism?: number; } diff --git a/sdk/storage/storage-file/src/highlevel.node.ts b/sdk/storage/storage-file/src/highlevel.node.ts index e397b1bebcdb..25b0b8f903d0 100644 --- a/sdk/storage/storage-file/src/highlevel.node.ts +++ b/sdk/storage/storage-file/src/highlevel.node.ts @@ -3,8 +3,8 @@ import { TransferProgressEvent } from "@azure/ms-rest-js"; import { Readable } from "stream"; import { Aborter } from "./Aborter"; import { FileClient } from "./FileClient"; -import { IDownloadFromAzureFileOptions, IUploadToAzureFileOptions } from "./highlevel.common"; -import { IFileHTTPHeaders, IMetadata } from "./models"; +import { DownloadFromAzureFileOptions, UploadToAzureFileOptions } from "./highlevel.common"; +import { FileHTTPHeaders, Metadata } from "./models"; import { Batch } from "./utils/Batch"; import { BufferScheduler } from "./utils/BufferScheduler"; import { DEFAULT_HIGH_LEVEL_PARALLELISM, FILE_RANGE_MAX_SIZE_BYTES } from "./utils/constants"; @@ -20,14 +20,14 @@ import { streamToBuffer } from "./utils/utils.node"; * goto documents of Aborter for more examples about request cancellation * @param {string} filePath Full path of local file * @param {FileClient} fileClient FileClient - * @param {IUploadToAzureFileOptions} [options] + * @param {UploadToAzureFileOptions} [options] * @returns {(Promise)} */ export async function uploadFileToAzureFile( aborter: Aborter, filePath: string, fileClient: FileClient, - options?: IUploadToAzureFileOptions + options?: UploadToAzureFileOptions ): Promise { const size = fs.statSync(filePath).size; return uploadResetableStreamToAzureFile( @@ -58,7 +58,7 @@ export async function uploadFileToAzureFile( * from the offset defined * @param {number} size Size of the Azure file * @param {FileClient} fileClient FileClient - * @param {IUploadToAzureFileOptions} [options] + * @param {UploadToAzureFileOptions} [options] * @returns {(Promise)} */ async function uploadResetableStreamToAzureFile( @@ -66,7 +66,7 @@ async function uploadResetableStreamToAzureFile( streamFactory: (offset: number, count?: number) => NodeJS.ReadableStream, size: number, fileClient: FileClient, - options: IUploadToAzureFileOptions = {} + options: UploadToAzureFileOptions = {} ): Promise { if (!options.rangeSize) { options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES; @@ -132,7 +132,7 @@ async function uploadResetableStreamToAzureFile( * @param {FileClient} fileClient A FileClient object * @param {number} offset From which position of the Azure File to download * @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined - * @param {IDownloadFromAzureFileOptions} [options] + * @param {DownloadFromAzureFileOptions} [options] * @returns {Promise} */ export async function downloadAzureFileToBuffer( @@ -141,7 +141,7 @@ export async function downloadAzureFileToBuffer( fileClient: FileClient, offset: number, count?: number, - options: IDownloadFromAzureFileOptions = {} + options: DownloadFromAzureFileOptions = {} ): Promise { if (!options.rangeSize) { options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES; @@ -208,29 +208,29 @@ export async function downloadAzureFileToBuffer( * Option interface for uploadStreamToAzureFile. * * @export - * @interface IUploadStreamToAzureFileOptions + * @interface UploadStreamToAzureFileOptions */ -export interface IUploadStreamToAzureFileOptions { +export interface UploadStreamToAzureFileOptions { /** * Azure File HTTP Headers. * - * @type {IFileHTTPHeaders} - * @memberof IUploadStreamToAzureFileOptions + * @type {FileHTTPHeaders} + * @memberof UploadStreamToAzureFileOptions */ - fileHTTPHeaders?: IFileHTTPHeaders; + fileHTTPHeaders?: FileHTTPHeaders; /** * Metadata of the Azure file. * - * @type {IMetadata} - * @memberof IUploadStreamToAzureFileOptions + * @type {Metadata} + * @memberof UploadStreamToAzureFileOptions */ - metadata?: IMetadata; + metadata?: Metadata; /** * Progress updater. * - * @memberof IUploadStreamToAzureFileOptions + * @memberof UploadStreamToAzureFileOptions */ progress?: (progress: TransferProgressEvent) => void; } @@ -258,7 +258,7 @@ export interface IUploadStreamToAzureFileOptions { * the uploaded file. Size must be > 0 and <= 4 * 1024 * 1024 (4MB) * @param {number} maxBuffers Max buffers will allocate during uploading, positive correlation * with max uploading concurrency - * @param {IUploadStreamToAzureFileOptions} [options] + * @param {UploadStreamToAzureFileOptions} [options] * @returns {Promise} */ export async function uploadStreamToAzureFile( @@ -268,7 +268,7 @@ export async function uploadStreamToAzureFile( fileClient: FileClient, bufferSize: number, maxBuffers: number, - options: IUploadStreamToAzureFileOptions = {} + options: UploadStreamToAzureFileOptions = {} ): Promise { if (!options.fileHTTPHeaders) { options.fileHTTPHeaders = {}; diff --git a/sdk/storage/storage-file/src/index.browser.ts b/sdk/storage/storage-file/src/index.browser.ts index 4616a6fe9312..12279554ea6d 100644 --- a/sdk/storage/storage-file/src/index.browser.ts +++ b/sdk/storage/storage-file/src/index.browser.ts @@ -10,8 +10,8 @@ export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./highlevel.browser"; export * from "./highlevel.common"; -export { IIPRange } from "./IIPRange"; -export { IRange } from "./IRange"; +export { IPRange as IPRange } from "./IPRange"; +export { Range } from "./Range"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; diff --git a/sdk/storage/storage-file/src/index.ts b/sdk/storage/storage-file/src/index.ts index 8d2317673c12..11e9dc1e0a62 100644 --- a/sdk/storage/storage-file/src/index.ts +++ b/sdk/storage/storage-file/src/index.ts @@ -6,9 +6,9 @@ export * from "./Aborter"; export * from "./AccountSASPermissions"; export * from "./AccountSASResourceTypes"; export * from "./AccountSASServices"; -export * from "./IAccountSASSignatureValues"; +export * from "./AccountSASSignatureValues"; export * from "./FileSASPermissions"; -export * from "./IFileSASSignatureValues"; +export * from "./FileSASSignatureValues"; export * from "./DirectoryClient"; export * from "./FileClient"; export * from "./ShareSASPermissions"; @@ -19,8 +19,8 @@ export * from "./credentials/SharedKeyCredential"; export * from "./highlevel.browser"; export * from "./highlevel.common"; export * from "./highlevel.node"; -export { IIPRange } from "./IIPRange"; -export { IRange } from "./IRange"; +export { IPRange as IPRange } from "./IPRange"; +export { Range } from "./Range"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; diff --git a/sdk/storage/storage-file/src/models.ts b/sdk/storage/storage-file/src/models.ts index 0e6ac3b0aa17..6a8ddb780156 100644 --- a/sdk/storage/storage-file/src/models.ts +++ b/sdk/storage/storage-file/src/models.ts @@ -1,8 +1,8 @@ -export interface IMetadata { +export interface Metadata { [propertyName: string]: string; } -export interface IFileHTTPHeaders { +export interface FileHTTPHeaders { /** * @member {string} [fileCacheControl] Optional. Sets the file's cache * control. If specified, this property is stored with the file and returned diff --git a/sdk/storage/storage-file/src/policies/LoggingPolicy.ts b/sdk/storage/storage-file/src/policies/LoggingPolicy.ts index 0d1fa108a316..ca9ad64099d7 100644 --- a/sdk/storage/storage-file/src/policies/LoggingPolicy.ts +++ b/sdk/storage/storage-file/src/policies/LoggingPolicy.ts @@ -7,12 +7,12 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRequestLogOptions } from "../LoggingPolicyFactory"; +import { RequestLogOptions } from "../LoggingPolicyFactory"; import { HTTPURLConnection, URLConstants } from "../utils/constants"; import { getURLParameter, setURLParameter } from "../utils/utils.common"; -// Default values of IRetryOptions -const DEFAULT_REQUEST_LOG_OPTIONS: IRequestLogOptions = { +// Default values of RetryOptions +const DEFAULT_REQUEST_LOG_OPTIONS: RequestLogOptions = { logWarningIfTryOverThreshold: 3000 }; @@ -27,19 +27,19 @@ export class LoggingPolicy extends BaseRequestPolicy { private operationStartTime: Date = new Date(); private requestStartTime: Date = new Date(); - private readonly loggingOptions: IRequestLogOptions; + private readonly loggingOptions: RequestLogOptions; /** * Creates an instance of LoggingPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] + * @param {RequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] * @memberof LoggingPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - loggingOptions: IRequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS + loggingOptions: RequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS ) { super(nextPolicy, options); this.loggingOptions = loggingOptions; diff --git a/sdk/storage/storage-file/src/policies/RetryPolicy.ts b/sdk/storage/storage-file/src/policies/RetryPolicy.ts index d5252cbc0a54..564c75401ae5 100644 --- a/sdk/storage/storage-file/src/policies/RetryPolicy.ts +++ b/sdk/storage/storage-file/src/policies/RetryPolicy.ts @@ -10,7 +10,7 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRetryOptions } from "../RetryPolicyFactory"; +import { RetryOptions } from "../RetryPolicyFactory"; import { URLConstants } from "../utils/constants"; import { setURLParameter } from "../utils/utils.common"; @@ -18,10 +18,10 @@ import { setURLParameter } from "../utils/utils.common"; * A factory method used to generated a RetryPolicy factory. * * @export - * @param {IRetryOptions} retryOptions + * @param {RetryOptions} retryOptions * @returns */ -export function NewRetryPolicyFactory(retryOptions?: IRetryOptions): RequestPolicyFactory { +export function NewRetryPolicyFactory(retryOptions?: RetryOptions): RequestPolicyFactory { return { create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy => { return new RetryPolicy(nextPolicy, options, retryOptions); @@ -46,8 +46,8 @@ export enum RetryPolicyType { FIXED } -// Default values of IRetryOptions -const DEFAULT_RETRY_OPTIONS: IRetryOptions = { +// Default values of RetryOptions +const DEFAULT_RETRY_OPTIONS: RetryOptions = { maxRetryDelayInMs: 120 * 1000, maxTries: 4, retryDelayInMs: 4 * 1000, @@ -66,23 +66,23 @@ export class RetryPolicy extends BaseRequestPolicy { * RetryOptions. * * @private - * @type {IRetryOptions} + * @type {RetryOptions} * @memberof RetryPolicy */ - private readonly retryOptions: IRetryOptions; + private readonly retryOptions: RetryOptions; /** * Creates an instance of RetryPolicy. * * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] + * @param {RetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] * @memberof RetryPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - retryOptions: IRetryOptions = DEFAULT_RETRY_OPTIONS + retryOptions: RetryOptions = DEFAULT_RETRY_OPTIONS ) { super(nextPolicy, options); diff --git a/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts b/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts index cedefe68fde4..2d324245209d 100644 --- a/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts +++ b/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts @@ -29,7 +29,7 @@ export class TelemetryPolicy extends BaseRequestPolicy { * Creates an instance of TelemetryPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicy */ constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, telemetry: string) { diff --git a/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts b/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts index 2469955d3220..01b37b825d84 100644 --- a/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts +++ b/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts @@ -4,19 +4,19 @@ import { Aborter } from "../Aborter"; export type ReadableStreamGetter = (offset: number) => Promise; -export interface IRetriableReadableStreamOptions { +export interface RetriableReadableStreamOptions { /** * Max retry count (>=0), undefined or invalid value means no retry * * @type {number} - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ maxRetryRequests?: number; /** * Read progress event handler * - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ progress?: (progress: TransferProgressEvent) => void; @@ -30,7 +30,7 @@ export interface IRetriableReadableStreamOptions { * The value will then update to "undefined", once the injection works. * * @type {boolean} - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ doInjectErrorOnce?: boolean; } @@ -53,7 +53,7 @@ export class RetriableReadableStream extends Readable { private retries: number = 0; private maxRetryRequests: number; private progress?: (progress: TransferProgressEvent) => void; - private options: IRetriableReadableStreamOptions; + private options: RetriableReadableStreamOptions; /** * Creates an instance of RetriableReadableStream. @@ -65,7 +65,7 @@ export class RetriableReadableStream extends Readable { * a new ReadableStream from specified offset * @param {number} offset Offset position in original data source to read * @param {number} count How much data in original data source to read - * @param {IRetriableReadableStreamOptions} [options={}] + * @param {RetriableReadableStreamOptions} [options={}] * @memberof RetriableReadableStream */ public constructor( @@ -74,7 +74,7 @@ export class RetriableReadableStream extends Readable { getter: ReadableStreamGetter, offset: number, count: number, - options: IRetriableReadableStreamOptions = {} + options: RetriableReadableStreamOptions = {} ) { super(); this.aborter = aborter; diff --git a/sdk/storage/storage-file/test/node/highlevel.node.spec.ts b/sdk/storage/storage-file/test/node/highlevel.node.spec.ts index db49c852e27c..a27986ac5cd1 100644 --- a/sdk/storage/storage-file/test/node/highlevel.node.spec.ts +++ b/sdk/storage/storage-file/test/node/highlevel.node.spec.ts @@ -11,7 +11,7 @@ import { uploadStreamToAzureFile } from "../../src/highlevel.node"; import { createRandomLocalFile, getBSU, getUniqueName, readStreamToLocalFile } from "../utils"; -import { IRetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; +import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; // tslint:disable:no-empty describe("Highlevel", () => { @@ -296,7 +296,7 @@ describe("Highlevel", () => { parallelism: 20 }); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; const downloadResponse = await fileClient.download(Aborter.none, 0, undefined, { maxRetryRequests: 1, progress: (ev) => { @@ -324,7 +324,7 @@ describe("Highlevel", () => { parallelism: 20 }); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; const downloadResponse = await fileClient.download(Aborter.none, 0, undefined, { maxRetryRequests: 3, @@ -355,7 +355,7 @@ describe("Highlevel", () => { const partialSize = 10 * 1024; - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; const downloadResponse = await fileClient.download(Aborter.none, 1, partialSize, { maxRetryRequests: 3, @@ -386,7 +386,7 @@ describe("Highlevel", () => { const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; let expectedError = false; @@ -417,7 +417,7 @@ describe("Highlevel", () => { const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; let expectedError = false; diff --git a/sdk/storage/storage-file/test/node/sas.spec.ts b/sdk/storage/storage-file/test/node/sas.spec.ts index ab17eecabea6..b003d32e3ab8 100644 --- a/sdk/storage/storage-file/test/node/sas.spec.ts +++ b/sdk/storage/storage-file/test/node/sas.spec.ts @@ -15,7 +15,7 @@ import { Aborter } from "../../src/Aborter"; import { DirectoryClient } from "../../src/DirectoryClient"; import { FileSASPermissions } from "../../src/FileSASPermissions"; import { FileClient } from "../../src/FileClient"; -import { generateFileSASQueryParameters } from "../../src/IFileSASSignatureValues"; +import { generateFileSASQueryParameters } from "../../src/FileSASSignatureValues"; import { ShareSASPermissions } from "../../src/ShareSASPermissions"; import { ShareClient } from "../../src/ShareClient"; import { getBSU, getUniqueName } from "../utils"; diff --git a/sdk/storage/storage-file/test/node/shareclient.spec.ts b/sdk/storage/storage-file/test/node/shareclient.spec.ts index 96e8c6ea5cbc..b89567270627 100644 --- a/sdk/storage/storage-file/test/node/shareclient.spec.ts +++ b/sdk/storage/storage-file/test/node/shareclient.spec.ts @@ -1,7 +1,7 @@ import * as assert from "assert"; import { Aborter } from "../../src/Aborter"; -import { ISignedIdentifier, ShareClient } from "../../src/ShareClient"; +import { SignedIdentifier, ShareClient } from "../../src/ShareClient"; import { getBSU, getUniqueName } from "./../utils"; describe("ShareClient", () => { @@ -25,7 +25,7 @@ describe("ShareClient", () => { yesterday.setDate(yesterday.getDate() - 1); tomorrow.setDate(tomorrow.getDate() + 1); - const identifiers: ISignedIdentifier[] = [ + const identifiers: SignedIdentifier[] = [ { accessPolicy: { expiry: tomorrow, diff --git a/sdk/storage/storage-file/test/utils/InjectorPolicy.ts b/sdk/storage/storage-file/test/utils/InjectorPolicy.ts index 3d41732dcddb..735225b3334c 100644 --- a/sdk/storage/storage-file/test/utils/InjectorPolicy.ts +++ b/sdk/storage/storage-file/test/utils/InjectorPolicy.ts @@ -7,7 +7,7 @@ import { RestError } from "../../src"; -export interface INextInjectErrorHolder { +export interface NextInjectErrorHolder { nextInjectError?: RestError; } diff --git a/sdk/storage/storage-file/tslint.json b/sdk/storage/storage-file/tslint.json index ae2eb09109a7..498d029bd134 100644 --- a/sdk/storage/storage-file/tslint.json +++ b/sdk/storage/storage-file/tslint.json @@ -4,7 +4,8 @@ "jsRules": {}, "rules": { "trailing-comma": false, - "arrow-parens": false + "arrow-parens": false, + "interface-name": [true, "never-prefix"] }, "rulesDirectory": [], "linterOptions": {