@azure/storage-file-share 12.27.0-beta.1 → 12.27.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/README.md CHANGED
@@ -190,9 +190,7 @@ const { ShareServiceClient } = require("@azure/storage-file-share");
190
190
  const account = "<account name>";
191
191
  const sas = "<service Shared Access Signature Token>";
192
192
 
193
- const serviceClientWithSAS = new ShareServiceClient(
194
- `https://${account}.file.core.windows.net${sas}`,
195
- );
193
+ const serviceClientWithSAS = new ShareServiceClient(`https://${account}.file.core.windows.net?${sas}`);
196
194
  ```
197
195
 
198
196
  ### List shares in the account
@@ -414,7 +412,7 @@ async function streamToBuffer(readableStream) {
414
412
  return new Promise((resolve, reject) => {
415
413
  const chunks = [];
416
414
  readableStream.on("data", (data) => {
417
- chunks.push(data instanceof Buffer ? data : Buffer.from(data));
415
+ chunks.push(typeof data === "string" ? Buffer.from(data) : data);
418
416
  });
419
417
  readableStream.on("end", () => {
420
418
  resolve(Buffer.concat(chunks));
@@ -453,7 +451,7 @@ const sas = "<service Shared Access Signature Token>";
453
451
  const shareName = "<share name>";
454
452
  const fileName = "<file name>";
455
453
 
456
- const serviceClient = new ShareServiceClient(`https://${account}.file.core.windows.net${sas}`);
454
+ const serviceClient = new ShareServiceClient(`https://${account}.file.core.windows.net?${sas}`);
457
455
 
458
456
  async function main() {
459
457
  const fileClient = serviceClient
package/dist/index.js CHANGED
@@ -336,7 +336,7 @@ function ipRangeToString(ipRange) {
336
336
 
337
337
  // Copyright (c) Microsoft Corporation.
338
338
  // Licensed under the MIT License.
339
- const SDK_VERSION = "12.27.0-beta.1";
339
+ const SDK_VERSION = "12.27.0";
340
340
  const SERVICE_VERSION = "2025-05-05";
341
341
  const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
342
342
  const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
@@ -12539,7 +12539,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
12539
12539
  const defaults = {
12540
12540
  requestContentType: "application/json; charset=utf-8"
12541
12541
  };
12542
- const packageDetails = `azsdk-js-azure-storage-file-share/12.27.0-beta.1`;
12542
+ const packageDetails = `azsdk-js-azure-storage-file-share/12.27.0`;
12543
12543
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
12544
12544
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
12545
12545
  : `${packageDetails}`;
@@ -13050,28 +13050,10 @@ class FileDownloadResponse {
13050
13050
  return this.originalResponse.leaseStatus;
13051
13051
  }
13052
13052
  /**
13053
- * NFS only. The mode of the file or directory.
13053
+ * Properties of NFS files
13054
13054
  */
13055
- get fileMode() {
13056
- return this.originalResponse.fileMode;
13057
- }
13058
- /**
13059
- * TNFS only. The owner of the file or directory.
13060
- */
13061
- get owner() {
13062
- return this.originalResponse.owner;
13063
- }
13064
- /**
13065
- * NFS only. The owning group of the file or directory.
13066
- */
13067
- get group() {
13068
- return this.originalResponse.group;
13069
- }
13070
- /**
13071
- * NFS only. The link count of the file or directory.
13072
- */
13073
- get linkCount() {
13074
- return this.originalResponse.linkCount;
13055
+ get posixProperties() {
13056
+ return this.originalResponse.posixProperties;
13075
13057
  }
13076
13058
  /**
13077
13059
  * The response body as a node.js Readable stream.
@@ -14392,7 +14374,12 @@ class ShareDirectoryClient extends StorageClient {
14392
14374
  const rawResponse = await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
14393
14375
  ? fileAttributesToString(updatedOptions.fileAttributes)
14394
14376
  : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
14395
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) });
14377
+ const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
14378
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
14379
+ fileType: rawResponse.nfsFileType,
14380
+ owner: rawResponse.owner,
14381
+ group: rawResponse.group,
14382
+ } });
14396
14383
  return assertResponse(wrappedRes);
14397
14384
  });
14398
14385
  }
@@ -14432,7 +14419,11 @@ class ShareDirectoryClient extends StorageClient {
14432
14419
  const rawResponse = await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
14433
14420
  ? fileAttributesToString(updatedOptions.fileAttributes)
14434
14421
  : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
14435
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
14422
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
14423
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
14424
+ owner: rawResponse.owner,
14425
+ group: rawResponse.group,
14426
+ } }));
14436
14427
  });
14437
14428
  }
14438
14429
  /**
@@ -14588,7 +14579,12 @@ class ShareDirectoryClient extends StorageClient {
14588
14579
  async getProperties(options = {}) {
14589
14580
  return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
14590
14581
  const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
14591
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
14582
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
14583
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
14584
+ owner: rawResponse.owner,
14585
+ group: rawResponse.group,
14586
+ fileType: rawResponse.nfsFileType,
14587
+ } }));
14592
14588
  });
14593
14589
  }
14594
14590
  /**
@@ -15237,7 +15233,12 @@ class ShareFileClient extends StorageClient {
15237
15233
  const rawResponse = await this.context.create(size, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
15238
15234
  ? fileAttributesToString(updatedOptions.fileAttributes)
15239
15235
  : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), nfsFileType: (_d = updatedOptions.posixProperties) === null || _d === void 0 ? void 0 : _d.fileType }), this.shareClientConfig));
15240
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) });
15236
+ const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
15237
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
15238
+ fileType: rawResponse.nfsFileType,
15239
+ owner: rawResponse.owner,
15240
+ group: rawResponse.group,
15241
+ } });
15241
15242
  return assertResponse(wrappedRes);
15242
15243
  });
15243
15244
  }
@@ -15269,7 +15270,7 @@ class ShareFileClient extends StorageClient {
15269
15270
  * return new Promise((resolve, reject) => {
15270
15271
  * const chunks = [];
15271
15272
  * readableStream.on("data", (data) => {
15272
- * chunks.push(data instanceof Buffer ? data : Buffer.from(data));
15273
+ * chunks.push(typeof data === "string" ? Buffer.from(data) : data);
15273
15274
  * });
15274
15275
  * readableStream.on("end", () => {
15275
15276
  * resolve(Buffer.concat(chunks));
@@ -15311,7 +15312,12 @@ class ShareFileClient extends StorageClient {
15311
15312
  const rawResponse = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
15312
15313
  onDownloadProgress: coreUtil.isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
15313
15314
  }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig));
15314
- const res = assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
15315
+ const res = assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
15316
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
15317
+ owner: rawResponse.owner,
15318
+ group: rawResponse.group,
15319
+ linkCount: rawResponse.linkCount,
15320
+ } }));
15315
15321
  // Return browser response immediately
15316
15322
  if (!coreUtil.isNode) {
15317
15323
  return res;
@@ -15386,7 +15392,13 @@ class ShareFileClient extends StorageClient {
15386
15392
  async getProperties(options = {}) {
15387
15393
  return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
15388
15394
  const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
15389
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
15395
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
15396
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
15397
+ fileType: rawResponse.nfsFileType,
15398
+ owner: rawResponse.owner,
15399
+ group: rawResponse.group,
15400
+ linkCount: rawResponse.linkCount,
15401
+ } }));
15390
15402
  });
15391
15403
  }
15392
15404
  /**
@@ -15406,7 +15418,12 @@ class ShareFileClient extends StorageClient {
15406
15418
  const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
15407
15419
  ? fileAttributesToString(updatedOptions.fileAttributes)
15408
15420
  : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
15409
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
15421
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
15422
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
15423
+ owner: rawResponse.owner,
15424
+ group: rawResponse.group,
15425
+ linkCount: rawResponse.linkCount,
15426
+ } }));
15410
15427
  });
15411
15428
  }
15412
15429
  /**
@@ -15483,7 +15500,12 @@ class ShareFileClient extends StorageClient {
15483
15500
  const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileAttributes: updatedOptions.fileAttributes
15484
15501
  ? fileAttributesToString(updatedOptions.fileAttributes)
15485
15502
  : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
15486
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
15503
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
15504
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
15505
+ owner: rawResponse.owner,
15506
+ group: rawResponse.group,
15507
+ linkCount: rawResponse.linkCount,
15508
+ } }));
15487
15509
  });
15488
15510
  }
15489
15511
  /**
@@ -15506,7 +15528,12 @@ class ShareFileClient extends StorageClient {
15506
15528
  return tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
15507
15529
  var _a, _b, _c;
15508
15530
  const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileAttributes: fileAttributesToString(updatedOptions.fileAttributes), owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = options.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
15509
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
15531
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
15532
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
15533
+ owner: rawResponse.owner,
15534
+ group: rawResponse.group,
15535
+ linkCount: rawResponse.linkCount,
15536
+ } }));
15510
15537
  });
15511
15538
  }
15512
15539
  /**
@@ -16170,7 +16197,13 @@ class ShareFileClient extends StorageClient {
16170
16197
  async createHardLink(targetFile, options = {}) {
16171
16198
  return tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
16172
16199
  const rawResponse = await this.context.createHardLink(targetFile, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
16173
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
16200
+ return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
16201
+ fileMode: parseOctalFileMode(rawResponse.fileMode),
16202
+ fileType: rawResponse.nfsFileType,
16203
+ owner: rawResponse.owner,
16204
+ group: rawResponse.group,
16205
+ linkCount: rawResponse.linkCount,
16206
+ } }));
16174
16207
  });
16175
16208
  }
16176
16209
  /**