@azure/storage-file-share 12.13.0-alpha.20230306.3 → 12.13.0-alpha.20230418.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
@@ -911,6 +911,20 @@ exports.SASProtocol = void 0;
911
911
  * NOTE: Instances of this class are immutable.
912
912
  */
913
913
  class SASQueryParameters {
914
+ /**
915
+ * Optional. IP range allowed for this SAS.
916
+ *
917
+ * @readonly
918
+ */
919
+ get ipRange() {
920
+ if (this.ipRangeInner) {
921
+ return {
922
+ end: this.ipRangeInner.end,
923
+ start: this.ipRangeInner.start,
924
+ };
925
+ }
926
+ return undefined;
927
+ }
914
928
  /**
915
929
  * Creates an instance of SASQueryParameters.
916
930
  *
@@ -949,20 +963,6 @@ class SASQueryParameters {
949
963
  this.contentLanguage = contentLanguage;
950
964
  this.contentType = contentType;
951
965
  }
952
- /**
953
- * Optional. IP range allowed for this SAS.
954
- *
955
- * @readonly
956
- */
957
- get ipRange() {
958
- if (this.ipRangeInner) {
959
- return {
960
- end: this.ipRangeInner.end,
961
- start: this.ipRangeInner.start,
962
- };
963
- }
964
- return undefined;
965
- }
966
966
  /**
967
967
  * Encodes all SAS query parameters into a string that can be appended to a URL.
968
968
  *
@@ -10761,19 +10761,6 @@ class RetriableReadableStream extends stream.Readable {
10761
10761
  * a normal Node.js Readable stream.
10762
10762
  */
10763
10763
  class FileDownloadResponse {
10764
- /**
10765
- * Creates an instance of FileDownloadResponse.
10766
- *
10767
- * @param originalResponse -
10768
- * @param getter -
10769
- * @param offset -
10770
- * @param count -
10771
- * @param options -
10772
- */
10773
- constructor(originalResponse, getter, offset, count, options = {}) {
10774
- this.originalResponse = originalResponse;
10775
- this.fileDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options);
10776
- }
10777
10764
  /**
10778
10765
  * Indicates that the service supports
10779
10766
  * requests for partial file content.
@@ -11104,6 +11091,19 @@ class FileDownloadResponse {
11104
11091
  get _response() {
11105
11092
  return this.originalResponse._response;
11106
11093
  }
11094
+ /**
11095
+ * Creates an instance of FileDownloadResponse.
11096
+ *
11097
+ * @param originalResponse -
11098
+ * @param getter -
11099
+ * @param offset -
11100
+ * @param count -
11101
+ * @param options -
11102
+ */
11103
+ constructor(originalResponse, getter, offset, count, options = {}) {
11104
+ this.originalResponse = originalResponse;
11105
+ this.fileDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options);
11106
+ }
11107
11107
  }
11108
11108
 
11109
11109
  // Copyright (c) Microsoft Corporation.
@@ -11683,6 +11683,12 @@ const fsCreateReadStream = fs__namespace.createReadStream;
11683
11683
  * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
11684
11684
  */
11685
11685
  class ShareClient extends StorageClient {
11686
+ /**
11687
+ * The name of the share
11688
+ */
11689
+ get name() {
11690
+ return this._name;
11691
+ }
11686
11692
  constructor(urlOrConnectionString, credentialOrPipelineOrShareName,
11687
11693
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
11688
11694
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
@@ -11736,12 +11742,6 @@ class ShareClient extends StorageClient {
11736
11742
  this._name = getShareNameAndPathFromUrl(this.url).shareName;
11737
11743
  this.context = new Share(this.storageClientContext);
11738
11744
  }
11739
- /**
11740
- * The name of the share
11741
- */
11742
- get name() {
11743
- return this._name;
11744
- }
11745
11745
  /**
11746
11746
  * Creates a new ShareClient object identical to the source but with the specified snapshot timestamp.
11747
11747
  * Provide "" will remove the snapshot and return a URL to the base share.
@@ -12374,6 +12374,24 @@ class ShareClient extends StorageClient {
12374
12374
  * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.
12375
12375
  */
12376
12376
  class ShareDirectoryClient extends StorageClient {
12377
+ /**
12378
+ * The share name corresponding to this directory client
12379
+ */
12380
+ get shareName() {
12381
+ return this._shareName;
12382
+ }
12383
+ /**
12384
+ * The full path of the directory
12385
+ */
12386
+ get path() {
12387
+ return this._path;
12388
+ }
12389
+ /**
12390
+ * The name of the directory
12391
+ */
12392
+ get name() {
12393
+ return this._name;
12394
+ }
12377
12395
  constructor(url, credentialOrPipeline, options = {}) {
12378
12396
  let pipeline;
12379
12397
  if (credentialOrPipeline instanceof Pipeline) {
@@ -12394,24 +12412,6 @@ class ShareDirectoryClient extends StorageClient {
12394
12412
  } = getShareNameAndPathFromUrl(this.url));
12395
12413
  this.context = new Directory(this.storageClientContext);
12396
12414
  }
12397
- /**
12398
- * The share name corresponding to this directory client
12399
- */
12400
- get shareName() {
12401
- return this._shareName;
12402
- }
12403
- /**
12404
- * The full path of the directory
12405
- */
12406
- get path() {
12407
- return this._path;
12408
- }
12409
- /**
12410
- * The name of the directory
12411
- */
12412
- get name() {
12413
- return this._name;
12414
- }
12415
12415
  /**
12416
12416
  * Creates a new directory under the specified share or parent directory.
12417
12417
  * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory
@@ -12838,26 +12838,33 @@ class ShareDirectoryClient extends StorageClient {
12838
12838
  */
12839
12839
  listFilesAndDirectoriesItems(options = {}) {
12840
12840
  return tslib.__asyncGenerator(this, arguments, function* listFilesAndDirectoriesItems_1() {
12841
- var e_1, _a;
12841
+ var _a, e_1, _b, _c;
12842
12842
  if (options.prefix === "") {
12843
12843
  options.prefix = undefined;
12844
12844
  }
12845
12845
  let marker;
12846
12846
  try {
12847
- for (var _b = tslib.__asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
12848
- const listFilesAndDirectoriesResponse = _c.value;
12849
- for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
12850
- yield yield tslib.__await(Object.assign({ kind: "file" }, file));
12847
+ for (var _d = true, _e = tslib.__asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
12848
+ _c = _f.value;
12849
+ _d = false;
12850
+ try {
12851
+ const listFilesAndDirectoriesResponse = _c;
12852
+ for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
12853
+ yield yield tslib.__await(Object.assign({ kind: "file" }, file));
12854
+ }
12855
+ for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
12856
+ yield yield tslib.__await(Object.assign({ kind: "directory" }, directory));
12857
+ }
12851
12858
  }
12852
- for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
12853
- yield yield tslib.__await(Object.assign({ kind: "directory" }, directory));
12859
+ finally {
12860
+ _d = true;
12854
12861
  }
12855
12862
  }
12856
12863
  }
12857
12864
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
12858
12865
  finally {
12859
12866
  try {
12860
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
12867
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
12861
12868
  }
12862
12869
  finally { if (e_1) throw e_1.error; }
12863
12870
  }
@@ -13051,22 +13058,29 @@ class ShareDirectoryClient extends StorageClient {
13051
13058
  */
13052
13059
  listHandleItems(options = {}) {
13053
13060
  return tslib.__asyncGenerator(this, arguments, function* listHandleItems_1() {
13054
- var e_2, _a;
13061
+ var _a, e_2, _b, _c;
13055
13062
  let marker;
13056
13063
  try {
13057
- for (var _b = tslib.__asyncValues(this.iterateHandleSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
13058
- const listHandlesResponse = _c.value;
13059
- if (listHandlesResponse.handleList) {
13060
- for (const handle of listHandlesResponse.handleList) {
13061
- yield yield tslib.__await(handle);
13064
+ for (var _d = true, _e = tslib.__asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
13065
+ _c = _f.value;
13066
+ _d = false;
13067
+ try {
13068
+ const listHandlesResponse = _c;
13069
+ if (listHandlesResponse.handleList) {
13070
+ for (const handle of listHandlesResponse.handleList) {
13071
+ yield yield tslib.__await(handle);
13072
+ }
13062
13073
  }
13063
13074
  }
13075
+ finally {
13076
+ _d = true;
13077
+ }
13064
13078
  }
13065
13079
  }
13066
13080
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
13067
13081
  finally {
13068
13082
  try {
13069
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
13083
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
13070
13084
  }
13071
13085
  finally { if (e_2) throw e_2.error; }
13072
13086
  }
@@ -13373,6 +13387,24 @@ class ShareDirectoryClient extends StorageClient {
13373
13387
  * A ShareFileClient represents a URL to an Azure Storage file.
13374
13388
  */
13375
13389
  class ShareFileClient extends StorageClient {
13390
+ /**
13391
+ * The share name corresponding to this file client
13392
+ */
13393
+ get shareName() {
13394
+ return this._shareName;
13395
+ }
13396
+ /**
13397
+ * The full path of the file
13398
+ */
13399
+ get path() {
13400
+ return this._path;
13401
+ }
13402
+ /**
13403
+ * The name of the file
13404
+ */
13405
+ get name() {
13406
+ return this._name;
13407
+ }
13376
13408
  constructor(url, credentialOrPipeline,
13377
13409
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
13378
13410
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
@@ -13396,24 +13428,6 @@ class ShareFileClient extends StorageClient {
13396
13428
  } = getShareNameAndPathFromUrl(this.url));
13397
13429
  this.context = new File(this.storageClientContext);
13398
13430
  }
13399
- /**
13400
- * The share name corresponding to this file client
13401
- */
13402
- get shareName() {
13403
- return this._shareName;
13404
- }
13405
- /**
13406
- * The full path of the file
13407
- */
13408
- get path() {
13409
- return this._path;
13410
- }
13411
- /**
13412
- * The name of the file
13413
- */
13414
- get name() {
13415
- return this._name;
13416
- }
13417
13431
  /**
13418
13432
  * Creates a new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
13419
13433
  * Provide "" will remove the snapshot and return a URL to the base ShareFileClient.
@@ -14531,22 +14545,29 @@ class ShareFileClient extends StorageClient {
14531
14545
  */
14532
14546
  listHandleItems(options = {}) {
14533
14547
  return tslib.__asyncGenerator(this, arguments, function* listHandleItems_2() {
14534
- var e_3, _a;
14548
+ var _a, e_3, _b, _c;
14535
14549
  let marker;
14536
14550
  try {
14537
- for (var _b = tslib.__asyncValues(this.iterateHandleSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
14538
- const listHandlesResponse = _c.value;
14539
- if (listHandlesResponse.handleList) {
14540
- for (const handle of listHandlesResponse.handleList) {
14541
- yield yield tslib.__await(handle);
14551
+ for (var _d = true, _e = tslib.__asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
14552
+ _c = _f.value;
14553
+ _d = false;
14554
+ try {
14555
+ const listHandlesResponse = _c;
14556
+ if (listHandlesResponse.handleList) {
14557
+ for (const handle of listHandlesResponse.handleList) {
14558
+ yield yield tslib.__await(handle);
14559
+ }
14542
14560
  }
14543
14561
  }
14562
+ finally {
14563
+ _d = true;
14564
+ }
14544
14565
  }
14545
14566
  }
14546
14567
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
14547
14568
  finally {
14548
14569
  try {
14549
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
14570
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
14550
14571
  }
14551
14572
  finally { if (e_3) throw e_3.error; }
14552
14573
  }
@@ -14788,6 +14809,22 @@ class ShareFileClient extends StorageClient {
14788
14809
  * @see https://docs.microsoft.com/rest/api/storageservices/lease-share
14789
14810
  */
14790
14811
  class ShareLeaseClient {
14812
+ /**
14813
+ * Gets the lease Id.
14814
+ *
14815
+ * @readonly
14816
+ */
14817
+ get leaseId() {
14818
+ return this._leaseId;
14819
+ }
14820
+ /**
14821
+ * Gets the url.
14822
+ *
14823
+ * @readonly
14824
+ */
14825
+ get url() {
14826
+ return this._url;
14827
+ }
14791
14828
  /**
14792
14829
  * Creates an instance of ShareLeaseClient.
14793
14830
  * @param client - The client to make the lease operation requests.
@@ -14809,22 +14846,6 @@ class ShareLeaseClient {
14809
14846
  }
14810
14847
  this._leaseId = leaseId;
14811
14848
  }
14812
- /**
14813
- * Gets the lease Id.
14814
- *
14815
- * @readonly
14816
- */
14817
- get leaseId() {
14818
- return this._leaseId;
14819
- }
14820
- /**
14821
- * Gets the url.
14822
- *
14823
- * @readonly
14824
- */
14825
- get url() {
14826
- return this._url;
14827
- }
14828
14849
  /**
14829
14850
  * Establishes and manages a lock on a file, share or share snapshot for write and delete operations.
14830
14851
  *
@@ -14967,24 +14988,6 @@ class ShareClientInternal extends StorageClient {
14967
14988
  * to manipulate file shares.
14968
14989
  */
14969
14990
  class ShareServiceClient extends StorageClient {
14970
- constructor(url, credentialOrPipeline,
14971
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
14972
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
14973
- options) {
14974
- let pipeline;
14975
- if (credentialOrPipeline instanceof Pipeline) {
14976
- pipeline = credentialOrPipeline;
14977
- }
14978
- else if (credentialOrPipeline instanceof Credential) {
14979
- pipeline = newPipeline(credentialOrPipeline, options);
14980
- }
14981
- else {
14982
- // The second parameter is undefined. Use anonymous credential.
14983
- pipeline = newPipeline(new AnonymousCredential(), options);
14984
- }
14985
- super(url, pipeline);
14986
- this.serviceContext = new Service(this.storageClientContext);
14987
- }
14988
14991
  /**
14989
14992
  *
14990
14993
  * Creates an instance of ShareServiceClient from connection string.
@@ -15021,6 +15024,24 @@ class ShareServiceClient extends StorageClient {
15021
15024
  throw new Error("Connection string must be either an Account connection string or a SAS connection string");
15022
15025
  }
15023
15026
  }
15027
+ constructor(url, credentialOrPipeline,
15028
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
15029
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
15030
+ options) {
15031
+ let pipeline;
15032
+ if (credentialOrPipeline instanceof Pipeline) {
15033
+ pipeline = credentialOrPipeline;
15034
+ }
15035
+ else if (credentialOrPipeline instanceof Credential) {
15036
+ pipeline = newPipeline(credentialOrPipeline, options);
15037
+ }
15038
+ else {
15039
+ // The second parameter is undefined. Use anonymous credential.
15040
+ pipeline = newPipeline(new AnonymousCredential(), options);
15041
+ }
15042
+ super(url, pipeline);
15043
+ this.serviceContext = new Service(this.storageClientContext);
15044
+ }
15024
15045
  /**
15025
15046
  * Creates a ShareClient object.
15026
15047
  *
@@ -15171,23 +15192,30 @@ class ShareServiceClient extends StorageClient {
15171
15192
  */
15172
15193
  listItems(options = {}) {
15173
15194
  return tslib.__asyncGenerator(this, arguments, function* listItems_1() {
15174
- var e_1, _a;
15195
+ var _a, e_1, _b, _c;
15175
15196
  if (options.prefix === "") {
15176
15197
  options.prefix = undefined;
15177
15198
  }
15178
15199
  let marker;
15179
15200
  try {
15180
- for (var _b = tslib.__asyncValues(this.listSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
15181
- const segment = _c.value;
15182
- if (segment.shareItems) {
15183
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.shareItems)));
15201
+ for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
15202
+ _c = _f.value;
15203
+ _d = false;
15204
+ try {
15205
+ const segment = _c;
15206
+ if (segment.shareItems) {
15207
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.shareItems)));
15208
+ }
15209
+ }
15210
+ finally {
15211
+ _d = true;
15184
15212
  }
15185
15213
  }
15186
15214
  }
15187
15215
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
15188
15216
  finally {
15189
15217
  try {
15190
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
15218
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
15191
15219
  }
15192
15220
  finally { if (e_1) throw e_1.error; }
15193
15221
  }