@azure/storage-blob 12.10.0-beta.1 → 12.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/index.js +271 -142
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
  5. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
  6. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
  7. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  8. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  9. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  10. package/dist-esm/storage-blob/src/TelemetryPolicyFactory.js +4 -1
  11. package/dist-esm/storage-blob/src/TelemetryPolicyFactory.js.map +1 -1
  12. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +1 -1
  13. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
  14. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  15. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  16. package/dist-esm/storage-blob/src/utils/Batch.js.map +1 -1
  17. package/dist-esm/storage-blob/src/utils/constants.js +1 -1
  18. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  19. package/dist-esm/storage-blob/src/utils/utils.common.js +200 -75
  20. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  21. package/dist-esm/storage-common/src/BufferScheduler.js.map +1 -1
  22. package/dist-esm/storage-internal-avro/src/AvroParser.js +38 -40
  23. package/dist-esm/storage-internal-avro/src/AvroParser.js.map +1 -1
  24. package/dist-esm/storage-internal-avro/src/AvroReadableFromBlob.js +4 -4
  25. package/dist-esm/storage-internal-avro/src/AvroReadableFromBlob.js.map +1 -1
  26. package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js +7 -5
  27. package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js.map +1 -1
  28. package/dist-esm/storage-internal-avro/src/AvroReader.js +8 -6
  29. package/dist-esm/storage-internal-avro/src/AvroReader.js.map +1 -1
  30. package/dist-esm/storage-internal-avro/src/utils/utils.common.js +2 -1
  31. package/dist-esm/storage-internal-avro/src/utils/utils.common.js.map +1 -1
  32. package/package.json +2 -2
  33. package/types/3.1/storage-blob.d.ts +0 -26
  34. package/types/latest/storage-blob.d.ts +0 -27
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Release History
2
2
 
3
+ ## 12.10.0 (2022-05-12)
4
+
5
+ ### Features Added
6
+
7
+ - Includes all features released in 12.10.0-beta.1.
8
+
9
+ ### Bugs Fixed
10
+
11
+ - Refined user-agent value to avoid failure when os information is not available on some platforms.
12
+ - Fix an issue of not returning raw blob properties in ContainerClient.listBlobsFlat() and ContainerClient.listBlobsByHierarchy().
13
+
3
14
  ## 12.10.0-beta.1 (2022-04-19)
4
15
 
5
16
  ### 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";
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";
15313
15441
  class StorageClientContext extends coreHttp__namespace.ServiceClient {
15314
15442
  /**
15315
15443
  * Initializes a new instance of the StorageClientContext class.
@@ -17417,22 +17545,6 @@ const AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]);
17417
17545
  const AVRO_CODEC_KEY = "avro.codec";
17418
17546
  const AVRO_SCHEMA_KEY = "avro.schema";
17419
17547
 
17420
- // Copyright (c) Microsoft Corporation.
17421
- // Licensed under the MIT license.
17422
- function arraysEqual(a, b) {
17423
- if (a === b)
17424
- return true;
17425
- if (a == null || b == null)
17426
- return false;
17427
- if (a.length != b.length)
17428
- return false;
17429
- for (let i = 0; i < a.length; ++i) {
17430
- if (a[i] !== b[i])
17431
- return false;
17432
- }
17433
- return true;
17434
- }
17435
-
17436
17548
  // Copyright (c) Microsoft Corporation.
17437
17549
  // Licensed under the MIT license.
17438
17550
  class AvroParser {
@@ -17445,7 +17557,7 @@ class AvroParser {
17445
17557
  */
17446
17558
  static async readFixedBytes(stream, length, options = {}) {
17447
17559
  const bytes = await stream.read(length, { abortSignal: options.abortSignal });
17448
- if (bytes.length != length) {
17560
+ if (bytes.length !== length) {
17449
17561
  throw new Error("Hit stream end.");
17450
17562
  }
17451
17563
  return bytes;
@@ -17475,6 +17587,7 @@ class AvroParser {
17475
17587
  } while (haveMoreByte && significanceInBit < 28); // bitwise operation only works for 32-bit integers
17476
17588
  if (haveMoreByte) {
17477
17589
  // Switch to float arithmetic
17590
+ // eslint-disable-next-line no-self-assign
17478
17591
  zigZagEncoded = zigZagEncoded;
17479
17592
  significanceInFloat = 268435456; // 2 ** 28.
17480
17593
  do {
@@ -17501,10 +17614,10 @@ class AvroParser {
17501
17614
  }
17502
17615
  static async readBoolean(stream, options = {}) {
17503
17616
  const b = await AvroParser.readByte(stream, options);
17504
- if (b == 1) {
17617
+ if (b === 1) {
17505
17618
  return true;
17506
17619
  }
17507
- else if (b == 0) {
17620
+ else if (b === 0) {
17508
17621
  return false;
17509
17622
  }
17510
17623
  else {
@@ -17526,16 +17639,10 @@ class AvroParser {
17526
17639
  if (size < 0) {
17527
17640
  throw new Error("Bytes size was negative.");
17528
17641
  }
17529
- return await stream.read(size, { abortSignal: options.abortSignal });
17642
+ return stream.read(size, { abortSignal: options.abortSignal });
17530
17643
  }
17531
17644
  static async readString(stream, options = {}) {
17532
17645
  const u8arr = await AvroParser.readBytes(stream, options);
17533
- // polyfill TextDecoder to be backward compatible with older
17534
- // nodejs that doesn't expose TextDecoder as a global variable
17535
- if (typeof TextDecoder === "undefined" && typeof require !== "undefined") {
17536
- global.TextDecoder = require("util").TextDecoder;
17537
- }
17538
- // FUTURE: need TextDecoder polyfill for IE
17539
17646
  const utf8decoder = new TextDecoder();
17540
17647
  return utf8decoder.decode(u8arr);
17541
17648
  }
@@ -17546,8 +17653,8 @@ class AvroParser {
17546
17653
  return { key, value };
17547
17654
  }
17548
17655
  static async readMap(stream, readItemMethod, options = {}) {
17549
- const readPairMethod = async (stream, options = {}) => {
17550
- return await AvroParser.readMapPair(stream, readItemMethod, options);
17656
+ const readPairMethod = (s, opts = {}) => {
17657
+ return AvroParser.readMapPair(s, readItemMethod, opts);
17551
17658
  };
17552
17659
  const pairs = await AvroParser.readArray(stream, readPairMethod, options);
17553
17660
  const dict = {};
@@ -17558,7 +17665,7 @@ class AvroParser {
17558
17665
  }
17559
17666
  static async readArray(stream, readItemMethod, options = {}) {
17560
17667
  const items = [];
17561
- for (let count = await AvroParser.readLong(stream, options); count != 0; count = await AvroParser.readLong(stream, options)) {
17668
+ for (let count = await AvroParser.readLong(stream, options); count !== 0; count = await AvroParser.readLong(stream, options)) {
17562
17669
  if (count < 0) {
17563
17670
  // Ignore block sizes
17564
17671
  await AvroParser.readLong(stream, options);
@@ -17581,6 +17688,17 @@ var AvroComplex;
17581
17688
  AvroComplex["UNION"] = "union";
17582
17689
  AvroComplex["FIXED"] = "fixed";
17583
17690
  })(AvroComplex || (AvroComplex = {}));
17691
+ var AvroPrimitive;
17692
+ (function (AvroPrimitive) {
17693
+ AvroPrimitive["NULL"] = "null";
17694
+ AvroPrimitive["BOOLEAN"] = "boolean";
17695
+ AvroPrimitive["INT"] = "int";
17696
+ AvroPrimitive["LONG"] = "long";
17697
+ AvroPrimitive["FLOAT"] = "float";
17698
+ AvroPrimitive["DOUBLE"] = "double";
17699
+ AvroPrimitive["BYTES"] = "bytes";
17700
+ AvroPrimitive["STRING"] = "string";
17701
+ })(AvroPrimitive || (AvroPrimitive = {}));
17584
17702
  class AvroType {
17585
17703
  /**
17586
17704
  * Determines the AvroType from the Avro Schema.
@@ -17620,7 +17738,9 @@ class AvroType {
17620
17738
  try {
17621
17739
  return AvroType.fromStringSchema(type);
17622
17740
  }
17623
- catch (err) { }
17741
+ catch (err) {
17742
+ // eslint-disable-line no-empty
17743
+ }
17624
17744
  switch (type) {
17625
17745
  case AvroComplex.RECORD:
17626
17746
  if (schema.aliases) {
@@ -17629,6 +17749,7 @@ class AvroType {
17629
17749
  if (!schema.name) {
17630
17750
  throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`);
17631
17751
  }
17752
+ // eslint-disable-next-line no-case-declarations
17632
17753
  const fields = {};
17633
17754
  if (!schema.fields) {
17634
17755
  throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`);
@@ -17657,40 +17778,29 @@ class AvroType {
17657
17778
  }
17658
17779
  }
17659
17780
  }
17660
- var AvroPrimitive;
17661
- (function (AvroPrimitive) {
17662
- AvroPrimitive["NULL"] = "null";
17663
- AvroPrimitive["BOOLEAN"] = "boolean";
17664
- AvroPrimitive["INT"] = "int";
17665
- AvroPrimitive["LONG"] = "long";
17666
- AvroPrimitive["FLOAT"] = "float";
17667
- AvroPrimitive["DOUBLE"] = "double";
17668
- AvroPrimitive["BYTES"] = "bytes";
17669
- AvroPrimitive["STRING"] = "string";
17670
- })(AvroPrimitive || (AvroPrimitive = {}));
17671
17781
  class AvroPrimitiveType extends AvroType {
17672
17782
  constructor(primitive) {
17673
17783
  super();
17674
17784
  this._primitive = primitive;
17675
17785
  }
17676
- async read(stream, options = {}) {
17786
+ read(stream, options = {}) {
17677
17787
  switch (this._primitive) {
17678
17788
  case AvroPrimitive.NULL:
17679
- return await AvroParser.readNull();
17789
+ return AvroParser.readNull();
17680
17790
  case AvroPrimitive.BOOLEAN:
17681
- return await AvroParser.readBoolean(stream, options);
17791
+ return AvroParser.readBoolean(stream, options);
17682
17792
  case AvroPrimitive.INT:
17683
- return await AvroParser.readInt(stream, options);
17793
+ return AvroParser.readInt(stream, options);
17684
17794
  case AvroPrimitive.LONG:
17685
- return await AvroParser.readLong(stream, options);
17795
+ return AvroParser.readLong(stream, options);
17686
17796
  case AvroPrimitive.FLOAT:
17687
- return await AvroParser.readFloat(stream, options);
17797
+ return AvroParser.readFloat(stream, options);
17688
17798
  case AvroPrimitive.DOUBLE:
17689
- return await AvroParser.readDouble(stream, options);
17799
+ return AvroParser.readDouble(stream, options);
17690
17800
  case AvroPrimitive.BYTES:
17691
- return await AvroParser.readBytes(stream, options);
17801
+ return AvroParser.readBytes(stream, options);
17692
17802
  case AvroPrimitive.STRING:
17693
- return await AvroParser.readString(stream, options);
17803
+ return AvroParser.readString(stream, options);
17694
17804
  default:
17695
17805
  throw new Error("Unknown Avro Primitive");
17696
17806
  }
@@ -17713,7 +17823,7 @@ class AvroUnionType extends AvroType {
17713
17823
  }
17714
17824
  async read(stream, options = {}) {
17715
17825
  const typeIndex = await AvroParser.readInt(stream, options);
17716
- return await this._types[typeIndex].read(stream, options);
17826
+ return this._types[typeIndex].read(stream, options);
17717
17827
  }
17718
17828
  }
17719
17829
  class AvroMapType extends AvroType {
@@ -17721,11 +17831,11 @@ class AvroMapType extends AvroType {
17721
17831
  super();
17722
17832
  this._itemType = itemType;
17723
17833
  }
17724
- async read(stream, options = {}) {
17725
- const readItemMethod = async (s, options) => {
17726
- return await this._itemType.read(s, options);
17834
+ read(stream, options = {}) {
17835
+ const readItemMethod = (s, opts) => {
17836
+ return this._itemType.read(s, opts);
17727
17837
  };
17728
- return await AvroParser.readMap(stream, readItemMethod, options);
17838
+ return AvroParser.readMap(stream, readItemMethod, options);
17729
17839
  }
17730
17840
  }
17731
17841
  class AvroRecordType extends AvroType {
@@ -17738,7 +17848,7 @@ class AvroRecordType extends AvroType {
17738
17848
  const record = {};
17739
17849
  record["$schema"] = this._name;
17740
17850
  for (const key in this._fields) {
17741
- if (this._fields.hasOwnProperty(key)) {
17851
+ if (Object.prototype.hasOwnProperty.call(this._fields, key)) {
17742
17852
  record[key] = await this._fields[key].read(stream, options);
17743
17853
  }
17744
17854
  }
@@ -17746,6 +17856,23 @@ class AvroRecordType extends AvroType {
17746
17856
  }
17747
17857
  }
17748
17858
 
17859
+ // Copyright (c) Microsoft Corporation.
17860
+ // Licensed under the MIT license.
17861
+ function arraysEqual(a, b) {
17862
+ if (a === b)
17863
+ return true;
17864
+ // eslint-disable-next-line eqeqeq
17865
+ if (a == null || b == null)
17866
+ return false;
17867
+ if (a.length !== b.length)
17868
+ return false;
17869
+ for (let i = 0; i < a.length; ++i) {
17870
+ if (a[i] !== b[i])
17871
+ return false;
17872
+ }
17873
+ return true;
17874
+ }
17875
+
17749
17876
  // Copyright (c) Microsoft Corporation.
17750
17877
  class AvroReader {
17751
17878
  constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) {
@@ -17776,7 +17903,7 @@ class AvroReader {
17776
17903
  });
17777
17904
  // Validate codec
17778
17905
  const codec = this._metadata[AVRO_CODEC_KEY];
17779
- if (!(codec == undefined || codec == "null")) {
17906
+ if (!(codec === undefined || codec === null || codec === "null")) {
17780
17907
  throw new Error("Codecs are not supported");
17781
17908
  }
17782
17909
  // The 16-byte, randomly-generated sync marker for this file.
@@ -17786,7 +17913,7 @@ class AvroReader {
17786
17913
  // Parse the schema
17787
17914
  const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);
17788
17915
  this._itemType = AvroType.fromSchema(schema);
17789
- if (this._blockOffset == 0) {
17916
+ if (this._blockOffset === 0) {
17790
17917
  this._blockOffset = this._initialBlockOffset + this._dataStream.position;
17791
17918
  }
17792
17919
  this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
@@ -17816,7 +17943,7 @@ class AvroReader {
17816
17943
  }));
17817
17944
  this._itemsRemainingInBlock--;
17818
17945
  this._objectIndex++;
17819
- if (this._itemsRemainingInBlock == 0) {
17946
+ if (this._itemsRemainingInBlock === 0) {
17820
17947
  const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
17821
17948
  abortSignal: options.abortSignal,
17822
17949
  }));
@@ -17891,6 +18018,7 @@ class AvroReadableFromStream extends AvroReadable {
17891
18018
  else {
17892
18019
  // register callback to wait for enough data to read
17893
18020
  return new Promise((resolve, reject) => {
18021
+ /* eslint-disable @typescript-eslint/no-use-before-define */
17894
18022
  const cleanUp = () => {
17895
18023
  this._readable.removeListener("readable", readableCallback);
17896
18024
  this._readable.removeListener("error", rejectCallback);
@@ -17901,12 +18029,12 @@ class AvroReadableFromStream extends AvroReadable {
17901
18029
  }
17902
18030
  };
17903
18031
  const readableCallback = () => {
17904
- const chunk = this._readable.read(size);
17905
- if (chunk) {
17906
- this._position += chunk.length;
18032
+ const callbackChunk = this._readable.read(size);
18033
+ if (callbackChunk) {
18034
+ this._position += callbackChunk.length;
17907
18035
  cleanUp();
17908
- // chunk.length maybe less than desired size if the stream ends.
17909
- resolve(this.toUint8Array(chunk));
18036
+ // callbackChunk.length maybe less than desired size if the stream ends.
18037
+ resolve(this.toUint8Array(callbackChunk));
17910
18038
  }
17911
18039
  };
17912
18040
  const rejectCallback = () => {
@@ -17924,6 +18052,7 @@ class AvroReadableFromStream extends AvroReadable {
17924
18052
  if (options.abortSignal) {
17925
18053
  options.abortSignal.addEventListener("abort", abortHandler);
17926
18054
  }
18055
+ /* eslint-enable @typescript-eslint/no-use-before-define */
17927
18056
  });
17928
18057
  }
17929
18058
  }