@azure/storage-file-share 12.23.0-alpha.20240410.1 → 12.23.0-alpha.20240412.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js +8 -8
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +4 -4
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +12 -12
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/Clients.js +12 -12
- package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
- package/dist-esm/storage-file-share/src/ShareServiceClient.js +4 -4
- package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
- package/package.json +2 -2
@@ -164,8 +164,8 @@ export class ShareServiceClient extends StorageClient {
|
|
164
164
|
* items. The marker value is opaque to the client.
|
165
165
|
* @param options - Options to list shares operation.
|
166
166
|
*/
|
167
|
-
listSegments(
|
168
|
-
return __asyncGenerator(this, arguments, function* listSegments_1() {
|
167
|
+
listSegments(marker_1) {
|
168
|
+
return __asyncGenerator(this, arguments, function* listSegments_1(marker, options = {}) {
|
169
169
|
if (options.prefix === "") {
|
170
170
|
options.prefix = undefined;
|
171
171
|
}
|
@@ -182,8 +182,8 @@ export class ShareServiceClient extends StorageClient {
|
|
182
182
|
*
|
183
183
|
* @param options - Options to list shares operation.
|
184
184
|
*/
|
185
|
-
listItems(
|
186
|
-
return __asyncGenerator(this, arguments, function* listItems_1() {
|
185
|
+
listItems() {
|
186
|
+
return __asyncGenerator(this, arguments, function* listItems_1(options = {}) {
|
187
187
|
var _a, e_1, _b, _c;
|
188
188
|
if (options.prefix === "") {
|
189
189
|
options.prefix = undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ShareServiceClient.js","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AO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;YAC1D,MAAM,IAAI,mBAAmB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,iCAChE,cAAc,KACjB,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,IACxC,CAAC;YACH,OAAO,WAAW,CAAC;QACrB,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,qBAAqB,CAC1B,SAAgB,EAChB,cAAqC,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,EACrE,gBAAwB,KAAK,EAC7B,UAA+C,EAAE;QAEjD,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,YAAY,0BAA0B,CAAC,EAAE,CAAC;YAC7D,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,GAAG,GAAG,iCAAiC,iBAEzC,WAAW;YACX,SAAS;YACT,aAAa,EACb,QAAQ,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,IAC/C,OAAO,GAEZ,IAAI,CAAC,UAAU,CAChB,CAAC,QAAQ,EAAE,CAAC;QAEb,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n FileServiceProperties,\n ListSharesIncludeType,\n ShareCreateResponse,\n ShareDeleteResponse,\n ServiceGetPropertiesResponse,\n ServiceSetPropertiesResponse,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel,\n SharePropertiesInternal,\n ServiceSetPropertiesHeaders,\n ServiceGetPropertiesHeaders,\n} from \"./generatedModels\";\nimport { Service } from \"./generated/src/operationsInterfaces\";\nimport { newPipeline, Pipeline } from \"../../storage-blob/src/Pipeline\";\nimport { StorageClient, CommonOptions } from \"./StorageClient\";\nimport { ShareClientInternal } from \"./ShareClientInternal\";\nimport { ShareClient, ShareCreateOptions, ShareDeleteMethodOptions } from \"./Clients\";\nimport {\n WithResponse,\n appendToURLPath,\n extractConnectionStringParts,\n assertResponse,\n removeEmptyString,\n} from \"./utils/utils.common\";\nimport { Credential } from \"../../storage-blob/src/credentials/Credential\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { isNode } from \"@azure/core-util\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { ShareClientConfig, ShareClientOptions, ShareProtocols, toShareProtocols } from \"./models\";\nimport { AccountSASPermissions } from \"./AccountSASPermissions\";\nimport { generateAccountSASQueryParameters } from \"./AccountSASSignatureValues\";\nimport { AccountSASServices } from \"./AccountSASServices\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { SasIPRange } from \"./SasIPRange\";\nimport { appendToURLQuery } from \"./utils/utils.common\";\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\n\n/**\n * Options to configure Share - List Shares Segment operations.\n *\n * See:\n * - {@link ShareServiceClient.listSegments}\n * - {@link ShareServiceClient.listItems}\n * - {@link ShareServiceClient.listSharesSegment}\n */\ninterface ServiceListSharesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies the maximum number of entries to\n * return. If the request does not specify maxResults, or specifies a value\n * greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n\n /**\n * Include this parameter to\n * specify one or more datasets to include in the response.\n */\n include?: ListSharesIncludeType[];\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.listShares} operation.\n */\nexport interface ServiceListSharesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n\n /**\n * Specifies that share snapshots should be included in the enumeration. Share Snapshots are listed from oldest to newest in the response.\n */\n includeMetadata?: boolean;\n\n /**\n * Specifies that share snapshot should be returned in the response.\n */\n includeSnapshots?: boolean;\n\n /**\n * Specifies that share soft deleted should be returned in the response.\n */\n includeDeleted?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.getProperties} operation.\n */\nexport interface ServiceGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.setProperties} operation.\n */\nexport interface ServiceSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.undelete} operation.\n */\nexport interface ServiceUndeleteShareOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Properties of a share.\n */\nexport type ShareProperties = SharePropertiesInternal & {\n /**\n * The protocols that have been enabled on the share.\n */\n protocols?: ShareProtocols;\n};\n\n/**\n * A listed Azure Storage share item.\n */\nexport interface ShareItem {\n name: string;\n snapshot?: string;\n deleted?: boolean;\n version?: string;\n properties: ShareProperties;\n metadata?: { [propertyName: string]: string };\n}\n\n/**\n * An enumeration of shares.\n */\nexport interface ListSharesResponse {\n serviceEndpoint: string;\n prefix?: string;\n marker?: string;\n maxResults?: number;\n shareItems?: ShareItem[];\n continuationToken: string;\n}\n\n/**\n * Contains response data for the {@link ShareServiceClient.listShares} operation.\n */\nexport type ServiceListSharesSegmentResponse = WithResponse<\n ListSharesResponse & ServiceListSharesSegmentHeaders,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n>;\n\n/**\n * Options to configure {@link ShareServiceClient.generateAccountSasUrl} operation.\n */\nexport interface ServiceGenerateAccountSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n}\n\n/**\n * A ShareServiceClient represents a URL to the Azure Storage File service allowing you\n * to manipulate file shares.\n */\nexport class ShareServiceClient extends StorageClient {\n /**\n * serviceContext provided by protocol layer.\n */\n private serviceContext: Service;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n *\n * Creates an instance of ShareServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new ShareServiceClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ): ShareServiceClient {\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new ShareServiceClient(extractedCreds.url, pipeline, options);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new ShareServiceClient(\n extractedCreds.url + \"?\" + extractedCreds.accountSas,\n pipeline,\n options,\n );\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n }\n\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential, or TokenCredential,\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n\n constructor(\n url: string,\n credential?: AnonymousCredential | StorageSharedKeyCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientOptions);\n constructor(\n url: string,\n credentialOrPipeline?:\n | AnonymousCredential\n | StorageSharedKeyCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n if (credentialOrPipeline instanceof Pipeline) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n this.shareClientConfig = options;\n this.serviceContext = this.storageClientContext.service;\n }\n\n /**\n * Creates a ShareClient object.\n *\n * @param shareName - Name of a share.\n * @returns The ShareClient object for the given share name.\n *\n * Example usage:\n *\n * ```js\n * const shareClient = serviceClient.getShareClient(\"<share name>\");\n * await shareClient.create();\n * console.log(\"Created share successfully!\");\n * ```\n */\n public getShareClient(shareName: string): ShareClient {\n return new ShareClient(\n appendToURLPath(this.url, shareName),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share creation response and the corresponding share client.\n */\n public async createShare(\n shareName: string,\n options: ShareCreateOptions = {},\n ): Promise<{ shareCreateResponse: ShareCreateResponse; shareClient: ShareClient }> {\n return tracingClient.withSpan(\n \"ShareServiceClient-createShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n const shareCreateResponse = await shareClient.create(updatedOptions);\n return {\n shareCreateResponse,\n shareClient,\n };\n },\n );\n }\n\n /**\n * Deletes a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share deletion response and the corresponding share client.\n */\n public async deleteShare(\n shareName: string,\n options: ShareDeleteMethodOptions = {},\n ): Promise<ShareDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-deleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n return shareClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s file service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-service-properties\n *\n * @param options - Options to Get Properties operation.\n * @returns Response data for the Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetPropertiesHeaders & FileServiceProperties,\n ServiceGetPropertiesHeaders,\n FileServiceProperties\n >(await this.serviceContext.getProperties(updatedOptions));\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s file service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-service-properties\n *\n * @param properties -\n * @param options - Options to Set Properties operation.\n * @returns Response data for the Set Properties operation.\n */\n public async setProperties(\n properties: FileServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<ServiceSetPropertiesHeaders, ServiceSetPropertiesHeaders>(\n await this.serviceContext.setProperties(properties, updatedOptions),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link ServiceListSharesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of shares to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all shares remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list shares operation.\n */\n private async *listSegments(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listSharesSegmentResponse;\n do {\n listSharesSegmentResponse = await this.listSharesSegment(marker, options);\n marker = listSharesSegmentResponse.continuationToken;\n yield await listSharesSegmentResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for share items\n *\n * @param options - Options to list shares operation.\n */\n private async *listItems(\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ShareItem> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const segment of this.listSegments(marker, options)) {\n if (segment.shareItems) {\n yield* segment.shareItems;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the shares\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the shares in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const share of serviceClient.listShares()) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = serviceClient.listShares();\n * let shareItem = await iter.next();\n * while (!shareItem.done) {\n * console.log(`Share ${i++}: ${shareItem.value.name}`);\n * shareItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of serviceClient.listShares().byPage({ maxPageSize: 20 })) {\n * if (response.shareItems) {\n * for (const share of response.shareItems) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = serviceClient.listShares().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 share names\n * if (response.shareItems) {\n * for (const share of response.shareItems) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n * iterator = serviceClient.listShares().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 share names\n * if (response.shareItems) {\n * for (const share of response.shareItems) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list shares operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listShares(\n options: ServiceListSharesOptions = {},\n ): PagedAsyncIterableIterator<ShareItem, ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const include: ListSharesIncludeType[] = [];\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSnapshots) {\n include.push(\"snapshots\");\n }\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n\n const updatedOptions: ServiceListSharesSegmentOptions = {\n ...options,\n ...(include.length > 0 ? { include: include } : {}),\n };\n\n // AsyncIterableIterator to iterate over queues\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(removeEmptyString(settings.continuationToken), {\n maxResults: settings.maxPageSize,\n ...updatedOptions,\n });\n },\n };\n }\n\n /**\n * Gets the properties of a storage account's File service, including properties for Storage\n * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.\n *\n * @param marker - A string value that identifies the portion of\n * the list to be returned with the next list operation. The operation\n * returns a marker value within the response body if the list returned was\n * not complete. The marker value may then be used in a subsequent call to\n * request the next set of list items. The marker value is opaque to the\n * client.\n * @param options - Options to List Shares Segment operation.\n * @returns Response data for the List Shares Segment operation.\n */\n private async listSharesSegment(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): Promise<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n return tracingClient.withSpan(\n \"ShareServiceClient-listSharesSegment\",\n options,\n async (updatedOptions) => {\n const res = assertResponse<\n ServiceListSharesSegmentHeaders & ListSharesResponseModel,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n >(\n await this.serviceContext.listSharesSegment({\n ...updatedOptions,\n marker,\n }),\n );\n\n // parse protocols\n if (res.shareItems) {\n for (let i = 0; i < res.shareItems.length; i++) {\n const protocolsStr = res.shareItems[i].properties.enabledProtocols;\n (res.shareItems[i].properties as any).protocols = toShareProtocols(protocolsStr);\n }\n }\n\n return res;\n },\n );\n }\n\n /**\n * Restores a previously deleted share.\n * This API is only functional if Share Soft Delete is enabled\n * for the storage account associated with the share.\n *\n * @param deletedShareName - The name of the previously deleted share.\n * @param deletedShareVersion - The version of the previously deleted share.\n * @param options - Options to Share undelete operation.\n * @returns Restored share.\n */\n public async undeleteShare(\n deletedShareName: string,\n deletedShareVersion: string,\n options: ServiceUndeleteShareOptions = {},\n ): Promise<ShareClient> {\n return tracingClient.withSpan(\n \"ShareServiceClient-undeleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(deletedShareName);\n await new ShareClientInternal(shareClient.url, this.pipeline).restore({\n ...updatedOptions,\n deletedShareName: deletedShareName,\n deletedShareVersion: deletedShareVersion,\n });\n return shareClient;\n },\n );\n }\n\n /**\n * Only available for ShareServiceClient constructed with a shared key credential.\n *\n * Generates an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateAccountSasUrl(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSASQueryParameters(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"f\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ShareServiceClient.js","sourceRoot":"","sources":["../../../src/ShareServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAiBlC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAiB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAgD,MAAM,WAAW,CAAC;AACtF,OAAO,EAEL,eAAe,EACf,4BAA4B,EAC5B,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EA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U,YAAY,0BAA0B,CAAC,EAAE,CAAC;YAC7D,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,GAAG,GAAG,iCAAiC,iBAEzC,WAAW;YACX,SAAS;YACT,aAAa,EACb,QAAQ,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,IAC/C,OAAO,GAEZ,IAAI,CAAC,UAAU,CAChB,CAAC,QAAQ,EAAE,CAAC;QAEb,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n FileServiceProperties,\n ListSharesIncludeType,\n ShareCreateResponse,\n ShareDeleteResponse,\n ServiceGetPropertiesResponse,\n ServiceSetPropertiesResponse,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel,\n SharePropertiesInternal,\n ServiceSetPropertiesHeaders,\n ServiceGetPropertiesHeaders,\n} from \"./generatedModels\";\nimport { Service } from \"./generated/src/operationsInterfaces\";\nimport { newPipeline, Pipeline } from \"../../storage-blob/src/Pipeline\";\nimport { StorageClient, CommonOptions } from \"./StorageClient\";\nimport { ShareClientInternal } from \"./ShareClientInternal\";\nimport { ShareClient, ShareCreateOptions, ShareDeleteMethodOptions } from \"./Clients\";\nimport {\n WithResponse,\n appendToURLPath,\n extractConnectionStringParts,\n assertResponse,\n removeEmptyString,\n} from \"./utils/utils.common\";\nimport { Credential } from \"../../storage-blob/src/credentials/Credential\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { isNode } from \"@azure/core-util\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { ShareClientConfig, ShareClientOptions, ShareProtocols, toShareProtocols } from \"./models\";\nimport { AccountSASPermissions } from \"./AccountSASPermissions\";\nimport { generateAccountSASQueryParameters } from \"./AccountSASSignatureValues\";\nimport { AccountSASServices } from \"./AccountSASServices\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { SasIPRange } from \"./SasIPRange\";\nimport { appendToURLQuery } from \"./utils/utils.common\";\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\n\n/**\n * Options to configure Share - List Shares Segment operations.\n *\n * See:\n * - {@link ShareServiceClient.listSegments}\n * - {@link ShareServiceClient.listItems}\n * - {@link ShareServiceClient.listSharesSegment}\n */\ninterface ServiceListSharesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies the maximum number of entries to\n * return. If the request does not specify maxResults, or specifies a value\n * greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n\n /**\n * Include this parameter to\n * specify one or more datasets to include in the response.\n */\n include?: ListSharesIncludeType[];\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.listShares} operation.\n */\nexport interface ServiceListSharesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n\n /**\n * Specifies that share snapshots should be included in the enumeration. Share Snapshots are listed from oldest to newest in the response.\n */\n includeMetadata?: boolean;\n\n /**\n * Specifies that share snapshot should be returned in the response.\n */\n includeSnapshots?: boolean;\n\n /**\n * Specifies that share soft deleted should be returned in the response.\n */\n includeDeleted?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.getProperties} operation.\n */\nexport interface ServiceGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.setProperties} operation.\n */\nexport interface ServiceSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.undelete} operation.\n */\nexport interface ServiceUndeleteShareOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Properties of a share.\n */\nexport type ShareProperties = SharePropertiesInternal & {\n /**\n * The protocols that have been enabled on the share.\n */\n protocols?: ShareProtocols;\n};\n\n/**\n * A listed Azure Storage share item.\n */\nexport interface ShareItem {\n name: string;\n snapshot?: string;\n deleted?: boolean;\n version?: string;\n properties: ShareProperties;\n metadata?: { [propertyName: string]: string };\n}\n\n/**\n * An enumeration of shares.\n */\nexport interface ListSharesResponse {\n serviceEndpoint: string;\n prefix?: string;\n marker?: string;\n maxResults?: number;\n shareItems?: ShareItem[];\n continuationToken: string;\n}\n\n/**\n * Contains response data for the {@link ShareServiceClient.listShares} operation.\n */\nexport type ServiceListSharesSegmentResponse = WithResponse<\n ListSharesResponse & ServiceListSharesSegmentHeaders,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n>;\n\n/**\n * Options to configure {@link ShareServiceClient.generateAccountSasUrl} operation.\n */\nexport interface ServiceGenerateAccountSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n}\n\n/**\n * A ShareServiceClient represents a URL to the Azure Storage File service allowing you\n * to manipulate file shares.\n */\nexport class ShareServiceClient extends StorageClient {\n /**\n * serviceContext provided by protocol layer.\n */\n private serviceContext: Service;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n *\n * Creates an instance of ShareServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new ShareServiceClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ): ShareServiceClient {\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new ShareServiceClient(extractedCreds.url, pipeline, options);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new ShareServiceClient(\n extractedCreds.url + \"?\" + extractedCreds.accountSas,\n pipeline,\n options,\n );\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n }\n\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential, or TokenCredential,\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n\n constructor(\n url: string,\n credential?: AnonymousCredential | StorageSharedKeyCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientOptions);\n constructor(\n url: string,\n credentialOrPipeline?:\n | AnonymousCredential\n | StorageSharedKeyCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n if (credentialOrPipeline instanceof Pipeline) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n this.shareClientConfig = options;\n this.serviceContext = this.storageClientContext.service;\n }\n\n /**\n * Creates a ShareClient object.\n *\n * @param shareName - Name of a share.\n * @returns The ShareClient object for the given share name.\n *\n * Example usage:\n *\n * ```js\n * const shareClient = serviceClient.getShareClient(\"<share name>\");\n * await shareClient.create();\n * console.log(\"Created share successfully!\");\n * ```\n */\n public getShareClient(shareName: string): ShareClient {\n return new ShareClient(\n appendToURLPath(this.url, shareName),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share creation response and the corresponding share client.\n */\n public async createShare(\n shareName: string,\n options: ShareCreateOptions = {},\n ): Promise<{ shareCreateResponse: ShareCreateResponse; shareClient: ShareClient }> {\n return tracingClient.withSpan(\n \"ShareServiceClient-createShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n const shareCreateResponse = await shareClient.create(updatedOptions);\n return {\n shareCreateResponse,\n shareClient,\n };\n },\n );\n }\n\n /**\n * Deletes a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share deletion response and the corresponding share client.\n */\n public async deleteShare(\n shareName: string,\n options: ShareDeleteMethodOptions = {},\n ): Promise<ShareDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-deleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n return shareClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s file service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-service-properties\n *\n * @param options - Options to Get Properties operation.\n * @returns Response data for the Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetPropertiesHeaders & FileServiceProperties,\n ServiceGetPropertiesHeaders,\n FileServiceProperties\n >(await this.serviceContext.getProperties(updatedOptions));\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s file service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-service-properties\n *\n * @param properties -\n * @param options - Options to Set Properties operation.\n * @returns Response data for the Set Properties operation.\n */\n public async setProperties(\n properties: FileServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<ServiceSetPropertiesHeaders, ServiceSetPropertiesHeaders>(\n await this.serviceContext.setProperties(properties, updatedOptions),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link ServiceListSharesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of shares to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all shares remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list shares operation.\n */\n private async *listSegments(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listSharesSegmentResponse;\n do {\n listSharesSegmentResponse = await this.listSharesSegment(marker, options);\n marker = listSharesSegmentResponse.continuationToken;\n yield await listSharesSegmentResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for share items\n *\n * @param options - Options to list shares operation.\n */\n private async *listItems(\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ShareItem> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const segment of this.listSegments(marker, options)) {\n if (segment.shareItems) {\n yield* segment.shareItems;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the shares\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the shares in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const share of serviceClient.listShares()) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = serviceClient.listShares();\n * let shareItem = await iter.next();\n * while (!shareItem.done) {\n * console.log(`Share ${i++}: ${shareItem.value.name}`);\n * shareItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of serviceClient.listShares().byPage({ maxPageSize: 20 })) {\n * if (response.shareItems) {\n * for (const share of response.shareItems) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = serviceClient.listShares().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 share names\n * if (response.shareItems) {\n * for (const share of response.shareItems) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n * iterator = serviceClient.listShares().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 share names\n * if (response.shareItems) {\n * for (const share of response.shareItems) {\n * console.log(`Share ${i++}: ${share.name}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list shares operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listShares(\n options: ServiceListSharesOptions = {},\n ): PagedAsyncIterableIterator<ShareItem, ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const include: ListSharesIncludeType[] = [];\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSnapshots) {\n include.push(\"snapshots\");\n }\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n\n const updatedOptions: ServiceListSharesSegmentOptions = {\n ...options,\n ...(include.length > 0 ? { include: include } : {}),\n };\n\n // AsyncIterableIterator to iterate over queues\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(removeEmptyString(settings.continuationToken), {\n maxResults: settings.maxPageSize,\n ...updatedOptions,\n });\n },\n };\n }\n\n /**\n * Gets the properties of a storage account's File service, including properties for Storage\n * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.\n *\n * @param marker - A string value that identifies the portion of\n * the list to be returned with the next list operation. The operation\n * returns a marker value within the response body if the list returned was\n * not complete. The marker value may then be used in a subsequent call to\n * request the next set of list items. The marker value is opaque to the\n * client.\n * @param options - Options to List Shares Segment operation.\n * @returns Response data for the List Shares Segment operation.\n */\n private async listSharesSegment(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): Promise<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n return tracingClient.withSpan(\n \"ShareServiceClient-listSharesSegment\",\n options,\n async (updatedOptions) => {\n const res = assertResponse<\n ServiceListSharesSegmentHeaders & ListSharesResponseModel,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n >(\n await this.serviceContext.listSharesSegment({\n ...updatedOptions,\n marker,\n }),\n );\n\n // parse protocols\n if (res.shareItems) {\n for (let i = 0; i < res.shareItems.length; i++) {\n const protocolsStr = res.shareItems[i].properties.enabledProtocols;\n (res.shareItems[i].properties as any).protocols = toShareProtocols(protocolsStr);\n }\n }\n\n return res;\n },\n );\n }\n\n /**\n * Restores a previously deleted share.\n * This API is only functional if Share Soft Delete is enabled\n * for the storage account associated with the share.\n *\n * @param deletedShareName - The name of the previously deleted share.\n * @param deletedShareVersion - The version of the previously deleted share.\n * @param options - Options to Share undelete operation.\n * @returns Restored share.\n */\n public async undeleteShare(\n deletedShareName: string,\n deletedShareVersion: string,\n options: ServiceUndeleteShareOptions = {},\n ): Promise<ShareClient> {\n return tracingClient.withSpan(\n \"ShareServiceClient-undeleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(deletedShareName);\n await new ShareClientInternal(shareClient.url, this.pipeline).restore({\n ...updatedOptions,\n deletedShareName: deletedShareName,\n deletedShareVersion: deletedShareVersion,\n });\n return shareClient;\n },\n );\n }\n\n /**\n * Only available for ShareServiceClient constructed with a shared key credential.\n *\n * Generates an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateAccountSasUrl(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSASQueryParameters(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"f\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/storage-file-share",
|
3
3
|
"sdk-type": "client",
|
4
|
-
"version": "12.23.0-alpha.
|
4
|
+
"version": "12.23.0-alpha.20240412.1",
|
5
5
|
"description": "Microsoft Azure Storage SDK for JavaScript - File",
|
6
6
|
"main": "./dist/index.js",
|
7
7
|
"module": "./dist-esm/storage-file-share/src/index.js",
|
@@ -164,7 +164,7 @@
|
|
164
164
|
"sinon": "^17.0.0",
|
165
165
|
"source-map-support": "^0.5.9",
|
166
166
|
"ts-node": "^10.0.0",
|
167
|
-
"typescript": "~5.
|
167
|
+
"typescript": "~5.4.5",
|
168
168
|
"util": "^0.12.1"
|
169
169
|
}
|
170
170
|
}
|