@azure/storage-blob 12.8.1-alpha.20211102.1 → 12.9.0-alpha.20211202.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/CHANGELOG.md +10 -1
- package/dist/index.js +513 -31
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js +3 -0
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +1 -1
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +23 -5
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js +35 -4
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +2 -2
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/blob.js +1 -0
- package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +2 -2
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +13 -0
- package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +43 -15
- package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js +13 -0
- package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +167 -0
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +13 -0
- package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +7 -1
- package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +2 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +196 -0
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/package.json +1 -1
- package/typings/3.1/storage-blob.d.ts +62 -7
- package/typings/latest/storage-blob.d.ts +62 -9
package/dist/index.js
CHANGED
@@ -970,10 +970,10 @@ const BlobItemInternal = {
|
|
970
970
|
modelProperties: {
|
971
971
|
name: {
|
972
972
|
serializedName: "Name",
|
973
|
-
required: true,
|
974
973
|
xmlName: "Name",
|
975
974
|
type: {
|
976
|
-
name: "
|
975
|
+
name: "Composite",
|
976
|
+
className: "BlobName"
|
977
977
|
}
|
978
978
|
},
|
979
979
|
deleted: {
|
@@ -1048,6 +1048,30 @@ const BlobItemInternal = {
|
|
1048
1048
|
}
|
1049
1049
|
}
|
1050
1050
|
};
|
1051
|
+
const BlobName = {
|
1052
|
+
serializedName: "BlobName",
|
1053
|
+
type: {
|
1054
|
+
name: "Composite",
|
1055
|
+
className: "BlobName",
|
1056
|
+
modelProperties: {
|
1057
|
+
encoded: {
|
1058
|
+
serializedName: "Encoded",
|
1059
|
+
xmlName: "Encoded",
|
1060
|
+
xmlIsAttribute: true,
|
1061
|
+
type: {
|
1062
|
+
name: "Boolean"
|
1063
|
+
}
|
1064
|
+
},
|
1065
|
+
content: {
|
1066
|
+
serializedName: "content",
|
1067
|
+
xmlName: "content",
|
1068
|
+
type: {
|
1069
|
+
name: "String"
|
1070
|
+
}
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
}
|
1074
|
+
};
|
1051
1075
|
const BlobPropertiesInternal = {
|
1052
1076
|
serializedName: "BlobPropertiesInternal",
|
1053
1077
|
xmlName: "Properties",
|
@@ -1491,10 +1515,10 @@ const BlobPrefix = {
|
|
1491
1515
|
modelProperties: {
|
1492
1516
|
name: {
|
1493
1517
|
serializedName: "Name",
|
1494
|
-
required: true,
|
1495
1518
|
xmlName: "Name",
|
1496
1519
|
type: {
|
1497
|
-
name: "
|
1520
|
+
name: "Composite",
|
1521
|
+
className: "BlobName"
|
1498
1522
|
}
|
1499
1523
|
}
|
1500
1524
|
}
|
@@ -5625,6 +5649,13 @@ const BlobCopyFromURLHeaders = {
|
|
5625
5649
|
name: "ByteArray"
|
5626
5650
|
}
|
5627
5651
|
},
|
5652
|
+
encryptionScope: {
|
5653
|
+
serializedName: "x-ms-encryption-scope",
|
5654
|
+
xmlName: "x-ms-encryption-scope",
|
5655
|
+
type: {
|
5656
|
+
name: "String"
|
5657
|
+
}
|
5658
|
+
},
|
5628
5659
|
errorCode: {
|
5629
5660
|
serializedName: "x-ms-error-code",
|
5630
5661
|
xmlName: "x-ms-error-code",
|
@@ -8142,6 +8173,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
8142
8173
|
ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse,
|
8143
8174
|
BlobFlatListSegment: BlobFlatListSegment,
|
8144
8175
|
BlobItemInternal: BlobItemInternal,
|
8176
|
+
BlobName: BlobName,
|
8145
8177
|
BlobPropertiesInternal: BlobPropertiesInternal,
|
8146
8178
|
ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse,
|
8147
8179
|
BlobHierarchyListSegment: BlobHierarchyListSegment,
|
@@ -8380,7 +8412,7 @@ const timeoutInSeconds = {
|
|
8380
8412
|
const version = {
|
8381
8413
|
parameterPath: "version",
|
8382
8414
|
mapper: {
|
8383
|
-
defaultValue: "
|
8415
|
+
defaultValue: "2021-02-12",
|
8384
8416
|
isConstant: true,
|
8385
8417
|
serializedName: "x-ms-version",
|
8386
8418
|
type: {
|
@@ -8475,7 +8507,7 @@ const include = {
|
|
8475
8507
|
element: {
|
8476
8508
|
type: {
|
8477
8509
|
name: "Enum",
|
8478
|
-
allowedValues: ["metadata", "deleted"]
|
8510
|
+
allowedValues: ["metadata", "deleted", "system"]
|
8479
8511
|
}
|
8480
8512
|
}
|
8481
8513
|
}
|
@@ -11824,6 +11856,7 @@ const copyFromURLOperationSpec = {
|
|
11824
11856
|
ifTags,
|
11825
11857
|
immutabilityPolicyExpiry,
|
11826
11858
|
immutabilityPolicyMode,
|
11859
|
+
encryptionScope,
|
11827
11860
|
tier,
|
11828
11861
|
sourceIfModifiedSince,
|
11829
11862
|
sourceIfUnmodifiedSince,
|
@@ -13150,8 +13183,8 @@ const logger = logger$1.createClientLogger("storage-blob");
|
|
13150
13183
|
|
13151
13184
|
// Copyright (c) Microsoft Corporation.
|
13152
13185
|
// Licensed under the MIT license.
|
13153
|
-
const SDK_VERSION = "12.
|
13154
|
-
const SERVICE_VERSION = "
|
13186
|
+
const SDK_VERSION = "12.9.0-beta.2";
|
13187
|
+
const SERVICE_VERSION = "2021-02-12";
|
13155
13188
|
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
|
13156
13189
|
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
|
13157
13190
|
const BLOCK_BLOB_MAX_BLOCKS = 50000;
|
@@ -13939,6 +13972,194 @@ function attachCredential(thing, credential) {
|
|
13939
13972
|
function httpAuthorizationToString(httpAuthorization) {
|
13940
13973
|
return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
|
13941
13974
|
}
|
13975
|
+
function BlobNameToString(name) {
|
13976
|
+
if (name.encoded) {
|
13977
|
+
return decodeURIComponent(name.content);
|
13978
|
+
}
|
13979
|
+
else {
|
13980
|
+
return name.content;
|
13981
|
+
}
|
13982
|
+
}
|
13983
|
+
function ConvertInternalResponseOfListBlobFlat(internalResponse) {
|
13984
|
+
return Object.assign(Object.assign({}, internalResponse), { segment: {
|
13985
|
+
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
|
13986
|
+
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
|
13987
|
+
return blobItem;
|
13988
|
+
})
|
13989
|
+
} });
|
13990
|
+
}
|
13991
|
+
function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
|
13992
|
+
var _a;
|
13993
|
+
return Object.assign(Object.assign({}, internalResponse), { segment: {
|
13994
|
+
blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
|
13995
|
+
const blobPrefix = {
|
13996
|
+
name: BlobNameToString(blobPrefixInternal.name)
|
13997
|
+
};
|
13998
|
+
return blobPrefix;
|
13999
|
+
}),
|
14000
|
+
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
|
14001
|
+
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
|
14002
|
+
return blobItem;
|
14003
|
+
})
|
14004
|
+
} });
|
14005
|
+
}
|
14006
|
+
function decodeBase64String(value) {
|
14007
|
+
{
|
14008
|
+
return Buffer.from(value, "base64");
|
14009
|
+
}
|
14010
|
+
}
|
14011
|
+
function ParseBoolean(content) {
|
14012
|
+
if (content === undefined)
|
14013
|
+
return undefined;
|
14014
|
+
if (content === "true")
|
14015
|
+
return true;
|
14016
|
+
if (content === "false")
|
14017
|
+
return false;
|
14018
|
+
return undefined;
|
14019
|
+
}
|
14020
|
+
function ParseBlobName(blobNameInXML) {
|
14021
|
+
if (blobNameInXML["$"] !== undefined && blobNameInXML["#"] !== undefined) {
|
14022
|
+
return {
|
14023
|
+
encoded: ParseBoolean(blobNameInXML["$"]["Encoded"]),
|
14024
|
+
content: blobNameInXML["#"]
|
14025
|
+
};
|
14026
|
+
}
|
14027
|
+
else {
|
14028
|
+
return {
|
14029
|
+
encoded: false,
|
14030
|
+
content: blobNameInXML
|
14031
|
+
};
|
14032
|
+
}
|
14033
|
+
}
|
14034
|
+
function ParseBlobItem(blobInXML) {
|
14035
|
+
const blobPropertiesInXML = blobInXML["Properties"];
|
14036
|
+
const blobProperties = {
|
14037
|
+
createdOn: new Date(blobPropertiesInXML["Creation-Time"]),
|
14038
|
+
lastModified: new Date(blobPropertiesInXML["Last-Modified"]),
|
14039
|
+
etag: blobPropertiesInXML["Etag"],
|
14040
|
+
contentLength: blobPropertiesInXML["Content-Length"] === undefined
|
14041
|
+
? undefined
|
14042
|
+
: parseFloat(blobPropertiesInXML["Content-Length"]),
|
14043
|
+
contentType: blobPropertiesInXML["Content-Type"],
|
14044
|
+
contentEncoding: blobPropertiesInXML["Content-Encoding"],
|
14045
|
+
contentLanguage: blobPropertiesInXML["Content-Language"],
|
14046
|
+
contentMD5: decodeBase64String(blobPropertiesInXML["Content-MD5"]),
|
14047
|
+
contentDisposition: blobPropertiesInXML["Content-Disposition"],
|
14048
|
+
cacheControl: blobPropertiesInXML["Cache-Control"],
|
14049
|
+
blobSequenceNumber: blobPropertiesInXML["x-ms-blob-sequence-number"] === undefined
|
14050
|
+
? undefined
|
14051
|
+
: parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]),
|
14052
|
+
blobType: blobPropertiesInXML["BlobType"],
|
14053
|
+
leaseStatus: blobPropertiesInXML["LeaseStatus"],
|
14054
|
+
leaseState: blobPropertiesInXML["LeaseState"],
|
14055
|
+
leaseDuration: blobPropertiesInXML["LeaseDuration"],
|
14056
|
+
copyId: blobPropertiesInXML["CopyId"],
|
14057
|
+
copyStatus: blobPropertiesInXML["CopyStatus"],
|
14058
|
+
copySource: blobPropertiesInXML["CopySource"],
|
14059
|
+
copyProgress: blobPropertiesInXML["CopyProgress"],
|
14060
|
+
copyCompletedOn: blobPropertiesInXML["CopyCompletionTime"] === undefined
|
14061
|
+
? undefined
|
14062
|
+
: new Date(blobPropertiesInXML["CopyCompletionTime"]),
|
14063
|
+
copyStatusDescription: blobPropertiesInXML["CopyStatusDescription"],
|
14064
|
+
serverEncrypted: ParseBoolean(blobPropertiesInXML["ServerEncrypted"]),
|
14065
|
+
incrementalCopy: ParseBoolean(blobPropertiesInXML["IncrementalCopy"]),
|
14066
|
+
destinationSnapshot: blobPropertiesInXML["DestinationSnapshot"],
|
14067
|
+
deletedOn: blobPropertiesInXML["DeletedTime"] === undefined
|
14068
|
+
? undefined
|
14069
|
+
: new Date(blobPropertiesInXML["DeletedTime"]),
|
14070
|
+
remainingRetentionDays: blobPropertiesInXML["RemainingRetentionDays"] === undefined
|
14071
|
+
? undefined
|
14072
|
+
: parseFloat(blobPropertiesInXML["RemainingRetentionDays"]),
|
14073
|
+
accessTier: blobPropertiesInXML["AccessTier"],
|
14074
|
+
accessTierInferred: ParseBoolean(blobPropertiesInXML["AccessTierInferred"]),
|
14075
|
+
archiveStatus: blobPropertiesInXML["ArchiveStatus"],
|
14076
|
+
customerProvidedKeySha256: blobPropertiesInXML["CustomerProvidedKeySha256"],
|
14077
|
+
encryptionScope: blobPropertiesInXML["EncryptionScope"],
|
14078
|
+
accessTierChangedOn: blobPropertiesInXML["AccessTierChangeTime"] === undefined
|
14079
|
+
? undefined
|
14080
|
+
: new Date(blobPropertiesInXML["AccessTierChangeTime"]),
|
14081
|
+
tagCount: blobPropertiesInXML["TagCount"] === undefined
|
14082
|
+
? undefined
|
14083
|
+
: parseFloat(blobPropertiesInXML["TagCount"]),
|
14084
|
+
expiresOn: blobPropertiesInXML["Expiry-Time"] === undefined
|
14085
|
+
? undefined
|
14086
|
+
: new Date(blobPropertiesInXML["Expiry-Time"]),
|
14087
|
+
isSealed: ParseBoolean(blobPropertiesInXML["Sealed"]),
|
14088
|
+
rehydratePriority: blobPropertiesInXML["RehydratePriority"],
|
14089
|
+
lastAccessedOn: blobPropertiesInXML["LastAccessTime"] === undefined
|
14090
|
+
? undefined
|
14091
|
+
: new Date(blobPropertiesInXML["LastAccessTime"]),
|
14092
|
+
immutabilityPolicyExpiresOn: blobPropertiesInXML["ImmutabilityPolicyUntilDate"] === undefined
|
14093
|
+
? undefined
|
14094
|
+
: new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]),
|
14095
|
+
immutabilityPolicyMode: blobPropertiesInXML["ImmutabilityPolicyMode"],
|
14096
|
+
legalHold: ParseBoolean(blobPropertiesInXML["LegalHold"])
|
14097
|
+
};
|
14098
|
+
return {
|
14099
|
+
name: ParseBlobName(blobInXML["Name"]),
|
14100
|
+
deleted: ParseBoolean(blobInXML["Deleted"]),
|
14101
|
+
snapshot: blobInXML["Snapshot"],
|
14102
|
+
versionId: blobInXML["VersionId"],
|
14103
|
+
isCurrentVersion: ParseBoolean(blobInXML["IsCurrentVersion"]),
|
14104
|
+
properties: blobProperties,
|
14105
|
+
metadata: blobInXML["Metadata"],
|
14106
|
+
blobTags: ParseBlobTags(blobInXML["Tags"]),
|
14107
|
+
objectReplicationMetadata: blobInXML["OrMetadata"],
|
14108
|
+
hasVersionsOnly: ParseBoolean(blobInXML["HasVersionsOnly"])
|
14109
|
+
};
|
14110
|
+
}
|
14111
|
+
function ParseBlobPrefix(blobPrefixInXML) {
|
14112
|
+
return {
|
14113
|
+
name: ParseBlobName(blobPrefixInXML["Name"])
|
14114
|
+
};
|
14115
|
+
}
|
14116
|
+
function ParseBlobTag(blobTagInXML) {
|
14117
|
+
return {
|
14118
|
+
key: blobTagInXML["Key"],
|
14119
|
+
value: blobTagInXML["Value"]
|
14120
|
+
};
|
14121
|
+
}
|
14122
|
+
function ParseBlobTags(blobTagsInXML) {
|
14123
|
+
if (blobTagsInXML === undefined ||
|
14124
|
+
blobTagsInXML["TagSet"] === undefined ||
|
14125
|
+
blobTagsInXML["TagSet"]["Tag"] === undefined) {
|
14126
|
+
return undefined;
|
14127
|
+
}
|
14128
|
+
const blobTagSet = [];
|
14129
|
+
if (blobTagsInXML["TagSet"]["Tag"] instanceof Array) {
|
14130
|
+
blobTagsInXML["TagSet"]["Tag"].forEach((blobTagInXML) => {
|
14131
|
+
blobTagSet.push(ParseBlobTag(blobTagInXML));
|
14132
|
+
});
|
14133
|
+
}
|
14134
|
+
else {
|
14135
|
+
blobTagSet.push(ParseBlobTag(blobTagsInXML["TagSet"]["Tag"]));
|
14136
|
+
}
|
14137
|
+
return { blobTagSet: blobTagSet };
|
14138
|
+
}
|
14139
|
+
function ProcessBlobItems(blobArrayInXML) {
|
14140
|
+
const blobItems = [];
|
14141
|
+
if (blobArrayInXML instanceof Array) {
|
14142
|
+
blobArrayInXML.forEach((blobInXML) => {
|
14143
|
+
blobItems.push(ParseBlobItem(blobInXML));
|
14144
|
+
});
|
14145
|
+
}
|
14146
|
+
else {
|
14147
|
+
blobItems.push(ParseBlobItem(blobArrayInXML));
|
14148
|
+
}
|
14149
|
+
return blobItems;
|
14150
|
+
}
|
14151
|
+
function ProcessBlobPrefixes(blobPrefixesInXML) {
|
14152
|
+
const blobPrefixes = [];
|
14153
|
+
if (blobPrefixesInXML instanceof Array) {
|
14154
|
+
blobPrefixesInXML.forEach((blobPrefixInXML) => {
|
14155
|
+
blobPrefixes.push(ParseBlobPrefix(blobPrefixInXML));
|
14156
|
+
});
|
14157
|
+
}
|
14158
|
+
else {
|
14159
|
+
blobPrefixes.push(ParseBlobPrefix(blobPrefixesInXML));
|
14160
|
+
}
|
14161
|
+
return blobPrefixes;
|
14162
|
+
}
|
13942
14163
|
|
13943
14164
|
// Copyright (c) Microsoft Corporation.
|
13944
14165
|
/**
|
@@ -14641,7 +14862,7 @@ class StorageSharedKeyCredential extends Credential {
|
|
14641
14862
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
14642
14863
|
*/
|
14643
14864
|
const packageName = "azure-storage-blob";
|
14644
|
-
const packageVersion = "12.
|
14865
|
+
const packageVersion = "12.9.0-beta.2";
|
14645
14866
|
class StorageClientContext extends coreHttp.ServiceClient {
|
14646
14867
|
/**
|
14647
14868
|
* Initializes a new instance of the StorageClientContext class.
|
@@ -14667,7 +14888,7 @@ class StorageClientContext extends coreHttp.ServiceClient {
|
|
14667
14888
|
// Parameter assignments
|
14668
14889
|
this.url = url;
|
14669
14890
|
// Assigning values to Constant parameters
|
14670
|
-
this.version = options.version || "
|
14891
|
+
this.version = options.version || "2021-02-12";
|
14671
14892
|
}
|
14672
14893
|
}
|
14673
14894
|
|
@@ -14785,6 +15006,10 @@ class BlobSASPermissions {
|
|
14785
15006
|
* Specifies SetImmutabilityPolicy access granted.
|
14786
15007
|
*/
|
14787
15008
|
this.setImmutabilityPolicy = false;
|
15009
|
+
/**
|
15010
|
+
* Specifies that Permanent Delete is permitted.
|
15011
|
+
*/
|
15012
|
+
this.permanentDelete = false;
|
14788
15013
|
}
|
14789
15014
|
/**
|
14790
15015
|
* Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
|
@@ -14826,6 +15051,9 @@ class BlobSASPermissions {
|
|
14826
15051
|
case "i":
|
14827
15052
|
blobSASPermissions.setImmutabilityPolicy = true;
|
14828
15053
|
break;
|
15054
|
+
case "y":
|
15055
|
+
blobSASPermissions.permanentDelete = true;
|
15056
|
+
break;
|
14829
15057
|
default:
|
14830
15058
|
throw new RangeError(`Invalid permission: ${char}`);
|
14831
15059
|
}
|
@@ -14870,6 +15098,9 @@ class BlobSASPermissions {
|
|
14870
15098
|
if (permissionLike.setImmutabilityPolicy) {
|
14871
15099
|
blobSASPermissions.setImmutabilityPolicy = true;
|
14872
15100
|
}
|
15101
|
+
if (permissionLike.permanentDelete) {
|
15102
|
+
blobSASPermissions.permanentDelete = true;
|
15103
|
+
}
|
14873
15104
|
return blobSASPermissions;
|
14874
15105
|
}
|
14875
15106
|
/**
|
@@ -14910,6 +15141,9 @@ class BlobSASPermissions {
|
|
14910
15141
|
if (this.setImmutabilityPolicy) {
|
14911
15142
|
permissions.push("i");
|
14912
15143
|
}
|
15144
|
+
if (this.permanentDelete) {
|
15145
|
+
permissions.push("y");
|
15146
|
+
}
|
14913
15147
|
return permissions.join("");
|
14914
15148
|
}
|
14915
15149
|
}
|
@@ -14969,6 +15203,10 @@ class ContainerSASPermissions {
|
|
14969
15203
|
* Specifies SetImmutabilityPolicy access granted.
|
14970
15204
|
*/
|
14971
15205
|
this.setImmutabilityPolicy = false;
|
15206
|
+
/**
|
15207
|
+
* Specifies that Permanent Delete is permitted.
|
15208
|
+
*/
|
15209
|
+
this.permanentDelete = false;
|
14972
15210
|
}
|
14973
15211
|
/**
|
14974
15212
|
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
|
@@ -15013,6 +15251,9 @@ class ContainerSASPermissions {
|
|
15013
15251
|
case "i":
|
15014
15252
|
containerSASPermissions.setImmutabilityPolicy = true;
|
15015
15253
|
break;
|
15254
|
+
case "y":
|
15255
|
+
containerSASPermissions.permanentDelete = true;
|
15256
|
+
break;
|
15016
15257
|
default:
|
15017
15258
|
throw new RangeError(`Invalid permission ${char}`);
|
15018
15259
|
}
|
@@ -15060,6 +15301,9 @@ class ContainerSASPermissions {
|
|
15060
15301
|
if (permissionLike.setImmutabilityPolicy) {
|
15061
15302
|
containerSASPermissions.setImmutabilityPolicy = true;
|
15062
15303
|
}
|
15304
|
+
if (permissionLike.permanentDelete) {
|
15305
|
+
containerSASPermissions.permanentDelete = true;
|
15306
|
+
}
|
15063
15307
|
return containerSASPermissions;
|
15064
15308
|
}
|
15065
15309
|
/**
|
@@ -15105,6 +15349,9 @@ class ContainerSASPermissions {
|
|
15105
15349
|
if (this.setImmutabilityPolicy) {
|
15106
15350
|
permissions.push("i");
|
15107
15351
|
}
|
15352
|
+
if (this.permanentDelete) {
|
15353
|
+
permissions.push("y");
|
15354
|
+
}
|
15108
15355
|
return permissions.join("");
|
15109
15356
|
}
|
15110
15357
|
}
|
@@ -15174,7 +15421,7 @@ function ipRangeToString(ipRange) {
|
|
15174
15421
|
* NOTE: Instances of this class are immutable.
|
15175
15422
|
*/
|
15176
15423
|
class SASQueryParameters {
|
15177
|
-
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId) {
|
15424
|
+
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) {
|
15178
15425
|
this.version = version;
|
15179
15426
|
this.signature = signature;
|
15180
15427
|
if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
|
@@ -15187,6 +15434,7 @@ class SASQueryParameters {
|
|
15187
15434
|
this.expiresOn = permissionsOrOptions.expiresOn;
|
15188
15435
|
this.ipRangeInner = permissionsOrOptions.ipRange;
|
15189
15436
|
this.identifier = permissionsOrOptions.identifier;
|
15437
|
+
this.encryptionScope = permissionsOrOptions.encryptionScope;
|
15190
15438
|
this.resource = permissionsOrOptions.resource;
|
15191
15439
|
this.cacheControl = permissionsOrOptions.cacheControl;
|
15192
15440
|
this.contentDisposition = permissionsOrOptions.contentDisposition;
|
@@ -15212,6 +15460,7 @@ class SASQueryParameters {
|
|
15212
15460
|
this.protocol = protocol;
|
15213
15461
|
this.startsOn = startsOn;
|
15214
15462
|
this.ipRangeInner = ipRange;
|
15463
|
+
this.encryptionScope = encryptionScope;
|
15215
15464
|
this.identifier = identifier;
|
15216
15465
|
this.resource = resource;
|
15217
15466
|
this.cacheControl = cacheControl;
|
@@ -15259,6 +15508,7 @@ class SASQueryParameters {
|
|
15259
15508
|
"se",
|
15260
15509
|
"sip",
|
15261
15510
|
"si",
|
15511
|
+
"ses",
|
15262
15512
|
"skoid",
|
15263
15513
|
"sktid",
|
15264
15514
|
"skt",
|
@@ -15303,6 +15553,9 @@ class SASQueryParameters {
|
|
15303
15553
|
case "si":
|
15304
15554
|
this.tryAppendQueryParameter(queries, param, this.identifier);
|
15305
15555
|
break;
|
15556
|
+
case "ses":
|
15557
|
+
this.tryAppendQueryParameter(queries, param, this.encryptionScope);
|
15558
|
+
break;
|
15306
15559
|
case "skoid": // Signed object ID
|
15307
15560
|
this.tryAppendQueryParameter(queries, param, this.signedOid);
|
15308
15561
|
break;
|
@@ -15387,6 +15640,15 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
|
|
15387
15640
|
if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {
|
15388
15641
|
throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");
|
15389
15642
|
}
|
15643
|
+
// Version 2020-12-06 adds support for encryptionscope in SAS.
|
15644
|
+
if (version >= "2020-12-06") {
|
15645
|
+
if (sharedKeyCredential !== undefined) {
|
15646
|
+
return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);
|
15647
|
+
}
|
15648
|
+
else {
|
15649
|
+
return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);
|
15650
|
+
}
|
15651
|
+
}
|
15390
15652
|
// Version 2019-12-12 adds support for the blob tags permission.
|
15391
15653
|
// Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.
|
15392
15654
|
// https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string
|
@@ -15542,6 +15804,76 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
|
|
15542
15804
|
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
15543
15805
|
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
15806
|
}
|
15807
|
+
/**
|
15808
|
+
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
15809
|
+
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
|
15810
|
+
*
|
15811
|
+
* Creates an instance of SASQueryParameters.
|
15812
|
+
*
|
15813
|
+
* Only accepts required settings needed to create a SAS. For optional settings please
|
15814
|
+
* set corresponding properties directly, such as permissions, startsOn and identifier.
|
15815
|
+
*
|
15816
|
+
* WARNING: When identifier is not provided, permissions and expiresOn are required.
|
15817
|
+
* You MUST assign value to identifier or expiresOn & permissions manually if you initial with
|
15818
|
+
* this constructor.
|
15819
|
+
*
|
15820
|
+
* @param blobSASSignatureValues -
|
15821
|
+
* @param sharedKeyCredential -
|
15822
|
+
*/
|
15823
|
+
function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) {
|
15824
|
+
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
|
15825
|
+
if (!blobSASSignatureValues.identifier &&
|
15826
|
+
!(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {
|
15827
|
+
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
|
15828
|
+
}
|
15829
|
+
let resource = "c";
|
15830
|
+
let timestamp = blobSASSignatureValues.snapshotTime;
|
15831
|
+
if (blobSASSignatureValues.blobName) {
|
15832
|
+
resource = "b";
|
15833
|
+
if (blobSASSignatureValues.snapshotTime) {
|
15834
|
+
resource = "bs";
|
15835
|
+
}
|
15836
|
+
else if (blobSASSignatureValues.versionId) {
|
15837
|
+
resource = "bv";
|
15838
|
+
timestamp = blobSASSignatureValues.versionId;
|
15839
|
+
}
|
15840
|
+
}
|
15841
|
+
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
|
15842
|
+
let verifiedPermissions;
|
15843
|
+
if (blobSASSignatureValues.permissions) {
|
15844
|
+
if (blobSASSignatureValues.blobName) {
|
15845
|
+
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
|
15846
|
+
}
|
15847
|
+
else {
|
15848
|
+
verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
|
15849
|
+
}
|
15850
|
+
}
|
15851
|
+
// Signature is generated on the un-url-encoded values.
|
15852
|
+
const stringToSign = [
|
15853
|
+
verifiedPermissions ? verifiedPermissions : "",
|
15854
|
+
blobSASSignatureValues.startsOn
|
15855
|
+
? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
|
15856
|
+
: "",
|
15857
|
+
blobSASSignatureValues.expiresOn
|
15858
|
+
? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
|
15859
|
+
: "",
|
15860
|
+
getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
|
15861
|
+
blobSASSignatureValues.identifier,
|
15862
|
+
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
|
15863
|
+
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
|
15864
|
+
blobSASSignatureValues.version,
|
15865
|
+
resource,
|
15866
|
+
timestamp,
|
15867
|
+
blobSASSignatureValues.encryptionScope,
|
15868
|
+
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
|
15869
|
+
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
|
15870
|
+
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
|
15871
|
+
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
|
15872
|
+
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
|
15873
|
+
].join("\n");
|
15874
|
+
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
15875
|
+
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);
|
15876
|
+
}
|
15545
15877
|
/**
|
15546
15878
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
15547
15879
|
* IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
|
@@ -15697,6 +16029,86 @@ function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userD
|
|
15697
16029
|
const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
|
15698
16030
|
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
16031
|
}
|
16032
|
+
/**
|
16033
|
+
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
16034
|
+
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
|
16035
|
+
*
|
16036
|
+
* Creates an instance of SASQueryParameters.
|
16037
|
+
*
|
16038
|
+
* Only accepts required settings needed to create a SAS. For optional settings please
|
16039
|
+
* set corresponding properties directly, such as permissions, startsOn.
|
16040
|
+
*
|
16041
|
+
* WARNING: identifier will be ignored, permissions and expiresOn are required.
|
16042
|
+
*
|
16043
|
+
* @param blobSASSignatureValues -
|
16044
|
+
* @param userDelegationKeyCredential -
|
16045
|
+
*/
|
16046
|
+
function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) {
|
16047
|
+
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
|
16048
|
+
// Stored access policies are not supported for a user delegation SAS.
|
16049
|
+
if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
|
16050
|
+
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
|
16051
|
+
}
|
16052
|
+
let resource = "c";
|
16053
|
+
let timestamp = blobSASSignatureValues.snapshotTime;
|
16054
|
+
if (blobSASSignatureValues.blobName) {
|
16055
|
+
resource = "b";
|
16056
|
+
if (blobSASSignatureValues.snapshotTime) {
|
16057
|
+
resource = "bs";
|
16058
|
+
}
|
16059
|
+
else if (blobSASSignatureValues.versionId) {
|
16060
|
+
resource = "bv";
|
16061
|
+
timestamp = blobSASSignatureValues.versionId;
|
16062
|
+
}
|
16063
|
+
}
|
16064
|
+
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
|
16065
|
+
let verifiedPermissions;
|
16066
|
+
if (blobSASSignatureValues.permissions) {
|
16067
|
+
if (blobSASSignatureValues.blobName) {
|
16068
|
+
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
|
16069
|
+
}
|
16070
|
+
else {
|
16071
|
+
verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
|
16072
|
+
}
|
16073
|
+
}
|
16074
|
+
// Signature is generated on the un-url-encoded values.
|
16075
|
+
const stringToSign = [
|
16076
|
+
verifiedPermissions ? verifiedPermissions : "",
|
16077
|
+
blobSASSignatureValues.startsOn
|
16078
|
+
? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
|
16079
|
+
: "",
|
16080
|
+
blobSASSignatureValues.expiresOn
|
16081
|
+
? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
|
16082
|
+
: "",
|
16083
|
+
getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
|
16084
|
+
userDelegationKeyCredential.userDelegationKey.signedObjectId,
|
16085
|
+
userDelegationKeyCredential.userDelegationKey.signedTenantId,
|
16086
|
+
userDelegationKeyCredential.userDelegationKey.signedStartsOn
|
16087
|
+
? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
|
16088
|
+
: "",
|
16089
|
+
userDelegationKeyCredential.userDelegationKey.signedExpiresOn
|
16090
|
+
? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
|
16091
|
+
: "",
|
16092
|
+
userDelegationKeyCredential.userDelegationKey.signedService,
|
16093
|
+
userDelegationKeyCredential.userDelegationKey.signedVersion,
|
16094
|
+
blobSASSignatureValues.preauthorizedAgentObjectId,
|
16095
|
+
undefined,
|
16096
|
+
blobSASSignatureValues.correlationId,
|
16097
|
+
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
|
16098
|
+
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
|
16099
|
+
blobSASSignatureValues.version,
|
16100
|
+
resource,
|
16101
|
+
timestamp,
|
16102
|
+
blobSASSignatureValues.encryptionScope,
|
16103
|
+
blobSASSignatureValues.cacheControl,
|
16104
|
+
blobSASSignatureValues.contentDisposition,
|
16105
|
+
blobSASSignatureValues.contentEncoding,
|
16106
|
+
blobSASSignatureValues.contentLanguage,
|
16107
|
+
blobSASSignatureValues.contentType
|
16108
|
+
].join("\n");
|
16109
|
+
const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
|
16110
|
+
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);
|
16111
|
+
}
|
15700
16112
|
function getCanonicalName(accountName, containerName, blobName) {
|
15701
16113
|
// Container: "/blob/account/containerName"
|
15702
16114
|
// Blob: "/blob/account/containerName/blobName"
|
@@ -15730,6 +16142,11 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
|
|
15730
16142
|
version < "2019-10-10") {
|
15731
16143
|
throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
|
15732
16144
|
}
|
16145
|
+
if (blobSASSignatureValues.permissions &&
|
16146
|
+
blobSASSignatureValues.permissions.permanentDelete &&
|
16147
|
+
version < "2019-10-10") {
|
16148
|
+
throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");
|
16149
|
+
}
|
15733
16150
|
if (blobSASSignatureValues.permissions &&
|
15734
16151
|
blobSASSignatureValues.permissions.tag &&
|
15735
16152
|
version < "2019-12-12") {
|
@@ -15744,6 +16161,9 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
|
|
15744
16161
|
(blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
|
15745
16162
|
throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
|
15746
16163
|
}
|
16164
|
+
if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") {
|
16165
|
+
throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
|
16166
|
+
}
|
15747
16167
|
blobSASSignatureValues.version = version;
|
15748
16168
|
return blobSASSignatureValues;
|
15749
16169
|
}
|
@@ -19095,7 +19515,7 @@ class BlobClient extends StorageClient {
|
|
19095
19515
|
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
|
19096
19516
|
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
|
19097
19517
|
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)));
|
19518
|
+
}, 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
19519
|
}
|
19100
19520
|
catch (e) {
|
19101
19521
|
span.setStatus({
|
@@ -21912,8 +22332,12 @@ class ContainerClient extends StorageClient {
|
|
21912
22332
|
const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options);
|
21913
22333
|
try {
|
21914
22334
|
const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
21915
|
-
|
21916
|
-
|
22335
|
+
response.segment.blobItems = [];
|
22336
|
+
if (response.segment["Blob"] !== undefined) {
|
22337
|
+
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
|
22338
|
+
}
|
22339
|
+
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
|
22340
|
+
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
|
21917
22341
|
return blobItem;
|
21918
22342
|
}) }) });
|
21919
22343
|
return wrappedResponse;
|
@@ -21941,12 +22365,26 @@ class ContainerClient extends StorageClient {
|
|
21941
22365
|
* @param options - Options to Container List Blob Hierarchy Segment operation.
|
21942
22366
|
*/
|
21943
22367
|
async listBlobHierarchySegment(delimiter, marker, options = {}) {
|
22368
|
+
var _a;
|
21944
22369
|
const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options);
|
21945
22370
|
try {
|
21946
22371
|
const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
21947
|
-
|
21948
|
-
|
22372
|
+
response.segment.blobItems = [];
|
22373
|
+
if (response.segment["Blob"] !== undefined) {
|
22374
|
+
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
|
22375
|
+
}
|
22376
|
+
response.segment.blobPrefixes = [];
|
22377
|
+
if (response.segment["BlobPrefix"] !== undefined) {
|
22378
|
+
response.segment.blobPrefixes = ProcessBlobPrefixes(response.segment["BlobPrefix"]);
|
22379
|
+
}
|
22380
|
+
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
|
22381
|
+
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
|
21949
22382
|
return blobItem;
|
22383
|
+
}), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
|
22384
|
+
const blobPrefix = {
|
22385
|
+
name: BlobNameToString(blobPrefixInternal.name)
|
22386
|
+
};
|
22387
|
+
return blobPrefix;
|
21950
22388
|
}) }) });
|
21951
22389
|
return wrappedResponse;
|
21952
22390
|
}
|
@@ -22464,6 +22902,10 @@ class AccountSASPermissions {
|
|
22464
22902
|
* Permission to set immutability policy.
|
22465
22903
|
*/
|
22466
22904
|
this.setImmutabilityPolicy = false;
|
22905
|
+
/**
|
22906
|
+
* Specifies that Permanent Delete is permitted.
|
22907
|
+
*/
|
22908
|
+
this.permanentDelete = false;
|
22467
22909
|
}
|
22468
22910
|
/**
|
22469
22911
|
* Parse initializes the AccountSASPermissions fields from a string.
|
@@ -22510,6 +22952,9 @@ class AccountSASPermissions {
|
|
22510
22952
|
case "i":
|
22511
22953
|
accountSASPermissions.setImmutabilityPolicy = true;
|
22512
22954
|
break;
|
22955
|
+
case "y":
|
22956
|
+
accountSASPermissions.permanentDelete = true;
|
22957
|
+
break;
|
22513
22958
|
default:
|
22514
22959
|
throw new RangeError(`Invalid permission character: ${c}`);
|
22515
22960
|
}
|
@@ -22560,6 +23005,9 @@ class AccountSASPermissions {
|
|
22560
23005
|
if (permissionLike.setImmutabilityPolicy) {
|
22561
23006
|
accountSASPermissions.setImmutabilityPolicy = true;
|
22562
23007
|
}
|
23008
|
+
if (permissionLike.permanentDelete) {
|
23009
|
+
accountSASPermissions.permanentDelete = true;
|
23010
|
+
}
|
22563
23011
|
return accountSASPermissions;
|
22564
23012
|
}
|
22565
23013
|
/**
|
@@ -22613,6 +23061,9 @@ class AccountSASPermissions {
|
|
22613
23061
|
if (this.setImmutabilityPolicy) {
|
22614
23062
|
permissions.push("i");
|
22615
23063
|
}
|
23064
|
+
if (this.permanentDelete) {
|
23065
|
+
permissions.push("y");
|
23066
|
+
}
|
22616
23067
|
return permissions.join("");
|
22617
23068
|
}
|
22618
23069
|
}
|
@@ -22795,6 +23246,11 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
|
|
22795
23246
|
version < "2019-10-10") {
|
22796
23247
|
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
|
22797
23248
|
}
|
23249
|
+
if (accountSASSignatureValues.permissions &&
|
23250
|
+
accountSASSignatureValues.permissions.permanentDelete &&
|
23251
|
+
version < "2019-10-10") {
|
23252
|
+
throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.");
|
23253
|
+
}
|
22798
23254
|
if (accountSASSignatureValues.permissions &&
|
22799
23255
|
accountSASSignatureValues.permissions.tag &&
|
22800
23256
|
version < "2019-12-12") {
|
@@ -22805,25 +23261,48 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
|
|
22805
23261
|
version < "2019-12-12") {
|
22806
23262
|
throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.");
|
22807
23263
|
}
|
23264
|
+
if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") {
|
23265
|
+
throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
|
23266
|
+
}
|
22808
23267
|
const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString());
|
22809
23268
|
const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();
|
22810
23269
|
const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString();
|
22811
|
-
|
22812
|
-
|
22813
|
-
|
22814
|
-
|
22815
|
-
|
22816
|
-
|
22817
|
-
|
22818
|
-
|
22819
|
-
|
22820
|
-
|
22821
|
-
|
22822
|
-
|
22823
|
-
|
22824
|
-
|
23270
|
+
let stringToSign;
|
23271
|
+
if (version >= "2020-12-06") {
|
23272
|
+
stringToSign = [
|
23273
|
+
sharedKeyCredential.accountName,
|
23274
|
+
parsedPermissions,
|
23275
|
+
parsedServices,
|
23276
|
+
parsedResourceTypes,
|
23277
|
+
accountSASSignatureValues.startsOn
|
23278
|
+
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
|
23279
|
+
: "",
|
23280
|
+
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
|
23281
|
+
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
|
23282
|
+
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
|
23283
|
+
version,
|
23284
|
+
accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "",
|
23285
|
+
"" // Account SAS requires an additional newline character
|
23286
|
+
].join("\n");
|
23287
|
+
}
|
23288
|
+
else {
|
23289
|
+
stringToSign = [
|
23290
|
+
sharedKeyCredential.accountName,
|
23291
|
+
parsedPermissions,
|
23292
|
+
parsedServices,
|
23293
|
+
parsedResourceTypes,
|
23294
|
+
accountSASSignatureValues.startsOn
|
23295
|
+
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
|
23296
|
+
: "",
|
23297
|
+
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
|
23298
|
+
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
|
23299
|
+
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
|
23300
|
+
version,
|
23301
|
+
"" // Account SAS requires an additional newline character
|
23302
|
+
].join("\n");
|
23303
|
+
}
|
22825
23304
|
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
22826
|
-
return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange);
|
23305
|
+
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
23306
|
}
|
22828
23307
|
|
22829
23308
|
/**
|
@@ -23481,6 +23960,9 @@ class BlobServiceClient extends StorageClient {
|
|
23481
23960
|
if (options.includeMetadata) {
|
23482
23961
|
include.push("metadata");
|
23483
23962
|
}
|
23963
|
+
if (options.includeSystem) {
|
23964
|
+
include.push("system");
|
23965
|
+
}
|
23484
23966
|
// AsyncIterableIterator to iterate over containers
|
23485
23967
|
const listSegmentOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include } : {}));
|
23486
23968
|
const iter = this.listItems(listSegmentOptions);
|