@azure/storage-blob 12.10.0-alpha.20220502.1 → 12.10.0-alpha.20220509.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ## 12.10.0-beta.2 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ - Refined user-agent value to avoid failure when os information is not available on some platforms.
12
+
13
+ ### Other Changes
14
+
3
15
  ## 12.10.0-beta.1 (2022-04-19)
4
16
 
5
17
  ### Features Added
package/dist/index.js CHANGED
@@ -13325,7 +13325,7 @@ const logger = logger$1.createClientLogger("storage-blob");
13325
13325
 
13326
13326
  // Copyright (c) Microsoft Corporation.
13327
13327
  // Licensed under the MIT license.
13328
- const SDK_VERSION = "12.10.0-beta.1";
13328
+ const SDK_VERSION = "12.10.0-beta.2";
13329
13329
  const SERVICE_VERSION = "2021-06-08";
13330
13330
  const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
13331
13331
  const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
@@ -14183,82 +14183,207 @@ function ParseBlobName(blobNameInXML) {
14183
14183
  };
14184
14184
  }
14185
14185
  }
14186
+ function ParseBlobProperties(blobPropertiesInXML) {
14187
+ const blobProperties = blobPropertiesInXML;
14188
+ if (blobPropertiesInXML["Creation-Time"]) {
14189
+ blobProperties.createdOn = new Date(blobPropertiesInXML["Creation-Time"]);
14190
+ delete blobProperties["Creation-Time"];
14191
+ }
14192
+ if (blobPropertiesInXML["Last-Modified"]) {
14193
+ blobProperties.lastModified = new Date(blobPropertiesInXML["Last-Modified"]);
14194
+ delete blobProperties["Last-Modified"];
14195
+ }
14196
+ if (blobPropertiesInXML["Etag"]) {
14197
+ blobProperties.etag = blobPropertiesInXML["Etag"];
14198
+ delete blobProperties["Etag"];
14199
+ }
14200
+ if (blobPropertiesInXML["Content-Length"]) {
14201
+ blobProperties.contentLength = parseFloat(blobPropertiesInXML["Content-Length"]);
14202
+ delete blobProperties["Content-Length"];
14203
+ }
14204
+ if (blobPropertiesInXML["Content-Type"]) {
14205
+ blobProperties.contentType = blobPropertiesInXML["Content-Type"];
14206
+ delete blobProperties["Content-Type"];
14207
+ }
14208
+ if (blobPropertiesInXML["Content-Encoding"]) {
14209
+ blobProperties.contentEncoding = blobPropertiesInXML["Content-Encoding"];
14210
+ delete blobProperties["Content-Encoding"];
14211
+ }
14212
+ if (blobPropertiesInXML["Content-Language"]) {
14213
+ blobProperties.contentLanguage = blobPropertiesInXML["Content-Language"];
14214
+ delete blobProperties["Content-Language"];
14215
+ }
14216
+ if (blobPropertiesInXML["Content-MD5"]) {
14217
+ blobProperties.contentMD5 = decodeBase64String(blobPropertiesInXML["Content-MD5"]);
14218
+ delete blobProperties["Content-MD5"];
14219
+ }
14220
+ if (blobPropertiesInXML["Content-Disposition"]) {
14221
+ blobProperties.contentDisposition = blobPropertiesInXML["Content-Disposition"];
14222
+ delete blobProperties["Content-Disposition"];
14223
+ }
14224
+ if (blobPropertiesInXML["Cache-Control"]) {
14225
+ blobProperties.cacheControl = blobPropertiesInXML["Cache-Control"];
14226
+ delete blobProperties["Cache-Control"];
14227
+ }
14228
+ if (blobPropertiesInXML["x-ms-blob-sequence-number"]) {
14229
+ blobProperties.blobSequenceNumber = parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]);
14230
+ delete blobProperties["x-ms-blob-sequence-number"];
14231
+ }
14232
+ if (blobPropertiesInXML["BlobType"]) {
14233
+ blobProperties.blobType = blobPropertiesInXML["BlobType"];
14234
+ delete blobProperties["BlobType"];
14235
+ }
14236
+ if (blobPropertiesInXML["LeaseStatus"]) {
14237
+ blobProperties.leaseStatus = blobPropertiesInXML["LeaseStatus"];
14238
+ delete blobProperties["LeaseStatus"];
14239
+ }
14240
+ if (blobPropertiesInXML["LeaseState"]) {
14241
+ blobProperties.leaseState = blobPropertiesInXML["LeaseState"];
14242
+ delete blobProperties["LeaseState"];
14243
+ }
14244
+ if (blobPropertiesInXML["LeaseDuration"]) {
14245
+ blobProperties.leaseDuration = blobPropertiesInXML["LeaseDuration"];
14246
+ delete blobProperties["LeaseDuration"];
14247
+ }
14248
+ if (blobPropertiesInXML["CopyId"]) {
14249
+ blobProperties.copyId = blobPropertiesInXML["CopyId"];
14250
+ delete blobProperties["CopyId"];
14251
+ }
14252
+ if (blobPropertiesInXML["CopyStatus"]) {
14253
+ blobProperties.copyStatus = blobPropertiesInXML["CopyStatus"];
14254
+ delete blobProperties["CopyStatus"];
14255
+ }
14256
+ if (blobPropertiesInXML["CopySource"]) {
14257
+ blobProperties.copySource = blobPropertiesInXML["CopySource"];
14258
+ delete blobProperties["CopySource"];
14259
+ }
14260
+ if (blobPropertiesInXML["CopyProgress"]) {
14261
+ blobProperties.copyProgress = blobPropertiesInXML["CopyProgress"];
14262
+ delete blobProperties["CopyProgress"];
14263
+ }
14264
+ if (blobPropertiesInXML["CopyCompletionTime"]) {
14265
+ blobProperties.copyCompletedOn = new Date(blobPropertiesInXML["CopyCompletionTime"]);
14266
+ delete blobProperties["CopyCompletionTime"];
14267
+ }
14268
+ if (blobPropertiesInXML["CopyStatusDescription"]) {
14269
+ blobProperties.copyStatusDescription = blobPropertiesInXML["CopyStatusDescription"];
14270
+ delete blobProperties["CopyStatusDescription"];
14271
+ }
14272
+ if (blobPropertiesInXML["ServerEncrypted"]) {
14273
+ blobProperties.serverEncrypted = ParseBoolean(blobPropertiesInXML["ServerEncrypted"]);
14274
+ delete blobProperties["ServerEncrypted"];
14275
+ }
14276
+ if (blobPropertiesInXML["IncrementalCopy"]) {
14277
+ blobProperties.incrementalCopy = ParseBoolean(blobPropertiesInXML["IncrementalCopy"]);
14278
+ delete blobProperties["IncrementalCopy"];
14279
+ }
14280
+ if (blobPropertiesInXML["DestinationSnapshot"]) {
14281
+ blobProperties.destinationSnapshot = blobPropertiesInXML["DestinationSnapshot"];
14282
+ delete blobProperties["DestinationSnapshot"];
14283
+ }
14284
+ if (blobPropertiesInXML["DeletedTime"]) {
14285
+ blobProperties.deletedOn = new Date(blobPropertiesInXML["DeletedTime"]);
14286
+ delete blobProperties["DeletedTime"];
14287
+ }
14288
+ if (blobPropertiesInXML["RemainingRetentionDays"]) {
14289
+ blobProperties.remainingRetentionDays = parseFloat(blobPropertiesInXML["RemainingRetentionDays"]);
14290
+ delete blobProperties["RemainingRetentionDays"];
14291
+ }
14292
+ if (blobPropertiesInXML["AccessTier"]) {
14293
+ blobProperties.accessTier = blobPropertiesInXML["AccessTier"];
14294
+ delete blobProperties["AccessTier"];
14295
+ }
14296
+ if (blobPropertiesInXML["AccessTierInferred"]) {
14297
+ blobProperties.accessTierInferred = ParseBoolean(blobPropertiesInXML["AccessTierInferred"]);
14298
+ delete blobProperties["AccessTierInferred"];
14299
+ }
14300
+ if (blobPropertiesInXML["ArchiveStatus"]) {
14301
+ blobProperties.archiveStatus = blobPropertiesInXML["ArchiveStatus"];
14302
+ delete blobProperties["ArchiveStatus"];
14303
+ }
14304
+ if (blobPropertiesInXML["CustomerProvidedKeySha256"]) {
14305
+ blobProperties.customerProvidedKeySha256 = blobPropertiesInXML["CustomerProvidedKeySha256"];
14306
+ delete blobProperties["CustomerProvidedKeySha256"];
14307
+ }
14308
+ if (blobPropertiesInXML["EncryptionScope"]) {
14309
+ blobProperties.encryptionScope = blobPropertiesInXML["EncryptionScope"];
14310
+ delete blobProperties["EncryptionScope"];
14311
+ }
14312
+ if (blobPropertiesInXML["AccessTierChangeTime"]) {
14313
+ blobProperties.accessTierChangedOn = new Date(blobPropertiesInXML["AccessTierChangeTime"]);
14314
+ delete blobProperties["AccessTierChangeTime"];
14315
+ }
14316
+ if (blobPropertiesInXML["TagCount"]) {
14317
+ blobProperties.tagCount = parseFloat(blobPropertiesInXML["TagCount"]);
14318
+ delete blobProperties["TagCount"];
14319
+ }
14320
+ if (blobPropertiesInXML["Expiry-Time"]) {
14321
+ blobProperties.expiresOn = new Date(blobPropertiesInXML["Expiry-Time"]);
14322
+ delete blobProperties["Expiry-Time"];
14323
+ }
14324
+ if (blobPropertiesInXML["Sealed"]) {
14325
+ blobProperties.isSealed = ParseBoolean(blobPropertiesInXML["Sealed"]);
14326
+ delete blobProperties["Sealed"];
14327
+ }
14328
+ if (blobPropertiesInXML["RehydratePriority"]) {
14329
+ blobProperties.rehydratePriority = blobPropertiesInXML["RehydratePriority"];
14330
+ delete blobProperties["RehydratePriority"];
14331
+ }
14332
+ if (blobPropertiesInXML["LastAccessTime"]) {
14333
+ blobProperties.lastAccessedOn = new Date(blobPropertiesInXML["LastAccessTime"]);
14334
+ delete blobProperties["LastAccessTime"];
14335
+ }
14336
+ if (blobPropertiesInXML["ImmutabilityPolicyUntilDate"]) {
14337
+ blobProperties.immutabilityPolicyExpiresOn = new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]);
14338
+ delete blobProperties["ImmutabilityPolicyUntilDate"];
14339
+ }
14340
+ if (blobPropertiesInXML["ImmutabilityPolicyMode"]) {
14341
+ blobProperties.immutabilityPolicyMode = blobPropertiesInXML["ImmutabilityPolicyMode"];
14342
+ delete blobProperties["ImmutabilityPolicyMode"];
14343
+ }
14344
+ if (blobPropertiesInXML["LegalHold"]) {
14345
+ blobProperties.legalHold = ParseBoolean(blobPropertiesInXML["LegalHold"]);
14346
+ delete blobProperties["LegalHold"];
14347
+ }
14348
+ return blobProperties;
14349
+ }
14186
14350
  function ParseBlobItem(blobInXML) {
14187
- const blobPropertiesInXML = blobInXML["Properties"];
14188
- const blobProperties = {
14189
- createdOn: new Date(blobPropertiesInXML["Creation-Time"]),
14190
- lastModified: new Date(blobPropertiesInXML["Last-Modified"]),
14191
- etag: blobPropertiesInXML["Etag"],
14192
- contentLength: blobPropertiesInXML["Content-Length"] === undefined
14193
- ? undefined
14194
- : parseFloat(blobPropertiesInXML["Content-Length"]),
14195
- contentType: blobPropertiesInXML["Content-Type"],
14196
- contentEncoding: blobPropertiesInXML["Content-Encoding"],
14197
- contentLanguage: blobPropertiesInXML["Content-Language"],
14198
- contentMD5: decodeBase64String(blobPropertiesInXML["Content-MD5"]),
14199
- contentDisposition: blobPropertiesInXML["Content-Disposition"],
14200
- cacheControl: blobPropertiesInXML["Cache-Control"],
14201
- blobSequenceNumber: blobPropertiesInXML["x-ms-blob-sequence-number"] === undefined
14202
- ? undefined
14203
- : parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]),
14204
- blobType: blobPropertiesInXML["BlobType"],
14205
- leaseStatus: blobPropertiesInXML["LeaseStatus"],
14206
- leaseState: blobPropertiesInXML["LeaseState"],
14207
- leaseDuration: blobPropertiesInXML["LeaseDuration"],
14208
- copyId: blobPropertiesInXML["CopyId"],
14209
- copyStatus: blobPropertiesInXML["CopyStatus"],
14210
- copySource: blobPropertiesInXML["CopySource"],
14211
- copyProgress: blobPropertiesInXML["CopyProgress"],
14212
- copyCompletedOn: blobPropertiesInXML["CopyCompletionTime"] === undefined
14213
- ? undefined
14214
- : new Date(blobPropertiesInXML["CopyCompletionTime"]),
14215
- copyStatusDescription: blobPropertiesInXML["CopyStatusDescription"],
14216
- serverEncrypted: ParseBoolean(blobPropertiesInXML["ServerEncrypted"]),
14217
- incrementalCopy: ParseBoolean(blobPropertiesInXML["IncrementalCopy"]),
14218
- destinationSnapshot: blobPropertiesInXML["DestinationSnapshot"],
14219
- deletedOn: blobPropertiesInXML["DeletedTime"] === undefined
14220
- ? undefined
14221
- : new Date(blobPropertiesInXML["DeletedTime"]),
14222
- remainingRetentionDays: blobPropertiesInXML["RemainingRetentionDays"] === undefined
14223
- ? undefined
14224
- : parseFloat(blobPropertiesInXML["RemainingRetentionDays"]),
14225
- accessTier: blobPropertiesInXML["AccessTier"],
14226
- accessTierInferred: ParseBoolean(blobPropertiesInXML["AccessTierInferred"]),
14227
- archiveStatus: blobPropertiesInXML["ArchiveStatus"],
14228
- customerProvidedKeySha256: blobPropertiesInXML["CustomerProvidedKeySha256"],
14229
- encryptionScope: blobPropertiesInXML["EncryptionScope"],
14230
- accessTierChangedOn: blobPropertiesInXML["AccessTierChangeTime"] === undefined
14231
- ? undefined
14232
- : new Date(blobPropertiesInXML["AccessTierChangeTime"]),
14233
- tagCount: blobPropertiesInXML["TagCount"] === undefined
14234
- ? undefined
14235
- : parseFloat(blobPropertiesInXML["TagCount"]),
14236
- expiresOn: blobPropertiesInXML["Expiry-Time"] === undefined
14237
- ? undefined
14238
- : new Date(blobPropertiesInXML["Expiry-Time"]),
14239
- isSealed: ParseBoolean(blobPropertiesInXML["Sealed"]),
14240
- rehydratePriority: blobPropertiesInXML["RehydratePriority"],
14241
- lastAccessedOn: blobPropertiesInXML["LastAccessTime"] === undefined
14242
- ? undefined
14243
- : new Date(blobPropertiesInXML["LastAccessTime"]),
14244
- immutabilityPolicyExpiresOn: blobPropertiesInXML["ImmutabilityPolicyUntilDate"] === undefined
14245
- ? undefined
14246
- : new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]),
14247
- immutabilityPolicyMode: blobPropertiesInXML["ImmutabilityPolicyMode"],
14248
- legalHold: ParseBoolean(blobPropertiesInXML["LegalHold"]),
14249
- };
14250
- return {
14251
- name: ParseBlobName(blobInXML["Name"]),
14252
- deleted: ParseBoolean(blobInXML["Deleted"]),
14253
- snapshot: blobInXML["Snapshot"],
14254
- versionId: blobInXML["VersionId"],
14255
- isCurrentVersion: ParseBoolean(blobInXML["IsCurrentVersion"]),
14256
- properties: blobProperties,
14257
- metadata: blobInXML["Metadata"],
14258
- blobTags: ParseBlobTags(blobInXML["Tags"]),
14259
- objectReplicationMetadata: blobInXML["OrMetadata"],
14260
- hasVersionsOnly: ParseBoolean(blobInXML["HasVersionsOnly"]),
14261
- };
14351
+ const blobItem = blobInXML;
14352
+ blobItem.properties = ParseBlobProperties(blobInXML["Properties"]);
14353
+ delete blobItem["Properties"];
14354
+ blobItem.name = ParseBlobName(blobInXML["Name"]);
14355
+ delete blobItem["Name"];
14356
+ blobItem.deleted = ParseBoolean(blobInXML["Deleted"]);
14357
+ delete blobItem["Deleted"];
14358
+ if (blobInXML["Snapshot"]) {
14359
+ blobItem.snapshot = blobInXML["Snapshot"];
14360
+ delete blobItem["Snapshot"];
14361
+ }
14362
+ if (blobInXML["VersionId"]) {
14363
+ blobItem.versionId = blobInXML["VersionId"];
14364
+ delete blobItem["VersionId"];
14365
+ }
14366
+ if (blobInXML["IsCurrentVersion"]) {
14367
+ blobItem.isCurrentVersion = ParseBoolean(blobInXML["IsCurrentVersion"]);
14368
+ delete blobItem["IsCurrentVersion"];
14369
+ }
14370
+ if (blobInXML["Metadata"]) {
14371
+ blobItem.metadata = blobInXML["Metadata"];
14372
+ delete blobItem["Metadata"];
14373
+ }
14374
+ if (blobInXML["Tags"]) {
14375
+ blobItem.blobTags = ParseBlobTags(blobInXML["Tags"]);
14376
+ delete blobItem["Tags"];
14377
+ }
14378
+ if (blobInXML["OrMetadata"]) {
14379
+ blobItem.objectReplicationMetadata = blobInXML["OrMetadata"];
14380
+ delete blobItem["OrMetadata"];
14381
+ }
14382
+ if (blobInXML["HasVersionsOnly"]) {
14383
+ blobItem.hasVersionsOnly = ParseBoolean(blobInXML["HasVersionsOnly"]);
14384
+ delete blobItem["HasVersionsOnly"];
14385
+ }
14386
+ return blobItem;
14262
14387
  }
14263
14388
  function ParseBlobPrefix(blobPrefixInXML) {
14264
14389
  return {
@@ -14771,7 +14896,10 @@ class TelemetryPolicyFactory {
14771
14896
  userAgentInfo.push(libInfo);
14772
14897
  }
14773
14898
  // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299)
14774
- const runtimeInfo = `(NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()})`;
14899
+ let runtimeInfo = `(NODE-VERSION ${process.version})`;
14900
+ if (os__namespace) {
14901
+ runtimeInfo = `(NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()})`;
14902
+ }
14775
14903
  if (userAgentInfo.indexOf(runtimeInfo) === -1) {
14776
14904
  userAgentInfo.push(runtimeInfo);
14777
14905
  }
@@ -15309,7 +15437,7 @@ class StorageSharedKeyCredential extends Credential {
15309
15437
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15310
15438
  */
15311
15439
  const packageName = "azure-storage-blob";
15312
- const packageVersion = "12.10.0-beta.1";
15440
+ const packageVersion = "12.10.0-beta.2";
15313
15441
  class StorageClientContext extends coreHttp__namespace.ServiceClient {
15314
15442
  /**
15315
15443
  * Initializes a new instance of the StorageClientContext class.