@azure/storage-file-share 12.13.0-alpha.20230126.2 → 12.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -334,8 +334,8 @@ function ipRangeToString(ipRange) {
334
334
 
335
335
  // Copyright (c) Microsoft Corporation.
336
336
  // Licensed under the MIT license.
337
- const SDK_VERSION = "12.13.0";
338
- const SERVICE_VERSION = "2021-10-04";
337
+ const SDK_VERSION = "12.13.0-beta.1";
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;
@@ -885,6 +885,44 @@ function EscapePath(pathName) {
885
885
  }
886
886
  return split.join("/");
887
887
  }
888
+ function StringEncodedToString(name) {
889
+ if (name.encoded) {
890
+ return decodeURIComponent(name.content);
891
+ }
892
+ else {
893
+ return name.content;
894
+ }
895
+ }
896
+ function ConvertInternalResponseOfListFiles(internalResponse) {
897
+ const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { prefix: undefined, directoryPath: StringEncodedToString({
898
+ encoded: internalResponse.encoded,
899
+ content: internalResponse.directoryPath,
900
+ }), segment: {
901
+ fileItems: internalResponse.segment.fileItems.map((fileItemInternal) => {
902
+ const fileItem = Object.assign(Object.assign({}, fileItemInternal), { name: StringEncodedToString(fileItemInternal.name) });
903
+ return fileItem;
904
+ }),
905
+ directoryItems: internalResponse.segment.directoryItems.map((directoryItemInternal) => {
906
+ const directoryItem = Object.assign(Object.assign({}, directoryItemInternal), { name: StringEncodedToString(directoryItemInternal.name) });
907
+ return directoryItem;
908
+ }),
909
+ } });
910
+ delete wrappedResponse.encoded;
911
+ const listResponse = wrappedResponse;
912
+ if (internalResponse.prefix) {
913
+ listResponse.prefix = StringEncodedToString(internalResponse.prefix);
914
+ }
915
+ return listResponse;
916
+ }
917
+ function ConvertInternalResponseOfListHandles(internalResponse) {
918
+ const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { handleList: internalResponse.handleList
919
+ ? internalResponse.handleList.map((handleItemInternal) => {
920
+ const handleItem = Object.assign(Object.assign({}, handleItemInternal), { path: StringEncodedToString(handleItemInternal.path) });
921
+ return handleItem;
922
+ })
923
+ : undefined });
924
+ return wrappedResponse;
925
+ }
888
926
 
889
927
  // Copyright (c) Microsoft Corporation.
890
928
  /**
@@ -2000,6 +2038,14 @@ const ListFilesAndDirectoriesSegmentResponse = {
2000
2038
  name: "String"
2001
2039
  }
2002
2040
  },
2041
+ encoded: {
2042
+ serializedName: "Encoded",
2043
+ xmlName: "Encoded",
2044
+ xmlIsAttribute: true,
2045
+ type: {
2046
+ name: "Boolean"
2047
+ }
2048
+ },
2003
2049
  directoryPath: {
2004
2050
  serializedName: "DirectoryPath",
2005
2051
  required: true,
@@ -2011,10 +2057,10 @@ const ListFilesAndDirectoriesSegmentResponse = {
2011
2057
  },
2012
2058
  prefix: {
2013
2059
  serializedName: "Prefix",
2014
- required: true,
2015
2060
  xmlName: "Prefix",
2016
2061
  type: {
2017
- name: "String"
2062
+ name: "Composite",
2063
+ className: "StringEncoded"
2018
2064
  }
2019
2065
  },
2020
2066
  marker: {
@@ -2057,6 +2103,31 @@ const ListFilesAndDirectoriesSegmentResponse = {
2057
2103
  }
2058
2104
  }
2059
2105
  };
2106
+ const StringEncoded = {
2107
+ serializedName: "StringEncoded",
2108
+ type: {
2109
+ name: "Composite",
2110
+ className: "StringEncoded",
2111
+ modelProperties: {
2112
+ encoded: {
2113
+ serializedName: "Encoded",
2114
+ xmlName: "Encoded",
2115
+ xmlIsAttribute: true,
2116
+ type: {
2117
+ name: "Boolean"
2118
+ }
2119
+ },
2120
+ content: {
2121
+ serializedName: "content",
2122
+ xmlName: "content",
2123
+ xmlIsMsText: true,
2124
+ type: {
2125
+ name: "String"
2126
+ }
2127
+ }
2128
+ }
2129
+ }
2130
+ };
2060
2131
  const FilesAndDirectoriesListSegment = {
2061
2132
  serializedName: "FilesAndDirectoriesListSegment",
2062
2133
  xmlName: "Entries",
@@ -2106,10 +2177,10 @@ const DirectoryItem = {
2106
2177
  modelProperties: {
2107
2178
  name: {
2108
2179
  serializedName: "Name",
2109
- required: true,
2110
2180
  xmlName: "Name",
2111
2181
  type: {
2112
- name: "String"
2182
+ name: "Composite",
2183
+ className: "StringEncoded"
2113
2184
  }
2114
2185
  },
2115
2186
  fileId: {
@@ -2212,10 +2283,10 @@ const FileItem = {
2212
2283
  modelProperties: {
2213
2284
  name: {
2214
2285
  serializedName: "Name",
2215
- required: true,
2216
2286
  xmlName: "Name",
2217
2287
  type: {
2218
- name: "String"
2288
+ name: "Composite",
2289
+ className: "StringEncoded"
2219
2290
  }
2220
2291
  },
2221
2292
  fileId: {
@@ -2300,10 +2371,10 @@ const HandleItem = {
2300
2371
  },
2301
2372
  path: {
2302
2373
  serializedName: "Path",
2303
- required: true,
2304
2374
  xmlName: "Path",
2305
2375
  type: {
2306
- name: "String"
2376
+ name: "Composite",
2377
+ className: "StringEncoded"
2307
2378
  }
2308
2379
  },
2309
2380
  fileId: {
@@ -6498,6 +6569,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
6498
6569
  AccessPolicy: AccessPolicy,
6499
6570
  ShareStats: ShareStats,
6500
6571
  ListFilesAndDirectoriesSegmentResponse: ListFilesAndDirectoriesSegmentResponse,
6572
+ StringEncoded: StringEncoded,
6501
6573
  FilesAndDirectoriesListSegment: FilesAndDirectoriesListSegment,
6502
6574
  DirectoryItem: DirectoryItem,
6503
6575
  FileProperty: FileProperty,
@@ -6686,7 +6758,7 @@ const timeoutInSeconds = {
6686
6758
  const version = {
6687
6759
  parameterPath: "version",
6688
6760
  mapper: {
6689
- defaultValue: "2021-10-04",
6761
+ defaultValue: "2021-12-02",
6690
6762
  isConstant: true,
6691
6763
  serializedName: "x-ms-version",
6692
6764
  type: {
@@ -10429,7 +10501,7 @@ function convertTracingToRequestOptionsBase(options) {
10429
10501
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
10430
10502
  */
10431
10503
  const packageName = "azure-storage-file-share";
10432
- const packageVersion = "12.13.0";
10504
+ const packageVersion = "12.13.0-beta.1";
10433
10505
  class StorageClientContext extends coreHttp__namespace.ServiceClient {
10434
10506
  /**
10435
10507
  * Initializes a new instance of the StorageClientContext class.
@@ -10455,7 +10527,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
10455
10527
  // Parameter assignments
10456
10528
  this.url = url;
10457
10529
  // Assigning values to Constant parameters
10458
- this.version = options.version || "2021-10-04";
10530
+ this.version = options.version || "2021-12-02";
10459
10531
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
10460
10532
  }
10461
10533
  }
@@ -13009,7 +13081,9 @@ class ShareDirectoryClient extends StorageClient {
13009
13081
  options.prefix = undefined;
13010
13082
  }
13011
13083
  try {
13012
- return await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13084
+ const response = await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13085
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListFiles(response._response.parsedBody) }) });
13086
+ return wrappedResponse;
13013
13087
  }
13014
13088
  catch (e) {
13015
13089
  span.setStatus({
@@ -13193,7 +13267,8 @@ class ShareDirectoryClient extends StorageClient {
13193
13267
  if (response.handleList === "") {
13194
13268
  response.handleList = undefined;
13195
13269
  }
13196
- return response;
13270
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
13271
+ return wrappedResponse;
13197
13272
  }
13198
13273
  catch (e) {
13199
13274
  span.setStatus({
@@ -14489,7 +14564,8 @@ class ShareFileClient extends StorageClient {
14489
14564
  if (response.handleList === "") {
14490
14565
  response.handleList = undefined;
14491
14566
  }
14492
- return response;
14567
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
14568
+ return wrappedResponse;
14493
14569
  }
14494
14570
  catch (e) {
14495
14571
  span.setStatus({