@azure/storage-file-datalake 12.8.1-alpha.20220401.1 → 12.9.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -3
- package/dist/index.js +176 -18
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/DataLakeFileSystemClient.js +2 -2
- package/dist-esm/storage-file-datalake/src/DataLakeFileSystemClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/clients.js +24 -13
- package/dist-esm/storage-file-datalake/src/clients.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/models/mappers.js +70 -0
- package/dist-esm/storage-file-datalake/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/models/parameters.js +31 -1
- package/dist-esm/storage-file-datalake/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/operations/path.js +13 -1
- package/dist-esm/storage-file-datalake/src/generated/src/operations/path.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/storageClientContext.js +2 -2
- package/dist-esm/storage-file-datalake/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/models.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/transforms.js +9 -0
- package/dist-esm/storage-file-datalake/src/transforms.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/constants.js +3 -2
- package/dist-esm/storage-file-datalake/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/utils.common.js +26 -1
- package/dist-esm/storage-file-datalake/src/utils/utils.common.js.map +1 -1
- package/package.json +10 -6
- package/types/3.1/storage-file-datalake.d.ts +84 -0
- package/types/latest/storage-file-datalake.d.ts +86 -0
|
@@ -9,7 +9,7 @@ import { newPipeline, Pipeline } from "./Pipeline";
|
|
|
9
9
|
import { StorageClient } from "./StorageClient";
|
|
10
10
|
import { toContainerPublicAccessType, toPublicAccessType, toPermissions } from "./transforms";
|
|
11
11
|
import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing";
|
|
12
|
-
import { appendToURLPath, appendToURLQuery } from "./utils/utils.common";
|
|
12
|
+
import { appendToURLPath, appendToURLQuery, windowsFileTimeTicksToTime, } from "./utils/utils.common";
|
|
13
13
|
import { DataLakeFileClient, DataLakeDirectoryClient } from "./clients";
|
|
14
14
|
import { generateDataLakeSASQueryParameters } from "./sas/DataLakeSASSignatureValues";
|
|
15
15
|
import { DeletionIdKey, PathResultTypeConstants } from "./utils/constants";
|
|
@@ -447,7 +447,7 @@ export class DataLakeFileSystemClient extends StorageClient {
|
|
|
447
447
|
const response = rawResponse;
|
|
448
448
|
response.pathItems = [];
|
|
449
449
|
for (const path of rawResponse.paths || []) {
|
|
450
|
-
response.pathItems.push(Object.assign(Object.assign({}, path), { permissions: toPermissions(path.permissions) }));
|
|
450
|
+
response.pathItems.push(Object.assign(Object.assign({}, path), { permissions: toPermissions(path.permissions), createdOn: windowsFileTimeTicksToTime(path.creationTime), expiresOn: windowsFileTimeTicksToTime(path.expiryTime) }));
|
|
451
451
|
}
|
|
452
452
|
delete rawResponse.paths;
|
|
453
453
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataLakeFileSystemClient.js","sourceRoot":"","sources":["../../../src/DataLakeFileSystemClient.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAiCxD,OAAO,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AI,CAAC,IAAI,IACtB,OAAO,GAEZ,IAAI,CAAC,UAAU,CAChB,CAAC,QAAQ,EAAE,CAAC;YAEb,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { TokenCredential } from \"@azure/core-http\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { ContainerClient } from \"@azure/storage-blob\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\n\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\nimport { DataLakeLeaseClient } from \"./DataLakeLeaseClient\";\nimport { FileSystem } from \"./generated/src/operations\";\nimport {\n AccessPolicy,\n FileSystemCreateOptions,\n FileSystemCreateResponse,\n FileSystemDeleteOptions,\n FileSystemDeleteResponse,\n FileSystemExistsOptions,\n FileSystemGetAccessPolicyOptions,\n FileSystemGetAccessPolicyResponse,\n FileSystemGetPropertiesOptions,\n FileSystemGetPropertiesResponse,\n FileSystemSetAccessPolicyOptions,\n FileSystemSetAccessPolicyResponse,\n FileSystemSetMetadataOptions,\n FileSystemSetMetadataResponse,\n ListPathsOptions,\n ListPathsSegmentOptions,\n Metadata,\n Path,\n PublicAccessType,\n SignedIdentifier,\n FileSystemListPathsResponse,\n FileSystemCreateIfNotExistsResponse,\n FileSystemDeleteIfExistsResponse,\n FileSystemGenerateSasUrlOptions,\n FileSystemListDeletedPathsResponse,\n ListDeletedPathsOptions,\n DeletedPath,\n FileSystemUndeletePathResponse,\n FileSystemUndeletePathOption,\n ListDeletedPathsSegmentOptions,\n} from \"./models\";\nimport { newPipeline, Pipeline, StoragePipelineOptions } from \"./Pipeline\";\nimport { StorageClient } from \"./StorageClient\";\nimport { toContainerPublicAccessType, toPublicAccessType, toPermissions } from \"./transforms\";\nimport { convertTracingToRequestOptionsBase, createSpan } from \"./utils/tracing\";\nimport { appendToURLPath, appendToURLQuery } from \"./utils/utils.common\";\nimport { DataLakeFileClient, DataLakeDirectoryClient } from \"./clients\";\nimport { generateDataLakeSASQueryParameters } from \"./sas/DataLakeSASSignatureValues\";\nimport { DeletionIdKey, PathResultTypeConstants } from \"./utils/constants\";\nimport { PathClientInternal } from \"./utils/PathClientInternal\";\n\n/**\n * A DataLakeFileSystemClient represents a URL to the Azure Storage file system\n * allowing you to manipulate its directories and files.\n */\nexport class DataLakeFileSystemClient extends StorageClient {\n /**\n * fileSystemContext provided by protocol layer.\n */\n private fileSystemContext: FileSystem;\n\n /**\n * fileSystemContext provided by protocol layer.\n */\n private fileSystemContextToBlobEndpoint: FileSystem;\n\n /**\n * blobContainerClient provided by `@azure/storage-blob` package.\n */\n private blobContainerClient: ContainerClient;\n\n /**\n * Creates an instance of DataLakeFileSystemClient from url and credential.\n *\n * @param url - A Client string pointing to Azure Storage data lake file system, such as\n * \"https://myaccount.dfs.core.windows.net/filesystem\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net/filesystem?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | 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?: StoragePipelineOptions\n );\n\n /**\n * Creates an instance of DataLakeFileSystemClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake file system, such as\n * \"https://myaccount.dfs.core.windows.net/filesystem\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net/filesystem?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline);\n\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\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?: StoragePipelineOptions\n ) {\n if (credentialOrPipeline instanceof Pipeline) {\n super(url, credentialOrPipeline);\n } else {\n let credential;\n if (credentialOrPipeline === undefined) {\n credential = new AnonymousCredential();\n } else {\n credential = credentialOrPipeline;\n }\n\n const pipeline = newPipeline(credential, options);\n super(url, pipeline);\n }\n\n this.fileSystemContext = new FileSystem(this.storageClientContext);\n this.fileSystemContextToBlobEndpoint = new FileSystem(this.storageClientContextToBlobEndpoint);\n this.blobContainerClient = new ContainerClient(this.blobEndpointUrl, this.pipeline);\n }\n\n /**\n * Name of current file system.\n *\n * @readonly\n */\n public get name(): string {\n return this.blobContainerClient.containerName;\n }\n\n /**\n * Creates a {@link DataLakeDirectoryClient} object under current file system.\n *\n * @param directoryName -\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-subclients */\n public getDirectoryClient(directoryName: string): DataLakeDirectoryClient {\n return new DataLakeDirectoryClient(\n appendToURLPath(this.url, encodeURIComponent(directoryName)),\n this.pipeline\n );\n }\n\n /**\n * Creates a {@link DataLakeFileClient} object under current file system.\n *\n * @param fileName -\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-subclients */\n public getFileClient(fileName: string): DataLakeFileClient {\n return new DataLakeFileClient(\n appendToURLPath(this.url, encodeURIComponent(fileName)),\n this.pipeline\n );\n }\n\n /**\n * Get a {@link DataLakeLeaseClient} that manages leases on the file system.\n *\n * @param proposeLeaseId - Optional. Initial proposed lease Id.\n */\n public getDataLakeLeaseClient(proposeLeaseId?: string): DataLakeLeaseClient {\n return new DataLakeLeaseClient(this.blobContainerClient.getBlobLeaseClient(proposeLeaseId));\n }\n\n /**\n * Creates a new file system under the specified account. If the file system with\n * the same name already exists, the operation fails.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n *\n * @param options - Optional. Options when creating file system.\n */\n public async create(options: FileSystemCreateOptions = {}): Promise<FileSystemCreateResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-create\", options);\n try {\n return await this.blobContainerClient.create({\n ...options,\n access: toContainerPublicAccessType(options.access),\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new file system under the specified account. If the file system with\n * the same name already exists, it is not changed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n *\n * @param options -\n */\n public async createIfNotExists(\n options: FileSystemCreateOptions = {}\n ): Promise<FileSystemCreateIfNotExistsResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-createIfNotExists\",\n options\n );\n try {\n return await this.blobContainerClient.createIfNotExists({\n ...options,\n access: toContainerPublicAccessType(options.access),\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns true if the File system represented by this client exists; false otherwise.\n *\n * NOTE: use this function with care since an existing file system might be deleted by other clients or\n * applications. Vice versa new file system with the same name might be added by other clients or\n * applications after this function completes.\n *\n * @param options -\n */\n public async exists(options: FileSystemExistsOptions = {}): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-exists\", options);\n try {\n return await this.blobContainerClient.exists(updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Delete current file system.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container\n *\n * @param options - Optional. Options when deleting file system.\n */\n public async delete(options: FileSystemDeleteOptions = {}): Promise<FileSystemDeleteResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-delete\", options);\n try {\n return await this.blobContainerClient.delete({\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Delete current file system if it exists.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container\n *\n * @param options -\n */\n public async deleteIfExists(\n options: FileSystemDeleteOptions = {}\n ): Promise<FileSystemDeleteIfExistsResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-deleteIfExists\", options);\n try {\n return await this.blobContainerClient.deleteIfExists(updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns all user-defined metadata and system properties for the specified\n * file system.\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listFileSystems` method of {@link DataLakeServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties\n *\n * @param options - Optional. Options when getting file system properties.\n */\n public async getProperties(\n options: FileSystemGetPropertiesOptions = {}\n ): Promise<FileSystemGetPropertiesResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-getProperties\", options);\n try {\n const rawResponse = await this.blobContainerClient.getProperties({\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n // Transfer and rename blobPublicAccess to publicAccess\n const response = rawResponse as FileSystemGetPropertiesResponse;\n\n response.publicAccess = toPublicAccessType(rawResponse.blobPublicAccess);\n response._response.parsedHeaders.publicAccess = response.publicAccess;\n\n delete rawResponse.blobPublicAccess;\n delete rawResponse._response.parsedHeaders.blobPublicAccess;\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets one or more user-defined name-value pairs for the specified file system.\n *\n * If no option provided, or no metadata defined in the parameter, the file system\n * metadata will be removed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata\n *\n * @param metadata - Replace existing metadata with this value.\n * If no value provided the existing metadata will be removed.\n * @param options - Optional. Options when setting file system metadata.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: FileSystemSetMetadataOptions = {}\n ): Promise<FileSystemSetMetadataResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-setMetadata\", options);\n try {\n return await this.blobContainerClient.setMetadata(metadata, {\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Gets the permissions for the specified file system. The permissions indicate\n * whether file system data may be accessed publicly.\n *\n * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl\n *\n * @param options - Optional. Options when getting file system access policy.\n */\n public async getAccessPolicy(\n options: FileSystemGetAccessPolicyOptions = {}\n ): Promise<FileSystemGetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-getAccessPolicy\",\n options\n );\n try {\n const rawResponse = await this.blobContainerClient.getAccessPolicy({\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n // Transfer and rename blobPublicAccess to publicAccess\n const response = rawResponse as unknown as FileSystemGetAccessPolicyResponse;\n\n response.publicAccess = toPublicAccessType(rawResponse.blobPublicAccess);\n response._response.parsedHeaders.publicAccess = response.publicAccess;\n\n delete rawResponse.blobPublicAccess;\n delete rawResponse._response.parsedHeaders.blobPublicAccess;\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets the permissions for the specified file system. The permissions indicate\n * whether directories or files in a file system may be accessed publicly.\n *\n * When you set permissions for a file system, the existing permissions are replaced.\n * If no access or containerAcl provided, the existing file system ACL will be\n * removed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl\n *\n * @param access - Optional. The level of public access to data in the file system.\n * @param fileSystemAcl - Optional. Array of elements each having a unique Id and details of the access policy.\n * @param options - Optional. Options when setting file system access policy.\n */\n public async setAccessPolicy(\n access?: PublicAccessType,\n fileSystemAcl?: SignedIdentifier<AccessPolicy>[],\n options: FileSystemSetAccessPolicyOptions = {}\n ): Promise<FileSystemSetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-setAccessPolicy\",\n options\n );\n try {\n return await this.blobContainerClient.setAccessPolicy(\n toContainerPublicAccessType(access),\n fileSystemAcl,\n {\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n }\n );\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the paths (directories and files)\n * under the specified file system.\n *\n * .byPage() returns an async iterable iterator to list the paths in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the fileSystemClient before you run these snippets,\n * // Can be obtained from `serviceClient.getFileSystemClient(\"<your-filesystem-name>\");`\n * let i = 1;\n * for await (const path of fileSystemClient.listPaths()) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = fileSystemClient.listPaths();\n * let pathItem = await iter.next();\n * while (!pathItem.done) {\n * console.log(`Path ${i++}: ${pathItem.value.name}, isDirectory?: ${pathItem.value.isDirectory}`);\n * pathItem = 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 fileSystemClient.listPaths().byPage({ maxPageSize: 20 })) {\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = fileSystemClient.listPaths().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 path names\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = fileSystemClient.listPaths().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 path names\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n * ```\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs\n *\n * @param options - Optional. Options when listing paths.\n */\n public listPaths(\n options: ListPathsOptions = {}\n ): PagedAsyncIterableIterator<Path, FileSystemListPathsResponse> {\n options.path = options.path === \"\" ? undefined : options.path;\n\n const iter = this.listItems(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(settings.continuationToken, {\n maxResults: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n\n private async *listItems(options: ListPathsSegmentOptions = {}): AsyncIterableIterator<Path> {\n for await (const response of this.listSegments(undefined, options)) {\n yield* response.pathItems || [];\n }\n }\n\n private async *listSegments(\n continuation?: string,\n options: ListPathsSegmentOptions = {}\n ): AsyncIterableIterator<FileSystemListPathsResponse> {\n let response;\n if (!!continuation || continuation === undefined) {\n do {\n response = await this.listPathsSegment(continuation, options);\n continuation = response.continuation;\n yield response;\n } while (continuation);\n }\n }\n\n private async listPathsSegment(\n continuation?: string,\n options: ListPathsSegmentOptions = {}\n ): Promise<FileSystemListPathsResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-listPathsSegment\",\n options\n );\n try {\n const rawResponse = await this.fileSystemContext.listPaths(options.recursive || false, {\n continuation,\n ...options,\n upn: options.userPrincipalName,\n ...convertTracingToRequestOptionsBase(updatedOptions),\n });\n\n const response = rawResponse as FileSystemListPathsResponse;\n response.pathItems = [];\n for (const path of rawResponse.paths || []) {\n response.pathItems.push({\n ...path,\n permissions: toPermissions(path.permissions),\n });\n }\n delete rawResponse.paths;\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the paths (directories and files)\n * under the specified file system.\n *\n * .byPage() returns an async iterable iterator to list the paths in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the fileSystemClient before you run these snippets,\n * // Can be obtained from `serviceClient.getFileSystemClient(\"<your-filesystem-name>\");`\n * let i = 1;\n * for await (const deletePath of fileSystemClient.listDeletedPaths()) {\n * console.log(`Path ${i++}: ${deletePath.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = fileSystemClient.listDeletedPaths();\n * let deletedPathItem = await iter.next();\n * while (!deletedPathItem.done) {\n * console.log(`Path ${i++}: ${deletedPathItem.value.name}`);\n * pathItem = 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 fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 20 })) {\n * for (const deletePath of response.pathItems) {\n * console.log(`Path ${i++}: ${deletePath.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 path names\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = fileSystemClient.listDeletedPaths().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 path names\n * for (const deletePath of response.deletedPathItems) {\n * console.log(`Path ${i++}: ${deletePath.name}`);\n * }\n * ```\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs\n *\n * @param options - Optional. Options when listing deleted paths.\n */\n public listDeletedPaths(\n options: ListDeletedPathsOptions = {}\n ): PagedAsyncIterableIterator<DeletedPath, FileSystemListDeletedPathsResponse> {\n const iter = this.listDeletedItems(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => {\n return this.listDeletedSegments(settings.continuationToken, {\n maxResults: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n private async *listDeletedItems(\n options: ListDeletedPathsOptions = {}\n ): AsyncIterableIterator<DeletedPath> {\n for await (const response of this.listDeletedSegments(undefined, options)) {\n yield* response.pathItems || [];\n }\n }\n\n private async *listDeletedSegments(\n continuation?: string,\n options: ListDeletedPathsSegmentOptions = {}\n ): AsyncIterableIterator<FileSystemListDeletedPathsResponse> {\n let response;\n if (!!continuation || continuation === undefined) {\n do {\n response = await this.listDeletedPathsSegment(continuation, options);\n continuation = response.continuation;\n yield response;\n } while (continuation);\n }\n }\n\n private async listDeletedPathsSegment(\n continuation?: string,\n options: ListDeletedPathsSegmentOptions = {}\n ): Promise<FileSystemListDeletedPathsResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-listDeletedPathsSegment\",\n options\n );\n try {\n const rawResponse = await this.fileSystemContextToBlobEndpoint.listBlobHierarchySegment({\n marker: continuation,\n ...options,\n prefix: options.prefix === \"\" ? undefined : options.prefix,\n ...convertTracingToRequestOptionsBase(updatedOptions),\n });\n\n const response = rawResponse as FileSystemListDeletedPathsResponse;\n response.pathItems = [];\n for (const path of rawResponse.segment.blobItems || []) {\n response.pathItems.push({\n name: path.name,\n deletionId: path.deletionId,\n deletedOn: path.properties.deletedTime,\n remainingRetentionDays: path.properties.remainingRetentionDays,\n });\n }\n\n if (!(response.nextMarker === undefined || response.nextMarker === \"\")) {\n response.continuation = response.nextMarker;\n }\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Restores a soft deleted path.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob\n *\n * @param deletedPath - Required. The path of the deleted path.\n *\n * @param deletionId - Required. The deletion ID associated with the soft deleted path.\n *\n */\n\n public async undeletePath(\n deletedPath: string,\n deletionId: string,\n options: FileSystemUndeletePathOption = {}\n ): Promise<FileSystemUndeletePathResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-undeletePath\", options);\n try {\n const pathClient = new PathClientInternal(\n appendToURLPath(this.blobEndpointUrl, encodeURIComponent(deletedPath)),\n this.pipeline\n );\n\n const rawResponse = await pathClient.blobPathContext.undelete({\n undeleteSource: \"?\" + DeletionIdKey + \"=\" + deletionId,\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n if (rawResponse.resourceType === PathResultTypeConstants.DirectoryResourceType) {\n return {\n pathClient: this.getDirectoryClient(deletedPath),\n ...rawResponse,\n };\n } else {\n return {\n pathClient: this.getFileClient(deletedPath),\n ...rawResponse,\n };\n }\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Only available for DataLakeFileSystemClient constructed with a shared key credential.\n *\n * Generates a Service 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/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: FileSystemGenerateSasUrlOptions): Promise<string> {\n return new Promise((resolve) => {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\"\n );\n }\n\n const sas = generateDataLakeSASQueryParameters(\n {\n fileSystemName: this.name,\n ...options,\n },\n this.credential\n ).toString();\n\n resolve(appendToURLQuery(this.url, sas));\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DataLakeFileSystemClient.js","sourceRoot":"","sources":["../../../src/DataLakeFileSystemClient.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAiCxD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAA0B,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,kC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AAE,CAAC;YAEb,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { TokenCredential } from \"@azure/core-http\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { ContainerClient } from \"@azure/storage-blob\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\n\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\nimport { DataLakeLeaseClient } from \"./DataLakeLeaseClient\";\nimport { FileSystem } from \"./generated/src/operations\";\nimport {\n AccessPolicy,\n FileSystemCreateOptions,\n FileSystemCreateResponse,\n FileSystemDeleteOptions,\n FileSystemDeleteResponse,\n FileSystemExistsOptions,\n FileSystemGetAccessPolicyOptions,\n FileSystemGetAccessPolicyResponse,\n FileSystemGetPropertiesOptions,\n FileSystemGetPropertiesResponse,\n FileSystemSetAccessPolicyOptions,\n FileSystemSetAccessPolicyResponse,\n FileSystemSetMetadataOptions,\n FileSystemSetMetadataResponse,\n ListPathsOptions,\n ListPathsSegmentOptions,\n Metadata,\n Path,\n PublicAccessType,\n SignedIdentifier,\n FileSystemListPathsResponse,\n FileSystemCreateIfNotExistsResponse,\n FileSystemDeleteIfExistsResponse,\n FileSystemGenerateSasUrlOptions,\n FileSystemListDeletedPathsResponse,\n ListDeletedPathsOptions,\n DeletedPath,\n FileSystemUndeletePathResponse,\n FileSystemUndeletePathOption,\n ListDeletedPathsSegmentOptions,\n} from \"./models\";\nimport { newPipeline, Pipeline, StoragePipelineOptions } from \"./Pipeline\";\nimport { StorageClient } from \"./StorageClient\";\nimport { toContainerPublicAccessType, toPublicAccessType, toPermissions } from \"./transforms\";\nimport { convertTracingToRequestOptionsBase, createSpan } from \"./utils/tracing\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n windowsFileTimeTicksToTime,\n} from \"./utils/utils.common\";\nimport { DataLakeFileClient, DataLakeDirectoryClient } from \"./clients\";\nimport { generateDataLakeSASQueryParameters } from \"./sas/DataLakeSASSignatureValues\";\nimport { DeletionIdKey, PathResultTypeConstants } from \"./utils/constants\";\nimport { PathClientInternal } from \"./utils/PathClientInternal\";\n\n/**\n * A DataLakeFileSystemClient represents a URL to the Azure Storage file system\n * allowing you to manipulate its directories and files.\n */\nexport class DataLakeFileSystemClient extends StorageClient {\n /**\n * fileSystemContext provided by protocol layer.\n */\n private fileSystemContext: FileSystem;\n\n /**\n * fileSystemContext provided by protocol layer.\n */\n private fileSystemContextToBlobEndpoint: FileSystem;\n\n /**\n * blobContainerClient provided by `@azure/storage-blob` package.\n */\n private blobContainerClient: ContainerClient;\n\n /**\n * Creates an instance of DataLakeFileSystemClient from url and credential.\n *\n * @param url - A Client string pointing to Azure Storage data lake file system, such as\n * \"https://myaccount.dfs.core.windows.net/filesystem\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net/filesystem?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | 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?: StoragePipelineOptions\n );\n\n /**\n * Creates an instance of DataLakeFileSystemClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake file system, such as\n * \"https://myaccount.dfs.core.windows.net/filesystem\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net/filesystem?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline);\n\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\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?: StoragePipelineOptions\n ) {\n if (credentialOrPipeline instanceof Pipeline) {\n super(url, credentialOrPipeline);\n } else {\n let credential;\n if (credentialOrPipeline === undefined) {\n credential = new AnonymousCredential();\n } else {\n credential = credentialOrPipeline;\n }\n\n const pipeline = newPipeline(credential, options);\n super(url, pipeline);\n }\n\n this.fileSystemContext = new FileSystem(this.storageClientContext);\n this.fileSystemContextToBlobEndpoint = new FileSystem(this.storageClientContextToBlobEndpoint);\n this.blobContainerClient = new ContainerClient(this.blobEndpointUrl, this.pipeline);\n }\n\n /**\n * Name of current file system.\n *\n * @readonly\n */\n public get name(): string {\n return this.blobContainerClient.containerName;\n }\n\n /**\n * Creates a {@link DataLakeDirectoryClient} object under current file system.\n *\n * @param directoryName -\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-subclients */\n public getDirectoryClient(directoryName: string): DataLakeDirectoryClient {\n return new DataLakeDirectoryClient(\n appendToURLPath(this.url, encodeURIComponent(directoryName)),\n this.pipeline\n );\n }\n\n /**\n * Creates a {@link DataLakeFileClient} object under current file system.\n *\n * @param fileName -\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-subclients */\n public getFileClient(fileName: string): DataLakeFileClient {\n return new DataLakeFileClient(\n appendToURLPath(this.url, encodeURIComponent(fileName)),\n this.pipeline\n );\n }\n\n /**\n * Get a {@link DataLakeLeaseClient} that manages leases on the file system.\n *\n * @param proposeLeaseId - Optional. Initial proposed lease Id.\n */\n public getDataLakeLeaseClient(proposeLeaseId?: string): DataLakeLeaseClient {\n return new DataLakeLeaseClient(this.blobContainerClient.getBlobLeaseClient(proposeLeaseId));\n }\n\n /**\n * Creates a new file system under the specified account. If the file system with\n * the same name already exists, the operation fails.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n *\n * @param options - Optional. Options when creating file system.\n */\n public async create(options: FileSystemCreateOptions = {}): Promise<FileSystemCreateResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-create\", options);\n try {\n return await this.blobContainerClient.create({\n ...options,\n access: toContainerPublicAccessType(options.access),\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new file system under the specified account. If the file system with\n * the same name already exists, it is not changed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n *\n * @param options -\n */\n public async createIfNotExists(\n options: FileSystemCreateOptions = {}\n ): Promise<FileSystemCreateIfNotExistsResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-createIfNotExists\",\n options\n );\n try {\n return await this.blobContainerClient.createIfNotExists({\n ...options,\n access: toContainerPublicAccessType(options.access),\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns true if the File system represented by this client exists; false otherwise.\n *\n * NOTE: use this function with care since an existing file system might be deleted by other clients or\n * applications. Vice versa new file system with the same name might be added by other clients or\n * applications after this function completes.\n *\n * @param options -\n */\n public async exists(options: FileSystemExistsOptions = {}): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-exists\", options);\n try {\n return await this.blobContainerClient.exists(updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Delete current file system.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container\n *\n * @param options - Optional. Options when deleting file system.\n */\n public async delete(options: FileSystemDeleteOptions = {}): Promise<FileSystemDeleteResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-delete\", options);\n try {\n return await this.blobContainerClient.delete({\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Delete current file system if it exists.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container\n *\n * @param options -\n */\n public async deleteIfExists(\n options: FileSystemDeleteOptions = {}\n ): Promise<FileSystemDeleteIfExistsResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-deleteIfExists\", options);\n try {\n return await this.blobContainerClient.deleteIfExists(updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns all user-defined metadata and system properties for the specified\n * file system.\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listFileSystems` method of {@link DataLakeServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties\n *\n * @param options - Optional. Options when getting file system properties.\n */\n public async getProperties(\n options: FileSystemGetPropertiesOptions = {}\n ): Promise<FileSystemGetPropertiesResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-getProperties\", options);\n try {\n const rawResponse = await this.blobContainerClient.getProperties({\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n // Transfer and rename blobPublicAccess to publicAccess\n const response = rawResponse as FileSystemGetPropertiesResponse;\n\n response.publicAccess = toPublicAccessType(rawResponse.blobPublicAccess);\n response._response.parsedHeaders.publicAccess = response.publicAccess;\n\n delete rawResponse.blobPublicAccess;\n delete rawResponse._response.parsedHeaders.blobPublicAccess;\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets one or more user-defined name-value pairs for the specified file system.\n *\n * If no option provided, or no metadata defined in the parameter, the file system\n * metadata will be removed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata\n *\n * @param metadata - Replace existing metadata with this value.\n * If no value provided the existing metadata will be removed.\n * @param options - Optional. Options when setting file system metadata.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: FileSystemSetMetadataOptions = {}\n ): Promise<FileSystemSetMetadataResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-setMetadata\", options);\n try {\n return await this.blobContainerClient.setMetadata(metadata, {\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Gets the permissions for the specified file system. The permissions indicate\n * whether file system data may be accessed publicly.\n *\n * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl\n *\n * @param options - Optional. Options when getting file system access policy.\n */\n public async getAccessPolicy(\n options: FileSystemGetAccessPolicyOptions = {}\n ): Promise<FileSystemGetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-getAccessPolicy\",\n options\n );\n try {\n const rawResponse = await this.blobContainerClient.getAccessPolicy({\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n // Transfer and rename blobPublicAccess to publicAccess\n const response = rawResponse as unknown as FileSystemGetAccessPolicyResponse;\n\n response.publicAccess = toPublicAccessType(rawResponse.blobPublicAccess);\n response._response.parsedHeaders.publicAccess = response.publicAccess;\n\n delete rawResponse.blobPublicAccess;\n delete rawResponse._response.parsedHeaders.blobPublicAccess;\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets the permissions for the specified file system. The permissions indicate\n * whether directories or files in a file system may be accessed publicly.\n *\n * When you set permissions for a file system, the existing permissions are replaced.\n * If no access or containerAcl provided, the existing file system ACL will be\n * removed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl\n *\n * @param access - Optional. The level of public access to data in the file system.\n * @param fileSystemAcl - Optional. Array of elements each having a unique Id and details of the access policy.\n * @param options - Optional. Options when setting file system access policy.\n */\n public async setAccessPolicy(\n access?: PublicAccessType,\n fileSystemAcl?: SignedIdentifier<AccessPolicy>[],\n options: FileSystemSetAccessPolicyOptions = {}\n ): Promise<FileSystemSetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-setAccessPolicy\",\n options\n );\n try {\n return await this.blobContainerClient.setAccessPolicy(\n toContainerPublicAccessType(access),\n fileSystemAcl,\n {\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n }\n );\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the paths (directories and files)\n * under the specified file system.\n *\n * .byPage() returns an async iterable iterator to list the paths in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the fileSystemClient before you run these snippets,\n * // Can be obtained from `serviceClient.getFileSystemClient(\"<your-filesystem-name>\");`\n * let i = 1;\n * for await (const path of fileSystemClient.listPaths()) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = fileSystemClient.listPaths();\n * let pathItem = await iter.next();\n * while (!pathItem.done) {\n * console.log(`Path ${i++}: ${pathItem.value.name}, isDirectory?: ${pathItem.value.isDirectory}`);\n * pathItem = 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 fileSystemClient.listPaths().byPage({ maxPageSize: 20 })) {\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = fileSystemClient.listPaths().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 path names\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = fileSystemClient.listPaths().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 path names\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);\n * }\n * ```\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs\n *\n * @param options - Optional. Options when listing paths.\n */\n public listPaths(\n options: ListPathsOptions = {}\n ): PagedAsyncIterableIterator<Path, FileSystemListPathsResponse> {\n options.path = options.path === \"\" ? undefined : options.path;\n\n const iter = this.listItems(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(settings.continuationToken, {\n maxResults: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n\n private async *listItems(options: ListPathsSegmentOptions = {}): AsyncIterableIterator<Path> {\n for await (const response of this.listSegments(undefined, options)) {\n yield* response.pathItems || [];\n }\n }\n\n private async *listSegments(\n continuation?: string,\n options: ListPathsSegmentOptions = {}\n ): AsyncIterableIterator<FileSystemListPathsResponse> {\n let response;\n if (!!continuation || continuation === undefined) {\n do {\n response = await this.listPathsSegment(continuation, options);\n continuation = response.continuation;\n yield response;\n } while (continuation);\n }\n }\n\n private async listPathsSegment(\n continuation?: string,\n options: ListPathsSegmentOptions = {}\n ): Promise<FileSystemListPathsResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-listPathsSegment\",\n options\n );\n try {\n const rawResponse = await this.fileSystemContext.listPaths(options.recursive || false, {\n continuation,\n ...options,\n upn: options.userPrincipalName,\n ...convertTracingToRequestOptionsBase(updatedOptions),\n });\n\n const response = rawResponse as FileSystemListPathsResponse;\n response.pathItems = [];\n for (const path of rawResponse.paths || []) {\n response.pathItems.push({\n ...path,\n permissions: toPermissions(path.permissions),\n createdOn: windowsFileTimeTicksToTime(path.creationTime),\n expiresOn: windowsFileTimeTicksToTime(path.expiryTime),\n });\n }\n delete rawResponse.paths;\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the paths (directories and files)\n * under the specified file system.\n *\n * .byPage() returns an async iterable iterator to list the paths in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the fileSystemClient before you run these snippets,\n * // Can be obtained from `serviceClient.getFileSystemClient(\"<your-filesystem-name>\");`\n * let i = 1;\n * for await (const deletePath of fileSystemClient.listDeletedPaths()) {\n * console.log(`Path ${i++}: ${deletePath.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = fileSystemClient.listDeletedPaths();\n * let deletedPathItem = await iter.next();\n * while (!deletedPathItem.done) {\n * console.log(`Path ${i++}: ${deletedPathItem.value.name}`);\n * pathItem = 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 fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 20 })) {\n * for (const deletePath of response.pathItems) {\n * console.log(`Path ${i++}: ${deletePath.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 path names\n * for (const path of response.pathItems) {\n * console.log(`Path ${i++}: ${path.name}}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = fileSystemClient.listDeletedPaths().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 path names\n * for (const deletePath of response.deletedPathItems) {\n * console.log(`Path ${i++}: ${deletePath.name}`);\n * }\n * ```\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs\n *\n * @param options - Optional. Options when listing deleted paths.\n */\n public listDeletedPaths(\n options: ListDeletedPathsOptions = {}\n ): PagedAsyncIterableIterator<DeletedPath, FileSystemListDeletedPathsResponse> {\n const iter = this.listDeletedItems(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => {\n return this.listDeletedSegments(settings.continuationToken, {\n maxResults: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n private async *listDeletedItems(\n options: ListDeletedPathsOptions = {}\n ): AsyncIterableIterator<DeletedPath> {\n for await (const response of this.listDeletedSegments(undefined, options)) {\n yield* response.pathItems || [];\n }\n }\n\n private async *listDeletedSegments(\n continuation?: string,\n options: ListDeletedPathsSegmentOptions = {}\n ): AsyncIterableIterator<FileSystemListDeletedPathsResponse> {\n let response;\n if (!!continuation || continuation === undefined) {\n do {\n response = await this.listDeletedPathsSegment(continuation, options);\n continuation = response.continuation;\n yield response;\n } while (continuation);\n }\n }\n\n private async listDeletedPathsSegment(\n continuation?: string,\n options: ListDeletedPathsSegmentOptions = {}\n ): Promise<FileSystemListDeletedPathsResponse> {\n const { span, updatedOptions } = createSpan(\n \"DataLakeFileSystemClient-listDeletedPathsSegment\",\n options\n );\n try {\n const rawResponse = await this.fileSystemContextToBlobEndpoint.listBlobHierarchySegment({\n marker: continuation,\n ...options,\n prefix: options.prefix === \"\" ? undefined : options.prefix,\n ...convertTracingToRequestOptionsBase(updatedOptions),\n });\n\n const response = rawResponse as FileSystemListDeletedPathsResponse;\n response.pathItems = [];\n for (const path of rawResponse.segment.blobItems || []) {\n response.pathItems.push({\n name: path.name,\n deletionId: path.deletionId,\n deletedOn: path.properties.deletedTime,\n remainingRetentionDays: path.properties.remainingRetentionDays,\n });\n }\n\n if (!(response.nextMarker === undefined || response.nextMarker === \"\")) {\n response.continuation = response.nextMarker;\n }\n\n return response;\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Restores a soft deleted path.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob\n *\n * @param deletedPath - Required. The path of the deleted path.\n *\n * @param deletionId - Required. The deletion ID associated with the soft deleted path.\n *\n */\n\n public async undeletePath(\n deletedPath: string,\n deletionId: string,\n options: FileSystemUndeletePathOption = {}\n ): Promise<FileSystemUndeletePathResponse> {\n const { span, updatedOptions } = createSpan(\"DataLakeFileSystemClient-undeletePath\", options);\n try {\n const pathClient = new PathClientInternal(\n appendToURLPath(this.blobEndpointUrl, encodeURIComponent(deletedPath)),\n this.pipeline\n );\n\n const rawResponse = await pathClient.blobPathContext.undelete({\n undeleteSource: \"?\" + DeletionIdKey + \"=\" + deletionId,\n ...options,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n if (rawResponse.resourceType === PathResultTypeConstants.DirectoryResourceType) {\n return {\n pathClient: this.getDirectoryClient(deletedPath),\n ...rawResponse,\n };\n } else {\n return {\n pathClient: this.getFileClient(deletedPath),\n ...rawResponse,\n };\n }\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Only available for DataLakeFileSystemClient constructed with a shared key credential.\n *\n * Generates a Service 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/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: FileSystemGenerateSasUrlOptions): Promise<string> {\n return new Promise((resolve) => {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\"\n );\n }\n\n const sas = generateDataLakeSASQueryParameters(\n {\n fileSystemName: this.name,\n ...options,\n },\n this.credential\n ).toString();\n\n resolve(appendToURLQuery(this.url, sas));\n });\n }\n}\n"]}
|
|
@@ -11,12 +11,12 @@ import { Path } from "./generated/src/operations";
|
|
|
11
11
|
import { newPipeline, Pipeline } from "./Pipeline";
|
|
12
12
|
import { generateDataLakeSASQueryParameters } from "./sas/DataLakeSASSignatureValues";
|
|
13
13
|
import { StorageClient } from "./StorageClient";
|
|
14
|
-
import { toAccessControlChangeFailureArray, toAclString, toPathGetAccessControlResponse, toPermissionsString, toProperties, } from "./transforms";
|
|
14
|
+
import { toAccessControlChangeFailureArray, toAclString, toBlobCpkInfo, toPathGetAccessControlResponse, toPermissionsString, toProperties, } from "./transforms";
|
|
15
15
|
import { Batch } from "./utils/Batch";
|
|
16
16
|
import { BLOCK_BLOB_MAX_BLOCKS, DEFAULT_HIGH_LEVEL_CONCURRENCY, ETagAny, FILE_MAX_SINGLE_UPLOAD_THRESHOLD, FILE_MAX_SIZE_BYTES, FILE_UPLOAD_DEFAULT_CHUNK_SIZE, FILE_UPLOAD_MAX_CHUNK_SIZE, } from "./utils/constants";
|
|
17
17
|
import { DataLakeAclChangeFailedError } from "./utils/DataLakeAclChangeFailedError";
|
|
18
18
|
import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing";
|
|
19
|
-
import { appendToURLPath, appendToURLQuery, getURLPathAndQuery, setURLPath, setURLQueries, } from "./utils/utils.common";
|
|
19
|
+
import { appendToURLPath, appendToURLQuery, ensureCpkIfSpecified, getURLPathAndQuery, setURLPath, setURLQueries, } from "./utils/utils.common";
|
|
20
20
|
import { fsCreateReadStream, fsStat } from "./utils/utils.node";
|
|
21
21
|
/**
|
|
22
22
|
* A DataLakePathClient represents a URL to the Azure Storage path (directory or file).
|
|
@@ -171,7 +171,8 @@ export class DataLakePathClient extends StorageClient {
|
|
|
171
171
|
options.conditions = options.conditions || {};
|
|
172
172
|
const { span, updatedOptions } = createSpan("DataLakePathClient-create", options);
|
|
173
173
|
try {
|
|
174
|
-
|
|
174
|
+
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
|
175
|
+
return await this.pathContext.create(Object.assign(Object.assign(Object.assign({}, options), { resource: resourceType, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, properties: toProperties(options.metadata), cpkInfo: options.customerProvidedKey }), convertTracingToRequestOptionsBase(updatedOptions)));
|
|
175
176
|
}
|
|
176
177
|
catch (e) {
|
|
177
178
|
span.setStatus({
|
|
@@ -230,7 +231,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
230
231
|
async exists(options = {}) {
|
|
231
232
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-exists", options);
|
|
232
233
|
try {
|
|
233
|
-
return await this.blobClient.exists(updatedOptions);
|
|
234
|
+
return await this.blobClient.exists(Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey) }));
|
|
234
235
|
}
|
|
235
236
|
catch (e) {
|
|
236
237
|
span.setStatus({
|
|
@@ -473,7 +474,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
473
474
|
async getProperties(options = {}) {
|
|
474
475
|
const { span, updatedOptions } = createSpan("DataLakePathClient-getProperties", options);
|
|
475
476
|
try {
|
|
476
|
-
return await this.blobClient.getProperties(Object.assign(Object.assign({}, options), { customerProvidedKey:
|
|
477
|
+
return await this.blobClient.getProperties(Object.assign(Object.assign({}, options), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
|
|
477
478
|
}
|
|
478
479
|
catch (e) {
|
|
479
480
|
span.setStatus({
|
|
@@ -534,7 +535,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
534
535
|
async setMetadata(metadata, options = {}) {
|
|
535
536
|
const { span, updatedOptions } = createSpan("DataLakePathClient-setMetadata", options);
|
|
536
537
|
try {
|
|
537
|
-
return await this.blobClient.setMetadata(metadata, Object.assign(Object.assign({}, options), { customerProvidedKey:
|
|
538
|
+
return await this.blobClient.setMetadata(metadata, Object.assign(Object.assign({}, options), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
|
|
538
539
|
}
|
|
539
540
|
catch (e) {
|
|
540
541
|
span.setStatus({
|
|
@@ -816,7 +817,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
816
817
|
async read(offset = 0, count, options = {}) {
|
|
817
818
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-read", options);
|
|
818
819
|
try {
|
|
819
|
-
const rawResponse = await this.blockBlobClientInternal.download(offset, count, updatedOptions);
|
|
820
|
+
const rawResponse = await this.blockBlobClientInternal.download(offset, count, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey) }));
|
|
820
821
|
const response = rawResponse;
|
|
821
822
|
if (!isNode && !response.contentAsBlob) {
|
|
822
823
|
response.contentAsBlob = rawResponse.blobBody;
|
|
@@ -854,11 +855,12 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
854
855
|
options.conditions = options.conditions || {};
|
|
855
856
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-append", options);
|
|
856
857
|
try {
|
|
858
|
+
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
|
857
859
|
return await this.pathContextInternal.appendData(body, Object.assign({ pathHttpHeaders: {
|
|
858
860
|
contentMD5: options.transactionalContentMD5,
|
|
859
861
|
}, abortSignal: options.abortSignal, position: offset, contentLength: length, leaseAccessConditions: options.conditions, requestOptions: {
|
|
860
862
|
onUploadProgress: options.onProgress,
|
|
861
|
-
} }, convertTracingToRequestOptionsBase(updatedOptions)));
|
|
863
|
+
}, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));
|
|
862
864
|
}
|
|
863
865
|
catch (e) {
|
|
864
866
|
span.setStatus({
|
|
@@ -887,7 +889,8 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
887
889
|
options.conditions = options.conditions || {};
|
|
888
890
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-flush", options);
|
|
889
891
|
try {
|
|
890
|
-
|
|
892
|
+
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
|
893
|
+
return await this.pathContextInternal.flushData(Object.assign(Object.assign(Object.assign({}, options), { position, contentLength: 0, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey }), convertTracingToRequestOptionsBase(updatedOptions)));
|
|
891
894
|
}
|
|
892
895
|
catch (e) {
|
|
893
896
|
span.setStatus({
|
|
@@ -989,6 +992,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
989
992
|
umask: options.umask,
|
|
990
993
|
conditions: options.conditions,
|
|
991
994
|
pathHttpHeaders: options.pathHttpHeaders,
|
|
995
|
+
customerProvidedKey: updatedOptions.customerProvidedKey,
|
|
992
996
|
tracingOptions: updatedOptions.tracingOptions,
|
|
993
997
|
});
|
|
994
998
|
// append() with empty data would return error, so do not continue
|
|
@@ -1027,6 +1031,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1027
1031
|
await this.append(bodyFactory(0, size), 0, size, {
|
|
1028
1032
|
abortSignal: options.abortSignal,
|
|
1029
1033
|
conditions: options.conditions,
|
|
1034
|
+
customerProvidedKey: updatedOptions.customerProvidedKey,
|
|
1030
1035
|
onProgress: options.onProgress,
|
|
1031
1036
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1032
1037
|
});
|
|
@@ -1035,6 +1040,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1035
1040
|
conditions: options.conditions,
|
|
1036
1041
|
close: options.close,
|
|
1037
1042
|
pathHttpHeaders: options.pathHttpHeaders,
|
|
1043
|
+
customerProvidedKey: updatedOptions.customerProvidedKey,
|
|
1038
1044
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1039
1045
|
});
|
|
1040
1046
|
}
|
|
@@ -1053,6 +1059,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1053
1059
|
await this.append(bodyFactory(start, contentLength), start, contentLength, {
|
|
1054
1060
|
abortSignal: options.abortSignal,
|
|
1055
1061
|
conditions: options.conditions,
|
|
1062
|
+
customerProvidedKey: updatedOptions.customerProvidedKey,
|
|
1056
1063
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1057
1064
|
});
|
|
1058
1065
|
transferProgress += contentLength;
|
|
@@ -1067,6 +1074,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1067
1074
|
conditions: options.conditions,
|
|
1068
1075
|
close: options.close,
|
|
1069
1076
|
pathHttpHeaders: options.pathHttpHeaders,
|
|
1077
|
+
customerProvidedKey: updatedOptions.customerProvidedKey,
|
|
1070
1078
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1071
1079
|
});
|
|
1072
1080
|
}
|
|
@@ -1108,6 +1116,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1108
1116
|
umask: options.umask,
|
|
1109
1117
|
conditions: options.conditions,
|
|
1110
1118
|
pathHttpHeaders: options.pathHttpHeaders,
|
|
1119
|
+
customerProvidedKey: options.customerProvidedKey,
|
|
1111
1120
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1112
1121
|
});
|
|
1113
1122
|
// After the File is Create, Lease ID is the only valid request parameter.
|
|
@@ -1129,6 +1138,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1129
1138
|
await this.append(body, offset, length, {
|
|
1130
1139
|
abortSignal: options.abortSignal,
|
|
1131
1140
|
conditions: options.conditions,
|
|
1141
|
+
customerProvidedKey: options.customerProvidedKey,
|
|
1132
1142
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1133
1143
|
});
|
|
1134
1144
|
// Update progress after block is successfully uploaded to server, in case of block trying
|
|
@@ -1148,6 +1158,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1148
1158
|
conditions: options.conditions,
|
|
1149
1159
|
close: options.close,
|
|
1150
1160
|
pathHttpHeaders: options.pathHttpHeaders,
|
|
1161
|
+
customerProvidedKey: options.customerProvidedKey,
|
|
1151
1162
|
tracingOptions: updatedOptions.tracingOptions,
|
|
1152
1163
|
});
|
|
1153
1164
|
}
|
|
@@ -1180,10 +1191,10 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1180
1191
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-readToBuffer", options);
|
|
1181
1192
|
try {
|
|
1182
1193
|
if (buffer) {
|
|
1183
|
-
return await this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, tracingOptions: updatedOptions.tracingOptions }));
|
|
1194
|
+
return await this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
|
|
1184
1195
|
}
|
|
1185
1196
|
else {
|
|
1186
|
-
return await this.blockBlobClientInternal.downloadToBuffer(offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, tracingOptions: updatedOptions.tracingOptions }));
|
|
1197
|
+
return await this.blockBlobClientInternal.downloadToBuffer(offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
|
|
1187
1198
|
}
|
|
1188
1199
|
}
|
|
1189
1200
|
catch (e) {
|
|
@@ -1216,7 +1227,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1216
1227
|
async readToFile(filePath, offset = 0, count, options = {}) {
|
|
1217
1228
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-readToFile", options);
|
|
1218
1229
|
try {
|
|
1219
|
-
return await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, updatedOptions);
|
|
1230
|
+
return await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey) }));
|
|
1220
1231
|
}
|
|
1221
1232
|
catch (e) {
|
|
1222
1233
|
span.setStatus({
|
|
@@ -1260,7 +1271,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1260
1271
|
async query(query, options = {}) {
|
|
1261
1272
|
const { span, updatedOptions } = createSpan("DataLakeFileClient-query", options);
|
|
1262
1273
|
try {
|
|
1263
|
-
const rawResponse = await this.blockBlobClientInternal.query(query, updatedOptions);
|
|
1274
|
+
const rawResponse = await this.blockBlobClientInternal.query(query, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey) }));
|
|
1264
1275
|
const response = rawResponse;
|
|
1265
1276
|
if (!isNode && !response.contentAsBlob) {
|
|
1266
1277
|
response.contentAsBlob = rawResponse.blobBody;
|