@azure/storage-file-share 12.20.0-alpha.20230608.4 → 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 CHANGED
@@ -340,7 +340,7 @@ function ipRangeToString(ipRange) {
340
340
  // Copyright (c) Microsoft Corporation.
341
341
  // Licensed under the MIT license.
342
342
  const SDK_VERSION$1 = "12.20.0";
343
- const SERVICE_VERSION = "2021-10-04";
343
+ const SERVICE_VERSION = "2021-12-02";
344
344
  const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
345
345
  const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
346
346
  const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
@@ -746,6 +746,44 @@ function assertResponse(response) {
746
746
  }
747
747
  throw new TypeError(`Unexpected response object ${response}`);
748
748
  }
749
+ function StringEncodedToString(name) {
750
+ if (name.encoded) {
751
+ return decodeURIComponent(name.content);
752
+ }
753
+ else {
754
+ return name.content;
755
+ }
756
+ }
757
+ function ConvertInternalResponseOfListFiles(internalResponse) {
758
+ const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { prefix: undefined, directoryPath: StringEncodedToString({
759
+ encoded: internalResponse.encoded,
760
+ content: internalResponse.directoryPath,
761
+ }), segment: {
762
+ fileItems: internalResponse.segment.fileItems.map((fileItemInternal) => {
763
+ const fileItem = Object.assign(Object.assign({}, fileItemInternal), { name: StringEncodedToString(fileItemInternal.name) });
764
+ return fileItem;
765
+ }),
766
+ directoryItems: internalResponse.segment.directoryItems.map((directoryItemInternal) => {
767
+ const directoryItem = Object.assign(Object.assign({}, directoryItemInternal), { name: StringEncodedToString(directoryItemInternal.name) });
768
+ return directoryItem;
769
+ }),
770
+ } });
771
+ delete wrappedResponse.encoded;
772
+ const listResponse = wrappedResponse;
773
+ if (internalResponse.prefix) {
774
+ listResponse.prefix = StringEncodedToString(internalResponse.prefix);
775
+ }
776
+ return listResponse;
777
+ }
778
+ function ConvertInternalResponseOfListHandles(internalResponse) {
779
+ const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { handleList: internalResponse.handleList
780
+ ? internalResponse.handleList.map((handleItemInternal) => {
781
+ const handleItem = Object.assign(Object.assign({}, handleItemInternal), { path: StringEncodedToString(handleItemInternal.path) });
782
+ return handleItem;
783
+ })
784
+ : undefined });
785
+ return wrappedResponse;
786
+ }
749
787
 
750
788
  // Copyright (c) Microsoft Corporation.
751
789
  /**
@@ -3296,6 +3334,14 @@ const ListFilesAndDirectoriesSegmentResponse = {
3296
3334
  name: "String"
3297
3335
  }
3298
3336
  },
3337
+ encoded: {
3338
+ serializedName: "Encoded",
3339
+ xmlName: "Encoded",
3340
+ xmlIsAttribute: true,
3341
+ type: {
3342
+ name: "Boolean"
3343
+ }
3344
+ },
3299
3345
  directoryPath: {
3300
3346
  serializedName: "DirectoryPath",
3301
3347
  required: true,
@@ -3307,10 +3353,10 @@ const ListFilesAndDirectoriesSegmentResponse = {
3307
3353
  },
3308
3354
  prefix: {
3309
3355
  serializedName: "Prefix",
3310
- required: true,
3311
3356
  xmlName: "Prefix",
3312
3357
  type: {
3313
- name: "String"
3358
+ name: "Composite",
3359
+ className: "StringEncoded"
3314
3360
  }
3315
3361
  },
3316
3362
  marker: {
@@ -3353,6 +3399,31 @@ const ListFilesAndDirectoriesSegmentResponse = {
3353
3399
  }
3354
3400
  }
3355
3401
  };
3402
+ const StringEncoded = {
3403
+ serializedName: "StringEncoded",
3404
+ type: {
3405
+ name: "Composite",
3406
+ className: "StringEncoded",
3407
+ modelProperties: {
3408
+ encoded: {
3409
+ serializedName: "Encoded",
3410
+ xmlName: "Encoded",
3411
+ xmlIsAttribute: true,
3412
+ type: {
3413
+ name: "Boolean"
3414
+ }
3415
+ },
3416
+ content: {
3417
+ serializedName: "content",
3418
+ xmlName: "content",
3419
+ xmlIsMsText: true,
3420
+ type: {
3421
+ name: "String"
3422
+ }
3423
+ }
3424
+ }
3425
+ }
3426
+ };
3356
3427
  const FilesAndDirectoriesListSegment = {
3357
3428
  serializedName: "FilesAndDirectoriesListSegment",
3358
3429
  xmlName: "Entries",
@@ -3402,10 +3473,10 @@ const DirectoryItem = {
3402
3473
  modelProperties: {
3403
3474
  name: {
3404
3475
  serializedName: "Name",
3405
- required: true,
3406
3476
  xmlName: "Name",
3407
3477
  type: {
3408
- name: "String"
3478
+ name: "Composite",
3479
+ className: "StringEncoded"
3409
3480
  }
3410
3481
  },
3411
3482
  fileId: {
@@ -3508,10 +3579,10 @@ const FileItem = {
3508
3579
  modelProperties: {
3509
3580
  name: {
3510
3581
  serializedName: "Name",
3511
- required: true,
3512
3582
  xmlName: "Name",
3513
3583
  type: {
3514
- name: "String"
3584
+ name: "Composite",
3585
+ className: "StringEncoded"
3515
3586
  }
3516
3587
  },
3517
3588
  fileId: {
@@ -3596,10 +3667,10 @@ const HandleItem = {
3596
3667
  },
3597
3668
  path: {
3598
3669
  serializedName: "Path",
3599
- required: true,
3600
3670
  xmlName: "Path",
3601
3671
  type: {
3602
- name: "String"
3672
+ name: "Composite",
3673
+ className: "StringEncoded"
3603
3674
  }
3604
3675
  },
3605
3676
  fileId: {
@@ -7794,6 +7865,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
7794
7865
  AccessPolicy: AccessPolicy,
7795
7866
  ShareStats: ShareStats,
7796
7867
  ListFilesAndDirectoriesSegmentResponse: ListFilesAndDirectoriesSegmentResponse,
7868
+ StringEncoded: StringEncoded,
7797
7869
  FilesAndDirectoriesListSegment: FilesAndDirectoriesListSegment,
7798
7870
  DirectoryItem: DirectoryItem,
7799
7871
  FileProperty: FileProperty,
@@ -7982,7 +8054,7 @@ const timeoutInSeconds = {
7982
8054
  const version = {
7983
8055
  parameterPath: "version",
7984
8056
  mapper: {
7985
- defaultValue: "2021-10-04",
8057
+ defaultValue: "2021-12-02",
7986
8058
  isConstant: true,
7987
8059
  serializedName: "x-ms-version",
7988
8060
  type: {
@@ -10890,7 +10962,7 @@ class StorageClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
10890
10962
  // Parameter assignments
10891
10963
  this.url = url;
10892
10964
  // Assigning values to Constant parameters
10893
- this.version = options.version || "2021-10-04";
10965
+ this.version = options.version || "2021-12-02";
10894
10966
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
10895
10967
  this.service = new ServiceImpl(this);
10896
10968
  this.share = new ShareImpl(this);
@@ -13138,7 +13210,9 @@ class ShareDirectoryClient extends StorageClient {
13138
13210
  options.prefix = undefined;
13139
13211
  }
13140
13212
  return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
13141
- return assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({}, updatedOptions), { marker })));
13213
+ const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({}, updatedOptions), { marker })));
13214
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody) }) });
13215
+ return wrappedResponse;
13142
13216
  });
13143
13217
  }
13144
13218
  /**
@@ -13318,7 +13392,8 @@ class ShareDirectoryClient extends StorageClient {
13318
13392
  if (response.handleList === "") {
13319
13393
  response.handleList = undefined;
13320
13394
  }
13321
- return response;
13395
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
13396
+ return wrappedResponse;
13322
13397
  });
13323
13398
  }
13324
13399
  /**
@@ -14285,7 +14360,8 @@ class ShareFileClient extends StorageClient {
14285
14360
  if (response.handleList === "") {
14286
14361
  response.handleList = undefined;
14287
14362
  }
14288
- return response;
14363
+ const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
14364
+ return wrappedResponse;
14289
14365
  });
14290
14366
  }
14291
14367
  /**