@azure/storage-blob 12.12.1-alpha.20221019.2 → 12.12.1-alpha.20221109.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1088,6 +1088,7 @@ const BlobName = {
1088
1088
  content: {
1089
1089
  serializedName: "content",
1090
1090
  xmlName: "content",
1091
+ xmlIsMsText: true,
1091
1092
  type: {
1092
1093
  name: "String"
1093
1094
  }
@@ -14173,296 +14174,6 @@ function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
14173
14174
  }),
14174
14175
  } });
14175
14176
  }
14176
- function decodeBase64String(value) {
14177
- if (coreHttp.isNode) {
14178
- return Buffer.from(value, "base64");
14179
- }
14180
- else {
14181
- const byteString = atob(value);
14182
- const arr = new Uint8Array(byteString.length);
14183
- for (let i = 0; i < byteString.length; i++) {
14184
- arr[i] = byteString.charCodeAt(i);
14185
- }
14186
- return arr;
14187
- }
14188
- }
14189
- function ParseBoolean(content) {
14190
- if (content === undefined)
14191
- return undefined;
14192
- if (content === "true")
14193
- return true;
14194
- if (content === "false")
14195
- return false;
14196
- return undefined;
14197
- }
14198
- function ParseBlobName(blobNameInXML) {
14199
- if (blobNameInXML["$"] !== undefined && blobNameInXML["#"] !== undefined) {
14200
- return {
14201
- encoded: ParseBoolean(blobNameInXML["$"]["Encoded"]),
14202
- content: blobNameInXML["#"],
14203
- };
14204
- }
14205
- else {
14206
- return {
14207
- encoded: false,
14208
- content: blobNameInXML,
14209
- };
14210
- }
14211
- }
14212
- function ParseBlobProperties(blobPropertiesInXML) {
14213
- const blobProperties = blobPropertiesInXML;
14214
- if (blobPropertiesInXML["Creation-Time"]) {
14215
- blobProperties.createdOn = new Date(blobPropertiesInXML["Creation-Time"]);
14216
- delete blobProperties["Creation-Time"];
14217
- }
14218
- if (blobPropertiesInXML["Last-Modified"]) {
14219
- blobProperties.lastModified = new Date(blobPropertiesInXML["Last-Modified"]);
14220
- delete blobProperties["Last-Modified"];
14221
- }
14222
- if (blobPropertiesInXML["Etag"]) {
14223
- blobProperties.etag = blobPropertiesInXML["Etag"];
14224
- delete blobProperties["Etag"];
14225
- }
14226
- if (blobPropertiesInXML["Content-Length"]) {
14227
- blobProperties.contentLength = parseFloat(blobPropertiesInXML["Content-Length"]);
14228
- delete blobProperties["Content-Length"];
14229
- }
14230
- if (blobPropertiesInXML["Content-Type"]) {
14231
- blobProperties.contentType = blobPropertiesInXML["Content-Type"];
14232
- delete blobProperties["Content-Type"];
14233
- }
14234
- if (blobPropertiesInXML["Content-Encoding"]) {
14235
- blobProperties.contentEncoding = blobPropertiesInXML["Content-Encoding"];
14236
- delete blobProperties["Content-Encoding"];
14237
- }
14238
- if (blobPropertiesInXML["Content-Language"]) {
14239
- blobProperties.contentLanguage = blobPropertiesInXML["Content-Language"];
14240
- delete blobProperties["Content-Language"];
14241
- }
14242
- if (blobPropertiesInXML["Content-MD5"]) {
14243
- blobProperties.contentMD5 = decodeBase64String(blobPropertiesInXML["Content-MD5"]);
14244
- delete blobProperties["Content-MD5"];
14245
- }
14246
- if (blobPropertiesInXML["Content-Disposition"]) {
14247
- blobProperties.contentDisposition = blobPropertiesInXML["Content-Disposition"];
14248
- delete blobProperties["Content-Disposition"];
14249
- }
14250
- if (blobPropertiesInXML["Cache-Control"]) {
14251
- blobProperties.cacheControl = blobPropertiesInXML["Cache-Control"];
14252
- delete blobProperties["Cache-Control"];
14253
- }
14254
- if (blobPropertiesInXML["x-ms-blob-sequence-number"]) {
14255
- blobProperties.blobSequenceNumber = parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]);
14256
- delete blobProperties["x-ms-blob-sequence-number"];
14257
- }
14258
- if (blobPropertiesInXML["BlobType"]) {
14259
- blobProperties.blobType = blobPropertiesInXML["BlobType"];
14260
- delete blobProperties["BlobType"];
14261
- }
14262
- if (blobPropertiesInXML["LeaseStatus"]) {
14263
- blobProperties.leaseStatus = blobPropertiesInXML["LeaseStatus"];
14264
- delete blobProperties["LeaseStatus"];
14265
- }
14266
- if (blobPropertiesInXML["LeaseState"]) {
14267
- blobProperties.leaseState = blobPropertiesInXML["LeaseState"];
14268
- delete blobProperties["LeaseState"];
14269
- }
14270
- if (blobPropertiesInXML["LeaseDuration"]) {
14271
- blobProperties.leaseDuration = blobPropertiesInXML["LeaseDuration"];
14272
- delete blobProperties["LeaseDuration"];
14273
- }
14274
- if (blobPropertiesInXML["CopyId"]) {
14275
- blobProperties.copyId = blobPropertiesInXML["CopyId"];
14276
- delete blobProperties["CopyId"];
14277
- }
14278
- if (blobPropertiesInXML["CopyStatus"]) {
14279
- blobProperties.copyStatus = blobPropertiesInXML["CopyStatus"];
14280
- delete blobProperties["CopyStatus"];
14281
- }
14282
- if (blobPropertiesInXML["CopySource"]) {
14283
- blobProperties.copySource = blobPropertiesInXML["CopySource"];
14284
- delete blobProperties["CopySource"];
14285
- }
14286
- if (blobPropertiesInXML["CopyProgress"]) {
14287
- blobProperties.copyProgress = blobPropertiesInXML["CopyProgress"];
14288
- delete blobProperties["CopyProgress"];
14289
- }
14290
- if (blobPropertiesInXML["CopyCompletionTime"]) {
14291
- blobProperties.copyCompletedOn = new Date(blobPropertiesInXML["CopyCompletionTime"]);
14292
- delete blobProperties["CopyCompletionTime"];
14293
- }
14294
- if (blobPropertiesInXML["CopyStatusDescription"]) {
14295
- blobProperties.copyStatusDescription = blobPropertiesInXML["CopyStatusDescription"];
14296
- delete blobProperties["CopyStatusDescription"];
14297
- }
14298
- if (blobPropertiesInXML["ServerEncrypted"]) {
14299
- blobProperties.serverEncrypted = ParseBoolean(blobPropertiesInXML["ServerEncrypted"]);
14300
- delete blobProperties["ServerEncrypted"];
14301
- }
14302
- if (blobPropertiesInXML["IncrementalCopy"]) {
14303
- blobProperties.incrementalCopy = ParseBoolean(blobPropertiesInXML["IncrementalCopy"]);
14304
- delete blobProperties["IncrementalCopy"];
14305
- }
14306
- if (blobPropertiesInXML["DestinationSnapshot"]) {
14307
- blobProperties.destinationSnapshot = blobPropertiesInXML["DestinationSnapshot"];
14308
- delete blobProperties["DestinationSnapshot"];
14309
- }
14310
- if (blobPropertiesInXML["DeletedTime"]) {
14311
- blobProperties.deletedOn = new Date(blobPropertiesInXML["DeletedTime"]);
14312
- delete blobProperties["DeletedTime"];
14313
- }
14314
- if (blobPropertiesInXML["RemainingRetentionDays"]) {
14315
- blobProperties.remainingRetentionDays = parseFloat(blobPropertiesInXML["RemainingRetentionDays"]);
14316
- delete blobProperties["RemainingRetentionDays"];
14317
- }
14318
- if (blobPropertiesInXML["AccessTier"]) {
14319
- blobProperties.accessTier = blobPropertiesInXML["AccessTier"];
14320
- delete blobProperties["AccessTier"];
14321
- }
14322
- if (blobPropertiesInXML["AccessTierInferred"]) {
14323
- blobProperties.accessTierInferred = ParseBoolean(blobPropertiesInXML["AccessTierInferred"]);
14324
- delete blobProperties["AccessTierInferred"];
14325
- }
14326
- if (blobPropertiesInXML["ArchiveStatus"]) {
14327
- blobProperties.archiveStatus = blobPropertiesInXML["ArchiveStatus"];
14328
- delete blobProperties["ArchiveStatus"];
14329
- }
14330
- if (blobPropertiesInXML["CustomerProvidedKeySha256"]) {
14331
- blobProperties.customerProvidedKeySha256 = blobPropertiesInXML["CustomerProvidedKeySha256"];
14332
- delete blobProperties["CustomerProvidedKeySha256"];
14333
- }
14334
- if (blobPropertiesInXML["EncryptionScope"]) {
14335
- blobProperties.encryptionScope = blobPropertiesInXML["EncryptionScope"];
14336
- delete blobProperties["EncryptionScope"];
14337
- }
14338
- if (blobPropertiesInXML["AccessTierChangeTime"]) {
14339
- blobProperties.accessTierChangedOn = new Date(blobPropertiesInXML["AccessTierChangeTime"]);
14340
- delete blobProperties["AccessTierChangeTime"];
14341
- }
14342
- if (blobPropertiesInXML["TagCount"]) {
14343
- blobProperties.tagCount = parseFloat(blobPropertiesInXML["TagCount"]);
14344
- delete blobProperties["TagCount"];
14345
- }
14346
- if (blobPropertiesInXML["Expiry-Time"]) {
14347
- blobProperties.expiresOn = new Date(blobPropertiesInXML["Expiry-Time"]);
14348
- delete blobProperties["Expiry-Time"];
14349
- }
14350
- if (blobPropertiesInXML["Sealed"]) {
14351
- blobProperties.isSealed = ParseBoolean(blobPropertiesInXML["Sealed"]);
14352
- delete blobProperties["Sealed"];
14353
- }
14354
- if (blobPropertiesInXML["RehydratePriority"]) {
14355
- blobProperties.rehydratePriority = blobPropertiesInXML["RehydratePriority"];
14356
- delete blobProperties["RehydratePriority"];
14357
- }
14358
- if (blobPropertiesInXML["LastAccessTime"]) {
14359
- blobProperties.lastAccessedOn = new Date(blobPropertiesInXML["LastAccessTime"]);
14360
- delete blobProperties["LastAccessTime"];
14361
- }
14362
- if (blobPropertiesInXML["ImmutabilityPolicyUntilDate"]) {
14363
- blobProperties.immutabilityPolicyExpiresOn = new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]);
14364
- delete blobProperties["ImmutabilityPolicyUntilDate"];
14365
- }
14366
- if (blobPropertiesInXML["ImmutabilityPolicyMode"]) {
14367
- blobProperties.immutabilityPolicyMode = blobPropertiesInXML["ImmutabilityPolicyMode"];
14368
- delete blobProperties["ImmutabilityPolicyMode"];
14369
- }
14370
- if (blobPropertiesInXML["LegalHold"]) {
14371
- blobProperties.legalHold = ParseBoolean(blobPropertiesInXML["LegalHold"]);
14372
- delete blobProperties["LegalHold"];
14373
- }
14374
- return blobProperties;
14375
- }
14376
- function ParseBlobItem(blobInXML) {
14377
- const blobItem = blobInXML;
14378
- blobItem.properties = ParseBlobProperties(blobInXML["Properties"]);
14379
- delete blobItem["Properties"];
14380
- blobItem.name = ParseBlobName(blobInXML["Name"]);
14381
- delete blobItem["Name"];
14382
- blobItem.deleted = ParseBoolean(blobInXML["Deleted"]);
14383
- delete blobItem["Deleted"];
14384
- if (blobInXML["Snapshot"]) {
14385
- blobItem.snapshot = blobInXML["Snapshot"];
14386
- delete blobItem["Snapshot"];
14387
- }
14388
- if (blobInXML["VersionId"]) {
14389
- blobItem.versionId = blobInXML["VersionId"];
14390
- delete blobItem["VersionId"];
14391
- }
14392
- if (blobInXML["IsCurrentVersion"]) {
14393
- blobItem.isCurrentVersion = ParseBoolean(blobInXML["IsCurrentVersion"]);
14394
- delete blobItem["IsCurrentVersion"];
14395
- }
14396
- if (blobInXML["Metadata"]) {
14397
- blobItem.metadata = blobInXML["Metadata"];
14398
- delete blobItem["Metadata"];
14399
- }
14400
- if (blobInXML["Tags"]) {
14401
- blobItem.blobTags = ParseBlobTags(blobInXML["Tags"]);
14402
- delete blobItem["Tags"];
14403
- }
14404
- if (blobInXML["OrMetadata"]) {
14405
- blobItem.objectReplicationMetadata = blobInXML["OrMetadata"];
14406
- delete blobItem["OrMetadata"];
14407
- }
14408
- if (blobInXML["HasVersionsOnly"]) {
14409
- blobItem.hasVersionsOnly = ParseBoolean(blobInXML["HasVersionsOnly"]);
14410
- delete blobItem["HasVersionsOnly"];
14411
- }
14412
- return blobItem;
14413
- }
14414
- function ParseBlobPrefix(blobPrefixInXML) {
14415
- return {
14416
- name: ParseBlobName(blobPrefixInXML["Name"]),
14417
- };
14418
- }
14419
- function ParseBlobTag(blobTagInXML) {
14420
- return {
14421
- key: blobTagInXML["Key"],
14422
- value: blobTagInXML["Value"],
14423
- };
14424
- }
14425
- function ParseBlobTags(blobTagsInXML) {
14426
- if (blobTagsInXML === undefined ||
14427
- blobTagsInXML["TagSet"] === undefined ||
14428
- blobTagsInXML["TagSet"]["Tag"] === undefined) {
14429
- return undefined;
14430
- }
14431
- const blobTagSet = [];
14432
- if (blobTagsInXML["TagSet"]["Tag"] instanceof Array) {
14433
- blobTagsInXML["TagSet"]["Tag"].forEach((blobTagInXML) => {
14434
- blobTagSet.push(ParseBlobTag(blobTagInXML));
14435
- });
14436
- }
14437
- else {
14438
- blobTagSet.push(ParseBlobTag(blobTagsInXML["TagSet"]["Tag"]));
14439
- }
14440
- return { blobTagSet: blobTagSet };
14441
- }
14442
- function ProcessBlobItems(blobArrayInXML) {
14443
- const blobItems = [];
14444
- if (blobArrayInXML instanceof Array) {
14445
- blobArrayInXML.forEach((blobInXML) => {
14446
- blobItems.push(ParseBlobItem(blobInXML));
14447
- });
14448
- }
14449
- else {
14450
- blobItems.push(ParseBlobItem(blobArrayInXML));
14451
- }
14452
- return blobItems;
14453
- }
14454
- function ProcessBlobPrefixes(blobPrefixesInXML) {
14455
- const blobPrefixes = [];
14456
- if (blobPrefixesInXML instanceof Array) {
14457
- blobPrefixesInXML.forEach((blobPrefixInXML) => {
14458
- blobPrefixes.push(ParseBlobPrefix(blobPrefixInXML));
14459
- });
14460
- }
14461
- else {
14462
- blobPrefixes.push(ParseBlobPrefix(blobPrefixesInXML));
14463
- }
14464
- return blobPrefixes;
14465
- }
14466
14177
  function* ExtractPageRangeInfoItems(getPageRangesSegment) {
14467
14178
  let pageRange = [];
14468
14179
  let clearRange = [];
@@ -23379,10 +23090,6 @@ class ContainerClient extends StorageClient {
23379
23090
  const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options);
23380
23091
  try {
23381
23092
  const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
23382
- response.segment.blobItems = [];
23383
- if (response.segment["Blob"] !== undefined) {
23384
- response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
23385
- }
23386
23093
  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) => {
23387
23094
  const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
23388
23095
  return blobItem;
@@ -23416,14 +23123,6 @@ class ContainerClient extends StorageClient {
23416
23123
  const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options);
23417
23124
  try {
23418
23125
  const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
23419
- response.segment.blobItems = [];
23420
- if (response.segment["Blob"] !== undefined) {
23421
- response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
23422
- }
23423
- response.segment.blobPrefixes = [];
23424
- if (response.segment["BlobPrefix"] !== undefined) {
23425
- response.segment.blobPrefixes = ProcessBlobPrefixes(response.segment["BlobPrefix"]);
23426
- }
23427
23126
  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) => {
23428
23127
  const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
23429
23128
  return blobItem;