@azure/storage-file-share 12.20.0-alpha.20230607.3 → 12.20.0-alpha.20230619.3
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 +92 -21
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-file-share/src/Clients.js +8 -4
- package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
- package/dist-esm/storage-file-share/src/StorageClient.js +1 -13
- package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/mappers.js +41 -8
- package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js +1 -1
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/constants.js +1 -1
- package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/utils.common.js +39 -5
- package/dist-esm/storage-file-share/src/utils/utils.common.js.map +1 -1
- package/package.json +8 -9
- package/types/3.1/storage-file-share.d.ts +68 -3
- package/types/latest/storage-file-share.d.ts +75 -3
@@ -4,14 +4,6 @@ import { StorageContextClient } from "./StorageContextClient";
|
|
4
4
|
import { getCoreClientOptions, getCredentialFromPipeline, } from "../../storage-blob/src/Pipeline";
|
5
5
|
import { escapeURLPath, getAccountNameFromUrl } from "./utils/utils.common";
|
6
6
|
import { isTokenCredential } from "@azure/core-auth";
|
7
|
-
let testOnlyHttpClient;
|
8
|
-
/**
|
9
|
-
* @internal
|
10
|
-
* Set a custom default http client for testing purposes
|
11
|
-
*/
|
12
|
-
export function setTestOnlySetHttpClient(httpClient) {
|
13
|
-
testOnlyHttpClient = httpClient;
|
14
|
-
}
|
15
7
|
/**
|
16
8
|
* A StorageClient represents a base client class for ServiceClient, ContainerClient and etc.
|
17
9
|
*/
|
@@ -26,11 +18,7 @@ export class StorageClient {
|
|
26
18
|
this.url = escapeURLPath(url);
|
27
19
|
this.accountName = getAccountNameFromUrl(url);
|
28
20
|
this.pipeline = pipeline;
|
29
|
-
|
30
|
-
if (testOnlyHttpClient) {
|
31
|
-
coreOptions.httpClient = testOnlyHttpClient;
|
32
|
-
}
|
33
|
-
this.storageClientContext = new StorageContextClient(this.url, coreOptions);
|
21
|
+
this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));
|
34
22
|
// Remove the default content-type in generated code of StorageClientContext
|
35
23
|
const storageClientContext = this.storageClientContext;
|
36
24
|
if (storageClientContext.requestContentType) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAEL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAEL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAYrD;;GAEG;AACH,MAAM,OAAgB,aAAa;IA4BjC;;;;OAIG;IACH,YAAsB,GAAW,EAAE,QAAkB;QACnD,iFAAiF;QACjF,IAAI,CAAC,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/F,4EAA4E;QAC5E,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,IAAI,oBAAoB,CAAC,kBAAkB,EAAE;YAC3C,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;SACrD;QAED,MAAM,UAAU,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;SACxE;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { StorageClient as StorageClientContext } from \"./generated/src/\";\nimport { StorageContextClient } from \"./StorageContextClient\";\nimport {\n Pipeline,\n getCoreClientOptions,\n getCredentialFromPipeline,\n} from \"../../storage-blob/src/Pipeline\";\nimport { escapeURLPath, getAccountNameFromUrl } from \"./utils/utils.common\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { OperationTracingOptions } from \"@azure/core-tracing\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n/**\n * A StorageClient represents a base client class for ServiceClient, ContainerClient and etc.\n */\nexport abstract class StorageClient {\n /**\n * URL string value.\n */\n public readonly url: string;\n public readonly accountName: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * Credential in the pipeline to authenticate requests to the service, such as AnonymousCredential, StorageSharedKeyCredential.\n * Initialized to an AnonymousCredential if not able to retrieve it from the pipeline.\n *\n * @internal\n */\n protected readonly credential: StorageSharedKeyCredential | AnonymousCredential;\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 * Creates an instance of StorageClient.\n * @param url -\n * @param pipeline -\n */\n protected constructor(url: string, pipeline: Pipeline) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n\n this.pipeline = pipeline;\n this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));\n // Remove the default content-type in generated code of StorageClientContext\n const storageClientContext = this.storageClientContext as any;\n if (storageClientContext.requestContentType) {\n storageClientContext.requestContentType = undefined;\n }\n\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n throw new Error(\"Unsupported TokenCredential type found in pipeline.\");\n }\n this.credential = credential;\n }\n}\n"]}
|