@azure/storage-blob 12.8.1-alpha.20211015.4 → 12.9.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +5 -6
  2. package/dist/index.js +270 -22
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  5. package/dist-esm/storage-blob/src/Clients.js +1 -1
  6. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  7. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
  8. package/dist-esm/storage-blob/src/generated/src/models/mappers.js +7 -0
  9. package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
  10. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
  11. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
  12. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +1 -0
  13. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
  14. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +2 -2
  15. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
  16. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +13 -0
  17. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -1
  18. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +43 -15
  19. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -1
  20. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js +13 -0
  21. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js.map +1 -1
  22. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +167 -0
  23. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
  24. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +13 -0
  25. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
  26. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +7 -1
  27. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -1
  28. package/dist-esm/storage-blob/src/utils/constants.js +2 -2
  29. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  30. package/package.json +7 -7
  31. package/typings/3.1/storage-blob.d.ts +56 -1
  32. package/typings/latest/storage-blob.d.ts +56 -1
package/CHANGELOG.md CHANGED
@@ -1,14 +1,13 @@
1
1
  # Release History
2
2
 
3
- ## 12.8.1 (Unreleased)
3
+ ## 12.9.0-beta.1 (2021-11-09)
4
4
 
5
5
  ### Features Added
6
6
 
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
7
+ - Added support for service version 2020-12-06.
8
+ - Added support for Encryption Scope SAS.
9
+ - Added support for Encryption Scopes with BlobBaseClient.SyncCopyFromUriAsync().
10
+ - Added support for generating SAS URLs with the Permanent Delete ('y') SAS permission.
12
11
 
13
12
  ## 12.8.0 (2021-09-10)
14
13
 
package/dist/index.js CHANGED
@@ -5625,6 +5625,13 @@ const BlobCopyFromURLHeaders = {
5625
5625
  name: "ByteArray"
5626
5626
  }
5627
5627
  },
5628
+ encryptionScope: {
5629
+ serializedName: "x-ms-encryption-scope",
5630
+ xmlName: "x-ms-encryption-scope",
5631
+ type: {
5632
+ name: "String"
5633
+ }
5634
+ },
5628
5635
  errorCode: {
5629
5636
  serializedName: "x-ms-error-code",
5630
5637
  xmlName: "x-ms-error-code",
@@ -8380,7 +8387,7 @@ const timeoutInSeconds = {
8380
8387
  const version = {
8381
8388
  parameterPath: "version",
8382
8389
  mapper: {
8383
- defaultValue: "2020-10-02",
8390
+ defaultValue: "2020-12-06",
8384
8391
  isConstant: true,
8385
8392
  serializedName: "x-ms-version",
8386
8393
  type: {
@@ -11824,6 +11831,7 @@ const copyFromURLOperationSpec = {
11824
11831
  ifTags,
11825
11832
  immutabilityPolicyExpiry,
11826
11833
  immutabilityPolicyMode,
11834
+ encryptionScope,
11827
11835
  tier,
11828
11836
  sourceIfModifiedSince,
11829
11837
  sourceIfUnmodifiedSince,
@@ -13150,8 +13158,8 @@ const logger = logger$1.createClientLogger("storage-blob");
13150
13158
 
13151
13159
  // Copyright (c) Microsoft Corporation.
13152
13160
  // Licensed under the MIT license.
13153
- const SDK_VERSION = "12.8.1";
13154
- const SERVICE_VERSION = "2020-10-02";
13161
+ const SDK_VERSION = "12.9.0-beta.1";
13162
+ const SERVICE_VERSION = "2020-12-06";
13155
13163
  const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
13156
13164
  const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
13157
13165
  const BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -14641,7 +14649,7 @@ class StorageSharedKeyCredential extends Credential {
14641
14649
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
14642
14650
  */
14643
14651
  const packageName = "azure-storage-blob";
14644
- const packageVersion = "12.8.1";
14652
+ const packageVersion = "12.9.0-beta.1";
14645
14653
  class StorageClientContext extends coreHttp.ServiceClient {
14646
14654
  /**
14647
14655
  * Initializes a new instance of the StorageClientContext class.
@@ -14667,7 +14675,7 @@ class StorageClientContext extends coreHttp.ServiceClient {
14667
14675
  // Parameter assignments
14668
14676
  this.url = url;
14669
14677
  // Assigning values to Constant parameters
14670
- this.version = options.version || "2020-10-02";
14678
+ this.version = options.version || "2020-12-06";
14671
14679
  }
14672
14680
  }
14673
14681
 
@@ -14785,6 +14793,10 @@ class BlobSASPermissions {
14785
14793
  * Specifies SetImmutabilityPolicy access granted.
14786
14794
  */
14787
14795
  this.setImmutabilityPolicy = false;
14796
+ /**
14797
+ * Specifies that Permanent Delete is permitted.
14798
+ */
14799
+ this.permanentDelete = false;
14788
14800
  }
14789
14801
  /**
14790
14802
  * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
@@ -14826,6 +14838,9 @@ class BlobSASPermissions {
14826
14838
  case "i":
14827
14839
  blobSASPermissions.setImmutabilityPolicy = true;
14828
14840
  break;
14841
+ case "y":
14842
+ blobSASPermissions.permanentDelete = true;
14843
+ break;
14829
14844
  default:
14830
14845
  throw new RangeError(`Invalid permission: ${char}`);
14831
14846
  }
@@ -14870,6 +14885,9 @@ class BlobSASPermissions {
14870
14885
  if (permissionLike.setImmutabilityPolicy) {
14871
14886
  blobSASPermissions.setImmutabilityPolicy = true;
14872
14887
  }
14888
+ if (permissionLike.permanentDelete) {
14889
+ blobSASPermissions.permanentDelete = true;
14890
+ }
14873
14891
  return blobSASPermissions;
14874
14892
  }
14875
14893
  /**
@@ -14910,6 +14928,9 @@ class BlobSASPermissions {
14910
14928
  if (this.setImmutabilityPolicy) {
14911
14929
  permissions.push("i");
14912
14930
  }
14931
+ if (this.permanentDelete) {
14932
+ permissions.push("y");
14933
+ }
14913
14934
  return permissions.join("");
14914
14935
  }
14915
14936
  }
@@ -14969,6 +14990,10 @@ class ContainerSASPermissions {
14969
14990
  * Specifies SetImmutabilityPolicy access granted.
14970
14991
  */
14971
14992
  this.setImmutabilityPolicy = false;
14993
+ /**
14994
+ * Specifies that Permanent Delete is permitted.
14995
+ */
14996
+ this.permanentDelete = false;
14972
14997
  }
14973
14998
  /**
14974
14999
  * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
@@ -15013,6 +15038,9 @@ class ContainerSASPermissions {
15013
15038
  case "i":
15014
15039
  containerSASPermissions.setImmutabilityPolicy = true;
15015
15040
  break;
15041
+ case "y":
15042
+ containerSASPermissions.permanentDelete = true;
15043
+ break;
15016
15044
  default:
15017
15045
  throw new RangeError(`Invalid permission ${char}`);
15018
15046
  }
@@ -15060,6 +15088,9 @@ class ContainerSASPermissions {
15060
15088
  if (permissionLike.setImmutabilityPolicy) {
15061
15089
  containerSASPermissions.setImmutabilityPolicy = true;
15062
15090
  }
15091
+ if (permissionLike.permanentDelete) {
15092
+ containerSASPermissions.permanentDelete = true;
15093
+ }
15063
15094
  return containerSASPermissions;
15064
15095
  }
15065
15096
  /**
@@ -15105,6 +15136,9 @@ class ContainerSASPermissions {
15105
15136
  if (this.setImmutabilityPolicy) {
15106
15137
  permissions.push("i");
15107
15138
  }
15139
+ if (this.permanentDelete) {
15140
+ permissions.push("y");
15141
+ }
15108
15142
  return permissions.join("");
15109
15143
  }
15110
15144
  }
@@ -15174,7 +15208,7 @@ function ipRangeToString(ipRange) {
15174
15208
  * NOTE: Instances of this class are immutable.
15175
15209
  */
15176
15210
  class SASQueryParameters {
15177
- constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId) {
15211
+ constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) {
15178
15212
  this.version = version;
15179
15213
  this.signature = signature;
15180
15214
  if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
@@ -15187,6 +15221,7 @@ class SASQueryParameters {
15187
15221
  this.expiresOn = permissionsOrOptions.expiresOn;
15188
15222
  this.ipRangeInner = permissionsOrOptions.ipRange;
15189
15223
  this.identifier = permissionsOrOptions.identifier;
15224
+ this.encryptionScope = permissionsOrOptions.encryptionScope;
15190
15225
  this.resource = permissionsOrOptions.resource;
15191
15226
  this.cacheControl = permissionsOrOptions.cacheControl;
15192
15227
  this.contentDisposition = permissionsOrOptions.contentDisposition;
@@ -15212,6 +15247,7 @@ class SASQueryParameters {
15212
15247
  this.protocol = protocol;
15213
15248
  this.startsOn = startsOn;
15214
15249
  this.ipRangeInner = ipRange;
15250
+ this.encryptionScope = encryptionScope;
15215
15251
  this.identifier = identifier;
15216
15252
  this.resource = resource;
15217
15253
  this.cacheControl = cacheControl;
@@ -15259,6 +15295,7 @@ class SASQueryParameters {
15259
15295
  "se",
15260
15296
  "sip",
15261
15297
  "si",
15298
+ "ses",
15262
15299
  "skoid",
15263
15300
  "sktid",
15264
15301
  "skt",
@@ -15303,6 +15340,9 @@ class SASQueryParameters {
15303
15340
  case "si":
15304
15341
  this.tryAppendQueryParameter(queries, param, this.identifier);
15305
15342
  break;
15343
+ case "ses":
15344
+ this.tryAppendQueryParameter(queries, param, this.encryptionScope);
15345
+ break;
15306
15346
  case "skoid": // Signed object ID
15307
15347
  this.tryAppendQueryParameter(queries, param, this.signedOid);
15308
15348
  break;
@@ -15387,6 +15427,15 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
15387
15427
  if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {
15388
15428
  throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");
15389
15429
  }
15430
+ // Version 2020-12-06 adds support for encryptionscope in SAS.
15431
+ if (version >= "2020-12-06") {
15432
+ if (sharedKeyCredential !== undefined) {
15433
+ return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);
15434
+ }
15435
+ else {
15436
+ return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);
15437
+ }
15438
+ }
15390
15439
  // Version 2019-12-12 adds support for the blob tags permission.
15391
15440
  // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.
15392
15441
  // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string
@@ -15542,6 +15591,76 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
15542
15591
  const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
15543
15592
  return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType);
15544
15593
  }
15594
+ /**
15595
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
15596
+ * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
15597
+ *
15598
+ * Creates an instance of SASQueryParameters.
15599
+ *
15600
+ * Only accepts required settings needed to create a SAS. For optional settings please
15601
+ * set corresponding properties directly, such as permissions, startsOn and identifier.
15602
+ *
15603
+ * WARNING: When identifier is not provided, permissions and expiresOn are required.
15604
+ * You MUST assign value to identifier or expiresOn & permissions manually if you initial with
15605
+ * this constructor.
15606
+ *
15607
+ * @param blobSASSignatureValues -
15608
+ * @param sharedKeyCredential -
15609
+ */
15610
+ function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) {
15611
+ blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
15612
+ if (!blobSASSignatureValues.identifier &&
15613
+ !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {
15614
+ throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
15615
+ }
15616
+ let resource = "c";
15617
+ let timestamp = blobSASSignatureValues.snapshotTime;
15618
+ if (blobSASSignatureValues.blobName) {
15619
+ resource = "b";
15620
+ if (blobSASSignatureValues.snapshotTime) {
15621
+ resource = "bs";
15622
+ }
15623
+ else if (blobSASSignatureValues.versionId) {
15624
+ resource = "bv";
15625
+ timestamp = blobSASSignatureValues.versionId;
15626
+ }
15627
+ }
15628
+ // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
15629
+ let verifiedPermissions;
15630
+ if (blobSASSignatureValues.permissions) {
15631
+ if (blobSASSignatureValues.blobName) {
15632
+ verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
15633
+ }
15634
+ else {
15635
+ verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
15636
+ }
15637
+ }
15638
+ // Signature is generated on the un-url-encoded values.
15639
+ const stringToSign = [
15640
+ verifiedPermissions ? verifiedPermissions : "",
15641
+ blobSASSignatureValues.startsOn
15642
+ ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
15643
+ : "",
15644
+ blobSASSignatureValues.expiresOn
15645
+ ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
15646
+ : "",
15647
+ getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
15648
+ blobSASSignatureValues.identifier,
15649
+ blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
15650
+ blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
15651
+ blobSASSignatureValues.version,
15652
+ resource,
15653
+ timestamp,
15654
+ blobSASSignatureValues.encryptionScope,
15655
+ blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
15656
+ blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
15657
+ blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
15658
+ blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
15659
+ blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
15660
+ ].join("\n");
15661
+ const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
15662
+ return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope);
15663
+ }
15545
15664
  /**
15546
15665
  * ONLY AVAILABLE IN NODE.JS RUNTIME.
15547
15666
  * IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
@@ -15697,6 +15816,86 @@ function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userD
15697
15816
  const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
15698
15817
  return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId);
15699
15818
  }
15819
+ /**
15820
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
15821
+ * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
15822
+ *
15823
+ * Creates an instance of SASQueryParameters.
15824
+ *
15825
+ * Only accepts required settings needed to create a SAS. For optional settings please
15826
+ * set corresponding properties directly, such as permissions, startsOn.
15827
+ *
15828
+ * WARNING: identifier will be ignored, permissions and expiresOn are required.
15829
+ *
15830
+ * @param blobSASSignatureValues -
15831
+ * @param userDelegationKeyCredential -
15832
+ */
15833
+ function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) {
15834
+ blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
15835
+ // Stored access policies are not supported for a user delegation SAS.
15836
+ if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
15837
+ throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
15838
+ }
15839
+ let resource = "c";
15840
+ let timestamp = blobSASSignatureValues.snapshotTime;
15841
+ if (blobSASSignatureValues.blobName) {
15842
+ resource = "b";
15843
+ if (blobSASSignatureValues.snapshotTime) {
15844
+ resource = "bs";
15845
+ }
15846
+ else if (blobSASSignatureValues.versionId) {
15847
+ resource = "bv";
15848
+ timestamp = blobSASSignatureValues.versionId;
15849
+ }
15850
+ }
15851
+ // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
15852
+ let verifiedPermissions;
15853
+ if (blobSASSignatureValues.permissions) {
15854
+ if (blobSASSignatureValues.blobName) {
15855
+ verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
15856
+ }
15857
+ else {
15858
+ verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
15859
+ }
15860
+ }
15861
+ // Signature is generated on the un-url-encoded values.
15862
+ const stringToSign = [
15863
+ verifiedPermissions ? verifiedPermissions : "",
15864
+ blobSASSignatureValues.startsOn
15865
+ ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
15866
+ : "",
15867
+ blobSASSignatureValues.expiresOn
15868
+ ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
15869
+ : "",
15870
+ getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
15871
+ userDelegationKeyCredential.userDelegationKey.signedObjectId,
15872
+ userDelegationKeyCredential.userDelegationKey.signedTenantId,
15873
+ userDelegationKeyCredential.userDelegationKey.signedStartsOn
15874
+ ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
15875
+ : "",
15876
+ userDelegationKeyCredential.userDelegationKey.signedExpiresOn
15877
+ ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
15878
+ : "",
15879
+ userDelegationKeyCredential.userDelegationKey.signedService,
15880
+ userDelegationKeyCredential.userDelegationKey.signedVersion,
15881
+ blobSASSignatureValues.preauthorizedAgentObjectId,
15882
+ undefined,
15883
+ blobSASSignatureValues.correlationId,
15884
+ blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
15885
+ blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
15886
+ blobSASSignatureValues.version,
15887
+ resource,
15888
+ timestamp,
15889
+ blobSASSignatureValues.encryptionScope,
15890
+ blobSASSignatureValues.cacheControl,
15891
+ blobSASSignatureValues.contentDisposition,
15892
+ blobSASSignatureValues.contentEncoding,
15893
+ blobSASSignatureValues.contentLanguage,
15894
+ blobSASSignatureValues.contentType
15895
+ ].join("\n");
15896
+ const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
15897
+ return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope);
15898
+ }
15700
15899
  function getCanonicalName(accountName, containerName, blobName) {
15701
15900
  // Container: "/blob/account/containerName"
15702
15901
  // Blob: "/blob/account/containerName/blobName"
@@ -15730,6 +15929,11 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
15730
15929
  version < "2019-10-10") {
15731
15930
  throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
15732
15931
  }
15932
+ if (blobSASSignatureValues.permissions &&
15933
+ blobSASSignatureValues.permissions.permanentDelete &&
15934
+ version < "2019-10-10") {
15935
+ throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");
15936
+ }
15733
15937
  if (blobSASSignatureValues.permissions &&
15734
15938
  blobSASSignatureValues.permissions.tag &&
15735
15939
  version < "2019-12-12") {
@@ -15744,6 +15948,9 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
15744
15948
  (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
15745
15949
  throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
15746
15950
  }
15951
+ if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") {
15952
+ throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
15953
+ }
15747
15954
  blobSASSignatureValues.version = version;
15748
15955
  return blobSASSignatureValues;
15749
15956
  }
@@ -19095,7 +19302,7 @@ class BlobClient extends StorageClient {
19095
19302
  sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
19096
19303
  sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
19097
19304
  sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
19098
- }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold }, convertTracingToRequestOptionsBase(updatedOptions)));
19305
+ }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
19099
19306
  }
19100
19307
  catch (e) {
19101
19308
  span.setStatus({
@@ -22464,6 +22671,10 @@ class AccountSASPermissions {
22464
22671
  * Permission to set immutability policy.
22465
22672
  */
22466
22673
  this.setImmutabilityPolicy = false;
22674
+ /**
22675
+ * Specifies that Permanent Delete is permitted.
22676
+ */
22677
+ this.permanentDelete = false;
22467
22678
  }
22468
22679
  /**
22469
22680
  * Parse initializes the AccountSASPermissions fields from a string.
@@ -22510,6 +22721,9 @@ class AccountSASPermissions {
22510
22721
  case "i":
22511
22722
  accountSASPermissions.setImmutabilityPolicy = true;
22512
22723
  break;
22724
+ case "y":
22725
+ accountSASPermissions.permanentDelete = true;
22726
+ break;
22513
22727
  default:
22514
22728
  throw new RangeError(`Invalid permission character: ${c}`);
22515
22729
  }
@@ -22560,6 +22774,9 @@ class AccountSASPermissions {
22560
22774
  if (permissionLike.setImmutabilityPolicy) {
22561
22775
  accountSASPermissions.setImmutabilityPolicy = true;
22562
22776
  }
22777
+ if (permissionLike.permanentDelete) {
22778
+ accountSASPermissions.permanentDelete = true;
22779
+ }
22563
22780
  return accountSASPermissions;
22564
22781
  }
22565
22782
  /**
@@ -22613,6 +22830,9 @@ class AccountSASPermissions {
22613
22830
  if (this.setImmutabilityPolicy) {
22614
22831
  permissions.push("i");
22615
22832
  }
22833
+ if (this.permanentDelete) {
22834
+ permissions.push("y");
22835
+ }
22616
22836
  return permissions.join("");
22617
22837
  }
22618
22838
  }
@@ -22795,6 +23015,11 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
22795
23015
  version < "2019-10-10") {
22796
23016
  throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
22797
23017
  }
23018
+ if (accountSASSignatureValues.permissions &&
23019
+ accountSASSignatureValues.permissions.permanentDelete &&
23020
+ version < "2019-10-10") {
23021
+ throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.");
23022
+ }
22798
23023
  if (accountSASSignatureValues.permissions &&
22799
23024
  accountSASSignatureValues.permissions.tag &&
22800
23025
  version < "2019-12-12") {
@@ -22805,25 +23030,48 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
22805
23030
  version < "2019-12-12") {
22806
23031
  throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.");
22807
23032
  }
23033
+ if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") {
23034
+ throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
23035
+ }
22808
23036
  const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString());
22809
23037
  const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();
22810
23038
  const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString();
22811
- const stringToSign = [
22812
- sharedKeyCredential.accountName,
22813
- parsedPermissions,
22814
- parsedServices,
22815
- parsedResourceTypes,
22816
- accountSASSignatureValues.startsOn
22817
- ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
22818
- : "",
22819
- truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
22820
- accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
22821
- accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
22822
- version,
22823
- "" // Account SAS requires an additional newline character
22824
- ].join("\n");
23039
+ let stringToSign;
23040
+ if (version >= "2020-12-06") {
23041
+ stringToSign = [
23042
+ sharedKeyCredential.accountName,
23043
+ parsedPermissions,
23044
+ parsedServices,
23045
+ parsedResourceTypes,
23046
+ accountSASSignatureValues.startsOn
23047
+ ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
23048
+ : "",
23049
+ truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
23050
+ accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
23051
+ accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
23052
+ version,
23053
+ accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "",
23054
+ "" // Account SAS requires an additional newline character
23055
+ ].join("\n");
23056
+ }
23057
+ else {
23058
+ stringToSign = [
23059
+ sharedKeyCredential.accountName,
23060
+ parsedPermissions,
23061
+ parsedServices,
23062
+ parsedResourceTypes,
23063
+ accountSASSignatureValues.startsOn
23064
+ ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
23065
+ : "",
23066
+ truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
23067
+ accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
23068
+ accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
23069
+ version,
23070
+ "" // Account SAS requires an additional newline character
23071
+ ].join("\n");
23072
+ }
22825
23073
  const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
22826
- return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange);
23074
+ return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope);
22827
23075
  }
22828
23076
 
22829
23077
  /**