@azure/event-hubs 5.7.0-alpha.20220126.1 → 5.7.0-alpha.20220128.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/dist/index.js +37 -14
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
5
|
var abortController = require('@azure/abort-controller');
|
|
8
6
|
var logger$1 = require('@azure/logger');
|
|
9
7
|
var coreAuth = require('@azure/core-auth');
|
|
@@ -11,10 +9,33 @@ var coreAmqp = require('@azure/core-amqp');
|
|
|
11
9
|
var coreTracing = require('@azure/core-tracing');
|
|
12
10
|
var rheaPromise = require('rhea-promise');
|
|
13
11
|
var buffer = require('buffer');
|
|
14
|
-
var isBuffer =
|
|
12
|
+
var isBuffer = require('is-buffer');
|
|
15
13
|
var uuid = require('uuid');
|
|
16
14
|
var os = require('os');
|
|
17
|
-
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
function _interopNamespace(e) {
|
|
19
|
+
if (e && e.__esModule) return e;
|
|
20
|
+
var n = Object.create(null);
|
|
21
|
+
if (e) {
|
|
22
|
+
Object.keys(e).forEach(function (k) {
|
|
23
|
+
if (k !== 'default') {
|
|
24
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
n["default"] = e;
|
|
33
|
+
return Object.freeze(n);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var isBuffer__default = /*#__PURE__*/_interopDefaultLegacy(isBuffer);
|
|
37
|
+
var os__namespace = /*#__PURE__*/_interopNamespace(os);
|
|
38
|
+
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
|
|
18
39
|
|
|
19
40
|
// Copyright (c) Microsoft Corporation.
|
|
20
41
|
/**
|
|
@@ -320,6 +341,12 @@ function validateEventPosition(position) {
|
|
|
320
341
|
}
|
|
321
342
|
|
|
322
343
|
// Copyright (c) Microsoft Corporation.
|
|
344
|
+
// Licensed under the MIT license.
|
|
345
|
+
/**
|
|
346
|
+
* An enum representing the different reasons for an `EventHubConsumerClient` to stop processing
|
|
347
|
+
* events from a partition in a consumer group of an Event Hub.
|
|
348
|
+
*/
|
|
349
|
+
exports.CloseReason = void 0;
|
|
323
350
|
(function (CloseReason) {
|
|
324
351
|
/**
|
|
325
352
|
* Ownership of the partition was lost or transitioned to a new processor instance.
|
|
@@ -367,7 +394,7 @@ const defaultDataTransformer = {
|
|
|
367
394
|
else if (bodyType === "sequence") {
|
|
368
395
|
result = rheaPromise.message.sequence_section(body);
|
|
369
396
|
}
|
|
370
|
-
else if (
|
|
397
|
+
else if (isBuffer__default["default"](body)) {
|
|
371
398
|
result = rheaPromise.message.data_section(body);
|
|
372
399
|
}
|
|
373
400
|
else if (body === null && bodyType === "data") {
|
|
@@ -416,7 +443,7 @@ const defaultDataTransformer = {
|
|
|
416
443
|
}
|
|
417
444
|
}
|
|
418
445
|
else {
|
|
419
|
-
if (
|
|
446
|
+
if (isBuffer__default["default"](body)) {
|
|
420
447
|
return { body: skipParsingBodyAsJson ? body : tryToJsonDecode(body), bodyType: "data" };
|
|
421
448
|
}
|
|
422
449
|
return { body, bodyType: "value" };
|
|
@@ -2626,7 +2653,7 @@ const EventHubConnectionConfig = {
|
|
|
2626
2653
|
* @internal
|
|
2627
2654
|
*/
|
|
2628
2655
|
function getRuntimeInfo() {
|
|
2629
|
-
return `NODE-VERSION ${process.version}; ${
|
|
2656
|
+
return `NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()}`;
|
|
2630
2657
|
}
|
|
2631
2658
|
|
|
2632
2659
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4728,7 +4755,7 @@ function mapPartitionKeyToId(partitionKey, partitionCount) {
|
|
|
4728
4755
|
return Math.abs(hashedParitionKey % partitionCount);
|
|
4729
4756
|
}
|
|
4730
4757
|
function readUInt32(data, offset) {
|
|
4731
|
-
return os__default.endianness() === "BE" ? data.readUInt32BE(offset) : data.readUInt32LE(offset);
|
|
4758
|
+
return os__default["default"].endianness() === "BE" ? data.readUInt32BE(offset) : data.readUInt32LE(offset);
|
|
4732
4759
|
}
|
|
4733
4760
|
function castToInt16(n) {
|
|
4734
4761
|
return new Int16Array([n])[0];
|
|
@@ -5144,15 +5171,11 @@ function createEventDataAdapter(params = {}) {
|
|
|
5144
5171
|
|
|
5145
5172
|
Object.defineProperty(exports, 'MessagingError', {
|
|
5146
5173
|
enumerable: true,
|
|
5147
|
-
get: function () {
|
|
5148
|
-
return coreAmqp.MessagingError;
|
|
5149
|
-
}
|
|
5174
|
+
get: function () { return coreAmqp.MessagingError; }
|
|
5150
5175
|
});
|
|
5151
5176
|
Object.defineProperty(exports, 'RetryMode', {
|
|
5152
5177
|
enumerable: true,
|
|
5153
|
-
get: function () {
|
|
5154
|
-
return coreAmqp.RetryMode;
|
|
5155
|
-
}
|
|
5178
|
+
get: function () { return coreAmqp.RetryMode; }
|
|
5156
5179
|
});
|
|
5157
5180
|
exports.EventHubBufferedProducerClient = EventHubBufferedProducerClient;
|
|
5158
5181
|
exports.EventHubConsumerClient = EventHubConsumerClient;
|