@azure/storage-file-share 12.13.0-alpha.20230126.2 → 12.13.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 CHANGED
@@ -335,7 +335,7 @@ function ipRangeToString(ipRange) {
335
335
  // Copyright (c) Microsoft Corporation.
336
336
  // Licensed under the MIT license.
337
337
  const SDK_VERSION = "12.13.0";
338
- const SERVICE_VERSION = "2021-10-04";
338
+ const SERVICE_VERSION = "2021-12-02";
339
339
  const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
340
340
  const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
341
341
  const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
@@ -636,7 +636,8 @@ function appendToURLPath(url, name) {
636
636
  let path = urlParsed.getPath();
637
637
  path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name;
638
638
  urlParsed.setPath(path);
639
- return urlParsed.toString();
639
+ const normalizedUrl = new URL(urlParsed.toString());
640
+ return normalizedUrl.toString();
640
641
  }
641
642
  /**
642
643
  * Append a string to URL query.
@@ -885,6 +886,44 @@ function EscapePath(pathName) {
885
886
  }
886
887
  return split.join("/");
887
888
  }
889
+ function StringEncodedToString(name) {
890
+ if (name.encoded) {
891
+ return decodeURIComponent(name.content);
892
+ }
893
+ else {
894
+ return name.content;
895
+ }
896
+ }
897
+ function ConvertInternalResponseOfListFiles(internalResponse) {
898
+ const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { prefix: undefined, directoryPath: StringEncodedToString({
899
+ encoded: internalResponse.encoded,
900
+ content: internalResponse.directoryPath,
901
+ }), segment: {
902
+ fileItems: internalResponse.segment.fileItems.map((fileItemInternal) => {
903
+ const fileItem = Object.assign(Object.assign({}, fileItemInternal), { name: StringEncodedToString(fileItemInternal.name) });
904
+ return fileItem;
905
+ }),
906
+ directoryItems: internalResponse.segment.directoryItems.map((directoryItemInternal) => {
907
+ const directoryItem = Object.assign(Object.assign({}, directoryItemInternal), { name: StringEncodedToString(directoryItemInternal.name) });
908
+ return directoryItem;
909
+ }),
910
+ } });
911
+ delete wrappedResponse.encoded;
912
+ const listResponse = wrappedResponse;
913
+ if (internalResponse.prefix) {
914
+ listResponse.prefix = StringEncodedToString(internalResponse.prefix);
915
+ }
916
+ return listResponse;
917
+ }
918
+ function ConvertInternalResponseOfListHandles(internalResponse) {
919
+ const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { handleList: internalResponse.handleList
920
+ ? internalResponse.handleList.map((handleItemInternal) => {
921
+ const handleItem = Object.assign(Object.assign({}, handleItemInternal), { path: StringEncodedToString(handleItemInternal.path) });
922
+ return handleItem;
923
+ })
924
+ : undefined });
925
+ return wrappedResponse;
926
+ }
888
927
 
889
928
  // Copyright (c) Microsoft Corporation.
890
929
  /**
@@ -2000,6 +2039,14 @@ const ListFilesAndDirectoriesSegmentResponse = {
2000
2039
  name: "String"
2001
2040
  }
2002
2041
  },
2042
+ encoded: {
2043
+ serializedName: "Encoded",
2044
+ xmlName: "Encoded",
2045
+ xmlIsAttribute: true,
2046
+ type: {
2047
+ name: "Boolean"
2048
+ }
2049
+ },
2003
2050
  directoryPath: {
2004
2051
  serializedName: "DirectoryPath",
2005
2052
  required: true,
@@ -2011,10 +2058,10 @@ const ListFilesAndDirectoriesSegmentResponse = {
2011
2058
  },
2012
2059
  prefix: {
2013
2060
  serializedName: "Prefix",
2014
- required: true,
2015
2061
  xmlName: "Prefix",
2016
2062
  type: {
2017
- name: "String"
2063
+ name: "Composite",
2064
+ className: "StringEncoded"
2018
2065
  }
2019
2066
  },
2020
2067
  marker: {
@@ -2057,6 +2104,31 @@ const ListFilesAndDirectoriesSegmentResponse = {
2057
2104
  }
2058
2105
  }
2059
2106
  };
2107
+ const StringEncoded = {
2108
+ serializedName: "StringEncoded",
2109
+ type: {
2110
+ name: "Composite",
2111
+ className: "StringEncoded",
2112
+ modelProperties: {
2113
+ encoded: {
2114
+ serializedName: "Encoded",
2115
+ xmlName: "Encoded",
2116
+ xmlIsAttribute: true,
2117
+ type: {
2118
+ name: "Boolean"
2119
+ }
2120
+ },
2121
+ content: {
2122
+ serializedName: "content",
2123
+ xmlName: "content",
2124
+ xmlIsMsText: true,
2125
+ type: {
2126
+ name: "String"
2127
+ }
2128
+ }
2129
+ }
2130
+ }
2131
+ };
2060
2132
  const FilesAndDirectoriesListSegment = {
2061
2133
  serializedName: "FilesAndDirectoriesListSegment",
2062
2134
  xmlName: "Entries",
@@ -2106,10 +2178,10 @@ const DirectoryItem = {
2106
2178
  modelProperties: {
2107
2179
  name: {
2108
2180
  serializedName: "Name",
2109
- required: true,
2110
2181
  xmlName: "Name",
2111
2182
  type: {
2112
- name: "String"
2183
+ name: "Composite",
2184
+ className: "StringEncoded"
2113
2185
  }
2114
2186
  },
2115
2187
  fileId: {
@@ -2212,10 +2284,10 @@ const FileItem = {
2212
2284
  modelProperties: {
2213
2285
  name: {
2214
2286
  serializedName: "Name",
2215
- required: true,
2216
2287
  xmlName: "Name",
2217
2288
  type: {
2218
- name: "String"
2289
+ name: "Composite",
2290
+ className: "StringEncoded"
2219
2291
  }
2220
2292
  },
2221
2293
  fileId: {
@@ -2300,10 +2372,10 @@ const HandleItem = {
2300
2372
  },
2301
2373
  path: {
2302
2374
  serializedName: "Path",
2303
- required: true,
2304
2375
  xmlName: "Path",
2305
2376
  type: {
2306
- name: "String"
2377
+ name: "Composite",
2378
+ className: "StringEncoded"
2307
2379
  }
2308
2380
  },
2309
2381
  fileId: {
@@ -6498,6 +6570,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
6498
6570
  AccessPolicy: AccessPolicy,
6499
6571
  ShareStats: ShareStats,
6500
6572
  ListFilesAndDirectoriesSegmentResponse: ListFilesAndDirectoriesSegmentResponse,
6573
+ StringEncoded: StringEncoded,
6501
6574
  FilesAndDirectoriesListSegment: FilesAndDirectoriesListSegment,
6502
6575
  DirectoryItem: DirectoryItem,
6503
6576
  FileProperty: FileProperty,
@@ -6686,7 +6759,7 @@ const timeoutInSeconds = {
6686
6759
  const version = {
6687
6760
  parameterPath: "version",
6688
6761
  mapper: {
6689
- defaultValue: "2021-10-04",
6762
+ defaultValue: "2021-12-02",
6690
6763
  isConstant: true,
6691
6764
  serializedName: "x-ms-version",
6692
6765
  type: {
@@ -10455,7 +10528,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
10455
10528
  // Parameter assignments
10456
10529
  this.url = url;
10457
10530
  // Assigning values to Constant parameters
10458
- this.version = options.version || "2021-10-04";
10531
+ this.version = options.version || "2021-12-02";
10459
10532
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
10460
10533
  }
10461
10534
  }
@@ -13009,7 +13082,9 @@ class ShareDirectoryClient extends StorageClient {
13009
13082
  options.prefix = undefined;
13010
13083
  }
13011
13084
  try {
13012
- return await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13085
+ const response = await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13086
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListFiles(response._response.parsedBody) }) });
13087
+ return wrappedResponse;
13013
13088
  }
13014
13089
  catch (e) {
13015
13090
  span.setStatus({
@@ -13193,7 +13268,8 @@ class ShareDirectoryClient extends StorageClient {
13193
13268
  if (response.handleList === "") {
13194
13269
  response.handleList = undefined;
13195
13270
  }
13196
- return response;
13271
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
13272
+ return wrappedResponse;
13197
13273
  }
13198
13274
  catch (e) {
13199
13275
  span.setStatus({
@@ -14489,7 +14565,8 @@ class ShareFileClient extends StorageClient {
14489
14565
  if (response.handleList === "") {
14490
14566
  response.handleList = undefined;
14491
14567
  }
14492
- return response;
14568
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
14569
+ return wrappedResponse;
14493
14570
  }
14494
14571
  catch (e) {
14495
14572
  span.setStatus({