@azure/storage-file-datalake 12.25.0-beta.1 → 12.25.0
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 +2 -10
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/cache.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/DataLakeFileSystemClient.js +0 -1
- package/dist-esm/storage-file-datalake/src/DataLakeFileSystemClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/DataLakeLeaseClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/DataLakeServiceClient.js +1 -2
- package/dist-esm/storage-file-datalake/src/DataLakeServiceClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/Pipeline.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/StorageClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/StorageContextClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/clients.js +0 -4
- package/dist-esm/storage-file-datalake/src/clients.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/storageClient.js +1 -1
- package/dist-esm/storage-file-datalake/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/models.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/sas/SASQueryParameters.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/transforms.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/BufferScheduler.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/PathClientInternal.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/constants.js +1 -1
- package/dist-esm/storage-file-datalake/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-file-datalake/src/utils/utils.common.js +0 -2
- package/dist-esm/storage-file-datalake/src/utils/utils.common.js.map +1 -1
- package/package.json +4 -8
- package/types/latest/storage-file-datalake.d.ts +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataLakeServiceClient.js","sourceRoot":"","sources":["../../../src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,EAAE,GAAG,CAAC,yBAAyB;aAC1D,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,aAAa,CACxB,UAAuC,EAAE;QAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qCAAqC,EACrC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;gBAC1C,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,aAAa,CACxB,UAAqC,EACrC,UAAuC,EAAE;QAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qCAAqC,EACrC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACtD,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\nimport { isNode } from \"@azure/core-util\";\nimport {\n BlobServiceClient,\n ServiceGetPropertiesOptions,\n ServiceSetPropertiesOptions,\n ServiceSetPropertiesResponse,\n} from \"@azure/storage-blob\";\nimport { Pipeline, StoragePipelineOptions, isPipelineLike, newPipeline } from \"./Pipeline\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\n\nimport { DataLakeFileSystemClient } from \"./DataLakeFileSystemClient\";\nimport {\n FileSystemItem,\n FileSystemRenameResponse,\n ServiceGenerateAccountSasUrlOptions,\n ServiceListFileSystemsOptions,\n ServiceListFileSystemsSegmentResponse,\n ServiceRenameFileSystemOptions,\n ServiceUndeleteFileSystemOptions,\n FileSystemUndeleteResponse,\n} from \"./models\";\nimport { StorageClient } from \"./StorageClient\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n extractConnectionStringParts,\n} from \"./utils/utils.common\";\nimport { toDfsEndpointUrl, toFileSystemPagedAsyncIterableIterator } from \"./transforms\";\nimport { ServiceGetUserDelegationKeyOptions, ServiceGetUserDelegationKeyResponse } from \"./models\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { AccountSASPermissions } from \"./sas/AccountSASPermissions\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./sas/AccountSASSignatureValues\";\nimport { AccountSASServices } from \"./sas/AccountSASServices\";\nimport { DataLakeServiceGetPropertiesResponse, DataLakeServiceProperties } from \"./index\";\n\n/**\n * DataLakeServiceClient allows you to manipulate Azure\n * Data Lake service resources and file systems. The storage account provides\n * the top-level namespace for the Data Lake service.\n */\nexport class DataLakeServiceClient extends StorageClient {\n // private serviceContext: Service;\n\n /**\n * blobServiceClient provided by `@azure/storage-blob` package.\n */\n private blobServiceClient: BlobServiceClient;\n\n /**\n *\n * Creates an instance of DataLakeServiceClient 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 - 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 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?: StoragePipelineOptions,\n ): DataLakeServiceClient {\n options = options || {};\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 if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new DataLakeServiceClient(toDfsEndpointUrl(extractedCreds.url), pipeline);\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 DataLakeServiceClient(\n toDfsEndpointUrl(extractedCreds.url) + \"?\" + extractedCreds.accountSas,\n pipeline,\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 DataLakeServiceClient from url.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?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 public 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 DataLakeServiceClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n public constructor(url: string, pipeline: Pipeline);\n\n public 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 (isPipelineLike(credentialOrPipeline)) {\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.serviceContext = new Service(this.storageClientContext);\n this.blobServiceClient = new BlobServiceClient(this.blobEndpointUrl, this.pipeline);\n }\n\n /**\n * Creates a {@link DataLakeFileSystemClient} object.\n *\n * @param fileSystemName - File system name.\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 getFileSystemClient(fileSystemName: string): DataLakeFileSystemClient {\n return new DataLakeFileSystemClient(\n appendToURLPath(this.url, encodeURIComponent(fileSystemName)),\n this.pipeline,\n );\n }\n\n /**\n * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).\n *\n * Retrieves a user delegation key for the Data Lake service. This is only a valid operation when using\n * bearer token authentication.\n *\n * @example\n * ```js\n * // Generate user delegation SAS for a file system\n * const userDelegationKey = await dataLakeServiceClient.getUserDelegationKey(startsOn, expiresOn);\n * const fileSystemSAS = generateDataLakeSASQueryParameters({\n * fileSystemName, // Required\n * permissions: FileSystemSASPermissions.parse(\"racwdl\"), // Required\n * startsOn, // Required. Date type\n * expiresOn, // Optional. Date type\n * ipRange: { start: \"0.0.0.0\", end: \"255.255.255.255\" }, // Optional\n * protocol: SASProtocol.HttpsAndHttp, // Optional\n * version: \"2018-11-09\" // Must greater than or equal to 2018-11-09 to generate user delegation SAS\n * },\n * userDelegationKey, // UserDelegationKey\n * accountName\n * ).toString();\n * ```\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key\n *\n * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time.\n * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time.\n * @param options -\n */\n public async getUserDelegationKey(\n startsOn: Date,\n expiresOn: Date,\n options: ServiceGetUserDelegationKeyOptions = {},\n ): Promise<ServiceGetUserDelegationKeyResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getUserDelegationKey\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getUserDelegationKey(startsOn, expiresOn, updatedOptions);\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list all the file systems\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the file systems in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const fileSystem of serviceClient.listFileSystems()) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * const iter = serviceClient.listFileSystems();\n * let fileSystemItem = await iter.next();\n * while (!fileSystemItem.done) {\n * console.log(`FileSystem ${i++}: ${fileSystemItem.value.name}`);\n * fileSystemItem = 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.listFileSystems().byPage({ maxPageSize: 20 })) {\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = serviceClient.listFileSystems().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 file system names\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = serviceClient\n * .listContainers()\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 file system names\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * }\n * ```\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2\n *\n * @param options -\n */\n public listFileSystems(\n options: ServiceListFileSystemsOptions = {},\n ): PagedAsyncIterableIterator<FileSystemItem, ServiceListFileSystemsSegmentResponse> {\n return toFileSystemPagedAsyncIterableIterator(this.blobServiceClient.listContainers(options));\n }\n\n // public async createFileSystem(): Promise<DataLakeFileSystemClient> {\n // throw Error(\"NotImplemented\");\n // }\n\n // public async deleteFileSystem(fileSystem: string): Promise<ServiceDeleteFileSystemResponse> {\n // throw Error(\"NotImplemented\");\n // }\n\n /**\n * Only available for DataLakeServiceClient 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(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for DataLakeServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) 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 generateSasStringToSign(\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 return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * Renames an existing File System.\n *\n * @param sourceFileSystemName - The name of the source File System.\n * @param destinationContainerName - The new name of the File System.\n * @param options - Options to configure File System Rename operation.\n */\n /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */\n // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready.\n private async renameFileSystem(\n sourceFileSystemName: string,\n destinationFileSystemName: string,\n options: ServiceRenameFileSystemOptions = {},\n ): Promise<{\n fileSystemClient: DataLakeFileSystemClient;\n fileSystemRenameResponse: FileSystemRenameResponse;\n }> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-renameFileSystem\",\n options,\n async (updatedOptions) => {\n const res = await this.blobServiceClient[\"renameContainer\"](\n sourceFileSystemName,\n destinationFileSystemName,\n updatedOptions,\n );\n\n const fileSystemClient = this.getFileSystemClient(destinationFileSystemName);\n return {\n fileSystemClient,\n fileSystemRenameResponse: res.containerRenameResponse,\n };\n },\n );\n }\n\n /**\n * Restore a previously deleted File System.\n * This API is only functional if Container Soft Delete is enabled for the storage account.\n *\n * @param deletedFileSystemName - The name of the source File System.\n * @param deleteFileSystemVersion - The new name of the File System.\n * @param options - Options to configure File System Restore operation.\n */\n public async undeleteFileSystem(\n deletedFileSystemName: string,\n deleteFileSystemVersion: string,\n options: ServiceUndeleteFileSystemOptions = {},\n ): Promise<{\n fileSystemClient: DataLakeFileSystemClient;\n fileSystemUndeleteResponse: FileSystemUndeleteResponse;\n }> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-undeleteFileSystem\",\n options,\n async (updatedOptions) => {\n const res = await this.blobServiceClient.undeleteContainer(\n deletedFileSystemName,\n deleteFileSystemVersion,\n {\n ...options,\n destinationContainerName: options.destinationFileSystemName,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n\n const fileSystemClient = this.getFileSystemClient(\n options.destinationFileSystemName || deletedFileSystemName,\n );\n return {\n fileSystemClient,\n fileSystemUndeleteResponse: res.containerUndeleteResponse,\n };\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s Blob service endpoint, 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-blob-service-properties\n *\n * @param options - Options to the Service Get Properties operation.\n * @returns Response data for the Service Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<DataLakeServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getProperties({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s Blob 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-blob-service-properties\n *\n * @param properties -\n * @param options - Options to the Service Set Properties operation.\n * @returns Response data for the Service Set Properties operation.\n */\n public async setProperties(\n properties: DataLakeServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.setProperties(properties, {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DataLakeServiceClient.js","sourceRoot":"","sources":["../../../src/DataLakeServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEt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IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,aAAa,CACxB,UAAqC,EACrC,UAAuC,EAAE;QAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qCAAqC,EACrC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACtD,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\nimport { isNode } from \"@azure/core-util\";\nimport type {\n ServiceGetPropertiesOptions,\n ServiceSetPropertiesOptions,\n ServiceSetPropertiesResponse,\n} from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { Pipeline, StoragePipelineOptions } from \"./Pipeline\";\nimport { isPipelineLike, newPipeline } from \"./Pipeline\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\n\nimport { DataLakeFileSystemClient } from \"./DataLakeFileSystemClient\";\nimport type {\n FileSystemItem,\n FileSystemRenameResponse,\n ServiceGenerateAccountSasUrlOptions,\n ServiceListFileSystemsOptions,\n ServiceListFileSystemsSegmentResponse,\n ServiceRenameFileSystemOptions,\n ServiceUndeleteFileSystemOptions,\n FileSystemUndeleteResponse,\n} from \"./models\";\nimport { StorageClient } from \"./StorageClient\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n extractConnectionStringParts,\n} from \"./utils/utils.common\";\nimport { toDfsEndpointUrl, toFileSystemPagedAsyncIterableIterator } from \"./transforms\";\nimport type {\n ServiceGetUserDelegationKeyOptions,\n ServiceGetUserDelegationKeyResponse,\n} from \"./models\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { AccountSASPermissions } from \"./sas/AccountSASPermissions\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./sas/AccountSASSignatureValues\";\nimport { AccountSASServices } from \"./sas/AccountSASServices\";\nimport type { DataLakeServiceGetPropertiesResponse, DataLakeServiceProperties } from \"./index\";\n\n/**\n * DataLakeServiceClient allows you to manipulate Azure\n * Data Lake service resources and file systems. The storage account provides\n * the top-level namespace for the Data Lake service.\n */\nexport class DataLakeServiceClient extends StorageClient {\n // private serviceContext: Service;\n\n /**\n * blobServiceClient provided by `@azure/storage-blob` package.\n */\n private blobServiceClient: BlobServiceClient;\n\n /**\n *\n * Creates an instance of DataLakeServiceClient 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 - 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\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?: StoragePipelineOptions,\n ): DataLakeServiceClient {\n options = options || {};\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 if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new DataLakeServiceClient(toDfsEndpointUrl(extractedCreds.url), pipeline);\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 DataLakeServiceClient(\n toDfsEndpointUrl(extractedCreds.url) + \"?\" + extractedCreds.accountSas,\n pipeline,\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 DataLakeServiceClient from url.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?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 public 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 DataLakeServiceClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n public constructor(url: string, pipeline: Pipeline);\n\n public 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 (isPipelineLike(credentialOrPipeline)) {\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.serviceContext = new Service(this.storageClientContext);\n this.blobServiceClient = new BlobServiceClient(this.blobEndpointUrl, this.pipeline);\n }\n\n /**\n * Creates a {@link DataLakeFileSystemClient} object.\n *\n * @param fileSystemName - File system name.\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 getFileSystemClient(fileSystemName: string): DataLakeFileSystemClient {\n return new DataLakeFileSystemClient(\n appendToURLPath(this.url, encodeURIComponent(fileSystemName)),\n this.pipeline,\n );\n }\n\n /**\n * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).\n *\n * Retrieves a user delegation key for the Data Lake service. This is only a valid operation when using\n * bearer token authentication.\n *\n * @example\n * ```js\n * // Generate user delegation SAS for a file system\n * const userDelegationKey = await dataLakeServiceClient.getUserDelegationKey(startsOn, expiresOn);\n * const fileSystemSAS = generateDataLakeSASQueryParameters({\n * fileSystemName, // Required\n * permissions: FileSystemSASPermissions.parse(\"racwdl\"), // Required\n * startsOn, // Required. Date type\n * expiresOn, // Optional. Date type\n * ipRange: { start: \"0.0.0.0\", end: \"255.255.255.255\" }, // Optional\n * protocol: SASProtocol.HttpsAndHttp, // Optional\n * version: \"2018-11-09\" // Must greater than or equal to 2018-11-09 to generate user delegation SAS\n * },\n * userDelegationKey, // UserDelegationKey\n * accountName\n * ).toString();\n * ```\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key\n *\n * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time.\n * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time.\n * @param options -\n */\n public async getUserDelegationKey(\n startsOn: Date,\n expiresOn: Date,\n options: ServiceGetUserDelegationKeyOptions = {},\n ): Promise<ServiceGetUserDelegationKeyResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getUserDelegationKey\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getUserDelegationKey(startsOn, expiresOn, updatedOptions);\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list all the file systems\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the file systems in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const fileSystem of serviceClient.listFileSystems()) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * const iter = serviceClient.listFileSystems();\n * let fileSystemItem = await iter.next();\n * while (!fileSystemItem.done) {\n * console.log(`FileSystem ${i++}: ${fileSystemItem.value.name}`);\n * fileSystemItem = 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.listFileSystems().byPage({ maxPageSize: 20 })) {\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = serviceClient.listFileSystems().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 file system names\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = serviceClient\n * .listContainers()\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 file system names\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`FileSystem ${i++}: ${fileSystem.name}`);\n * }\n * }\n * ```\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2\n *\n * @param options -\n */\n public listFileSystems(\n options: ServiceListFileSystemsOptions = {},\n ): PagedAsyncIterableIterator<FileSystemItem, ServiceListFileSystemsSegmentResponse> {\n return toFileSystemPagedAsyncIterableIterator(this.blobServiceClient.listContainers(options));\n }\n\n // public async createFileSystem(): Promise<DataLakeFileSystemClient> {\n // throw Error(\"NotImplemented\");\n // }\n\n // public async deleteFileSystem(fileSystem: string): Promise<ServiceDeleteFileSystemResponse> {\n // throw Error(\"NotImplemented\");\n // }\n\n /**\n * Only available for DataLakeServiceClient 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(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for DataLakeServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) 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 generateSasStringToSign(\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 return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * Renames an existing File System.\n *\n * @param sourceFileSystemName - The name of the source File System.\n * @param destinationContainerName - The new name of the File System.\n * @param options - Options to configure File System Rename operation.\n */\n /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */\n // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready.\n private async renameFileSystem(\n sourceFileSystemName: string,\n destinationFileSystemName: string,\n options: ServiceRenameFileSystemOptions = {},\n ): Promise<{\n fileSystemClient: DataLakeFileSystemClient;\n fileSystemRenameResponse: FileSystemRenameResponse;\n }> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-renameFileSystem\",\n options,\n async (updatedOptions) => {\n const res = await this.blobServiceClient[\"renameContainer\"](\n sourceFileSystemName,\n destinationFileSystemName,\n updatedOptions,\n );\n\n const fileSystemClient = this.getFileSystemClient(destinationFileSystemName);\n return {\n fileSystemClient,\n fileSystemRenameResponse: res.containerRenameResponse,\n };\n },\n );\n }\n\n /**\n * Restore a previously deleted File System.\n * This API is only functional if Container Soft Delete is enabled for the storage account.\n *\n * @param deletedFileSystemName - The name of the source File System.\n * @param deleteFileSystemVersion - The new name of the File System.\n * @param options - Options to configure File System Restore operation.\n */\n public async undeleteFileSystem(\n deletedFileSystemName: string,\n deleteFileSystemVersion: string,\n options: ServiceUndeleteFileSystemOptions = {},\n ): Promise<{\n fileSystemClient: DataLakeFileSystemClient;\n fileSystemUndeleteResponse: FileSystemUndeleteResponse;\n }> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-undeleteFileSystem\",\n options,\n async (updatedOptions) => {\n const res = await this.blobServiceClient.undeleteContainer(\n deletedFileSystemName,\n deleteFileSystemVersion,\n {\n ...options,\n destinationContainerName: options.destinationFileSystemName,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n\n const fileSystemClient = this.getFileSystemClient(\n options.destinationFileSystemName || deletedFileSystemName,\n );\n return {\n fileSystemClient,\n fileSystemUndeleteResponse: res.containerUndeleteResponse,\n };\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s Blob service endpoint, 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-blob-service-properties\n *\n * @param options - Options to the Service Get Properties operation.\n * @returns Response data for the Service Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<DataLakeServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getProperties({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s Blob 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-blob-service-properties\n *\n * @param properties -\n * @param options - Options to the Service Set Properties operation.\n * @returns Response data for the Service Set Properties operation.\n */\n public async setProperties(\n properties: DataLakeServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.setProperties(properties, {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../../src/Pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAUL,iBAAiB,EACjB,gCAAgC,GAEjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIL,+BAA+B,EAE/B,4BAA4B,GAG7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAuB,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,wCAAwC,EACxC,4CAA4C,EAC5C,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,oBAAoB,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AAyB;QACrD,GAAG,CAAC,SAA+B,EAAE,QAAgB;YACnD,gBAAgB;QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n RequestBodyType as HttpRequestBody,\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n bearerTokenAuthenticationPolicy,\n Pipeline as CorePipeline,\n decompressResponsePolicyName,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log\";\nimport { StorageRetryOptions, StorageRetryPolicyFactory } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport {\n StorageOAuthScopes,\n StorageDataLakeLoggingAllowedHeaderNames,\n StorageDataLakeLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants\";\nimport { getCachedDefaultHttpClient } from \"../../storage-blob/src/utils/cache\";\nimport { storageBrowserPolicy } from \"../../storage-blob/src/policies/StorageBrowserPolicyV2\";\nimport { storageRetryPolicy } from \"../../storage-blob/src/policies/StorageRetryPolicyV2\";\nimport { storageSharedKeyCredentialPolicy } from \"../../storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2\";\nimport { StorageBrowserPolicyFactory } from \"@azure/storage-blob\";\n\nimport {\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n isPipelineLike,\n Pipeline,\n} from \"@azure/storage-blob\";\nimport { storageCorrectContentLengthPolicy } from \"../../storage-blob/src/policies/StorageCorrectContentLengthPolicy\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n Pipeline,\n isPipelineLike,\n};\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\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 pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../../src/Pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAOlC,OAAO,EAQL,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAEL,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,wCAAwC,EACxC,4CAA4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EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;gBAChC,MAAM,EAAE,GAAG;aACZ,CAAC;QACJ,CAAC;KACF,CAAC;IACF,MAAM,wBAAwB,GAAyB;QACrD,GAAG,CAAC,SAA+B,EAAE,QAAgB;YACnD,gBAAgB;QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log\";\nimport type { StorageRetryOptions } from \"@azure/storage-blob\";\nimport { StorageRetryPolicyFactory } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport {\n StorageOAuthScopes,\n StorageDataLakeLoggingAllowedHeaderNames,\n StorageDataLakeLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants\";\nimport { getCachedDefaultHttpClient } from \"../../storage-blob/src/utils/cache\";\nimport { storageBrowserPolicy } from \"../../storage-blob/src/policies/StorageBrowserPolicyV2\";\nimport { storageRetryPolicy } from \"../../storage-blob/src/policies/StorageRetryPolicyV2\";\nimport { storageSharedKeyCredentialPolicy } from \"../../storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2\";\nimport { StorageBrowserPolicyFactory } from \"@azure/storage-blob\";\n\nimport {\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n isPipelineLike,\n Pipeline,\n} from \"@azure/storage-blob\";\nimport { storageCorrectContentLengthPolicy } from \"../../storage-blob/src/policies/StorageCorrectContentLengthPolicy\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n Pipeline,\n isPipelineLike,\n};\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\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 pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../../src/StorageClient.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../../src/StorageClient.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,M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B,CAAC;QAEF,IAAI,CAAC,kCAAkC,GAAG,IAAI,oBAAoB,CAChE,IAAI,CAAC,eAAe,EACpB,oBAAoB,CAAC,QAAQ,CAAC,CAC/B,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,UAAU,GAAI,UAAkB,CAAC,UAAU,CAAC;QAEjD,iDAAiD;QACjD,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpD,MAAM,oCAAoC,GAAG,IAAI,CAAC,kCAAyC,CAAC;QAC5F,oCAAoC,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { StorageContextClient } from \"./StorageContextClient\";\nimport type { StorageClient as StorageClientContext } from \"./generated/src\";\nimport type { Pipeline, PipelineLike, StoragePipelineOptions } from \"./Pipeline\";\nimport type { AnonymousCredential } from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport { toBlobEndpointUrl, toDfsEndpointUrl } from \"./transforms\";\nimport { escapeURLPath, getAccountNameFromUrl, getURLScheme, iEqual } from \"./utils/utils.common\";\nimport type { ExtendedServiceClientOptions } from \"@azure/core-http-compat\";\nimport type { HttpClient, Pipeline as CorePipeline } from \"@azure/core-rest-pipeline\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n// This function relies on the Pipeline already being initialized by a storage-blob client\nfunction getCoreClientOptions(pipeline: Pipeline): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n const httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 HttpClient\");\n }\n\n const corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 Pipeline\");\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nexport abstract class StorageClient {\n /**\n * Encoded URL string value.\n */\n public readonly url: string;\n\n public readonly accountName: string;\n\n /**\n * Encoded URL string value for corresponding blob endpoint.\n */\n protected readonly blobEndpointUrl: string;\n\n /**\n * Encoded URL string value for corresponding dfs endpoint.\n */\n protected readonly dfsEndpointUrl: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * 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 */\n public readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential;\n\n /**\n * StorageClient is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator.\n */\n protected readonly storageClientContext: StorageClientContext;\n\n /**\n * storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator, with its url pointing to the Blob endpoint.\n */\n protected readonly storageClientContextToBlobEndpoint: StorageClientContext;\n\n /**\n */\n protected readonly isHttps: boolean;\n\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n protected constructor(url: string, pipeline: PipelineLike) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.blobEndpointUrl = toBlobEndpointUrl(this.url);\n this.dfsEndpointUrl = toDfsEndpointUrl(this.url);\n this.accountName = getAccountNameFromUrl(this.blobEndpointUrl);\n this.pipeline = pipeline;\n // creating this BlobServiceClient allows us to use the converted V2 Pipeline attached to `pipeline`.\n const blobClient = new BlobServiceClient(url, pipeline);\n this.storageClientContext = new StorageContextClient(\n this.dfsEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.storageClientContextToBlobEndpoint = new StorageContextClient(\n this.blobEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n\n this.credential = (blobClient as any).credential;\n\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext as any;\n storageClientContext.requestContentType = undefined;\n const storageClientContextWithBlobEndpoint = this.storageClientContextToBlobEndpoint as any;\n storageClientContextWithBlobEndpoint.requestContentType = undefined;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../../src/StorageContextClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;;QAE5B,MAAM,mBAAmB,qBAAQ,aAAa,CAAE,CAAC;QAEjD,IACE,CAAC,MAAM;YACP,CAAC,aAAa,CAAC,WAAW;aAC1B,MAAA,aAAa,CAAC,gBAAgB,0CAAE,IAAI,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,KAAK,gBAAgB,CAC5D,CAAA,EACD,CAAC;YACD,mBAAmB,CAAC,SAAS,GAAG,MAAM,CAAC;YACvC,mBAAmB,CAAC,WAAW,GAAG;gBAChC,aAAa,EAAE,MAAM;gBACrB,MAAM,EAAE;oBACN,cAAc,EAAE,MAAM;oBACtB,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,EAAE;oBAChB,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IACE,mBAAmB,CAAC,IAAI,KAAK,eAAe;YAC5C,mBAAmB,CAAC,IAAI,KAAK,sBAAsB,EACnD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { isNode } from \"@azure/core-util\";\nimport { StorageClient } from \"./generated/src\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n !isNode &&\n !operationSpec.requestBody &&\n operationSpec.headerParameters?.some(\n (param) => param.mapper.serializedName === \"Content-Length\",\n )\n ) {\n operationSpecToSend.mediaType = \"text\";\n operationSpecToSend.requestBody = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n isConstant: true,\n defaultValue: \"\",\n type: {\n name: \"String\",\n },\n },\n };\n }\n\n if (\n operationSpecToSend.path === \"/{filesystem}\" ||\n operationSpecToSend.path === \"/{filesystem}/{path}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../../src/StorageContextClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;;QAE5B,MAAM,mBAAmB,qBAAQ,aAAa,CAAE,CAAC;QAEjD,IACE,CAAC,MAAM;YACP,CAAC,aAAa,CAAC,WAAW;aAC1B,MAAA,aAAa,CAAC,gBAAgB,0CAAE,IAAI,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,KAAK,gBAAgB,CAC5D,CAAA,EACD,CAAC;YACD,mBAAmB,CAAC,SAAS,GAAG,MAAM,CAAC;YACvC,mBAAmB,CAAC,WAAW,GAAG;gBAChC,aAAa,EAAE,MAAM;gBACrB,MAAM,EAAE;oBACN,cAAc,EAAE,MAAM;oBACtB,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,EAAE;oBAChB,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IACE,mBAAmB,CAAC,IAAI,KAAK,eAAe;YAC5C,mBAAmB,CAAC,IAAI,KAAK,sBAAsB,EACnD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { isNode } from \"@azure/core-util\";\nimport { StorageClient } from \"./generated/src\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n !isNode &&\n !operationSpec.requestBody &&\n operationSpec.headerParameters?.some(\n (param) => param.mapper.serializedName === \"Content-Length\",\n )\n ) {\n operationSpecToSend.mediaType = \"text\";\n operationSpecToSend.requestBody = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n isConstant: true,\n defaultValue: \"\",\n type: {\n name: \"String\",\n },\n },\n };\n }\n\n if (\n operationSpecToSend.path === \"/{filesystem}\" ||\n operationSpecToSend.path === \"/{filesystem}/{path}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
1
|
import { isTokenCredential } from "@azure/core-auth";
|
|
4
2
|
import { isNode } from "@azure/core-util";
|
|
5
3
|
import { isPipelineLike, newPipeline } from "./Pipeline";
|
|
@@ -563,7 +561,6 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
563
561
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
564
562
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
565
563
|
*/
|
|
566
|
-
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
|
|
567
564
|
generateUserDelegationSasStringToSign(options, userDelegationKey) {
|
|
568
565
|
return generateDataLakeSASQueryParametersInternal(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), userDelegationKey, this.accountName).stringToSign;
|
|
569
566
|
}
|
|
@@ -1143,7 +1140,6 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1143
1140
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
1144
1141
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
1145
1142
|
*/
|
|
1146
|
-
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
|
|
1147
1143
|
generateUserDelegationSasStringToSign(options, userDelegationKey) {
|
|
1148
1144
|
return generateDataLakeSASQueryParametersInternal(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), userDelegationKey, this.accountName).stringToSign;
|
|
1149
1145
|
}
|