@signageos/lib 23.9.1 → 23.9.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/README.md +2 -2
- package/dist/AMQP/CQRS/ICommand.d.ts +3 -36
- package/dist/AMQP/CQRS/ICommand.js +18 -0
- package/dist/AMQP/CQRS/ICommand.js.map +1 -1
- package/dist/AMQP/CQRS/ICommandError.d.ts +4 -4
- package/dist/AMQP/CQRS/commandQueue.d.ts +4 -59
- package/dist/AMQP/CQRS/commandQueue.js +16 -308
- package/dist/AMQP/CQRS/commandQueue.js.map +1 -1
- package/dist/AMQP/CQRS/commandResponseHelper.d.ts +4 -3
- package/dist/AMQP/CQRS/commandResponseHelper.js +18 -5
- package/dist/AMQP/CQRS/commandResponseHelper.js.map +1 -1
- package/dist/AMQP/CQRS/storedCommandQueue.d.ts +4 -27
- package/dist/AMQP/CQRS/storedCommandQueue.js +16 -296
- package/dist/AMQP/CQRS/storedCommandQueue.js.map +1 -1
- package/dist/AMQP/ChannelProvider.d.ts +5 -37
- package/dist/AMQP/ChannelProvider.js +9 -868
- package/dist/AMQP/ChannelProvider.js.map +1 -1
- package/dist/AMQP/DeviceActions/Bridge/deviceActionBridgeFactory.d.ts +4 -39
- package/dist/AMQP/DeviceActions/Bridge/deviceActionBridgeFactory.js +16 -287
- package/dist/AMQP/DeviceActions/Bridge/deviceActionBridgeFactory.js.map +1 -1
- package/dist/AMQP/DeviceActions/IDeviceAction.d.ts +4 -4
- package/dist/AMQP/DeviceActions/deviceActionsQueue.d.ts +2 -81
- package/dist/AMQP/DeviceActions/deviceActionsQueue.js +14 -531
- package/dist/AMQP/DeviceActions/deviceActionsQueue.js.map +1 -1
- package/dist/AMQP/EventSourcing/EventConsumer/AmqpEventConsumer.d.ts +2 -45
- package/dist/AMQP/EventSourcing/EventConsumer/AmqpEventConsumer.js +14 -211
- package/dist/AMQP/EventSourcing/EventConsumer/AmqpEventConsumer.js.map +1 -1
- package/dist/AMQP/EventSourcing/EventConsumer/IEventConsumer.d.ts +2 -11
- package/dist/AMQP/EventSourcing/EventConsumer/IEventConsumer.js +18 -0
- package/dist/AMQP/EventSourcing/EventConsumer/IEventConsumer.js.map +1 -1
- package/dist/AMQP/EventSourcing/EventConsumer/InMemoryEventConsumer.d.ts +2 -13
- package/dist/AMQP/EventSourcing/EventConsumer/InMemoryEventConsumer.js +14 -69
- package/dist/AMQP/EventSourcing/EventConsumer/InMemoryEventConsumer.js.map +1 -1
- package/dist/AMQP/EventSourcing/IEvent.d.ts +3 -70
- package/dist/AMQP/EventSourcing/IEvent.js +18 -0
- package/dist/AMQP/EventSourcing/IEvent.js.map +1 -1
- package/dist/AMQP/EventSourcing/Locked/deferredState.d.ts +2 -19
- package/dist/AMQP/EventSourcing/Locked/deferredState.js +15 -66
- package/dist/AMQP/EventSourcing/Locked/deferredState.js.map +1 -1
- package/dist/AMQP/EventSourcing/Locked/lockedEventConsumer.d.ts +2 -68
- package/dist/AMQP/EventSourcing/Locked/lockedEventConsumer.js +14 -429
- package/dist/AMQP/EventSourcing/Locked/lockedEventConsumer.js.map +1 -1
- package/dist/AMQP/EventSourcing/Locked/rejectedTimestamps.d.ts +2 -22
- package/dist/AMQP/EventSourcing/Locked/rejectedTimestamps.js +16 -59
- package/dist/AMQP/EventSourcing/Locked/rejectedTimestamps.js.map +1 -1
- package/dist/AMQP/EventSourcing/Locked/withLock.d.ts +2 -40
- package/dist/AMQP/EventSourcing/Locked/withLock.js +14 -134
- package/dist/AMQP/EventSourcing/Locked/withLock.js.map +1 -1
- package/dist/AMQP/EventSourcing/eventQueue.d.ts +2 -85
- package/dist/AMQP/EventSourcing/eventQueue.js +14 -132
- package/dist/AMQP/EventSourcing/eventQueue.js.map +1 -1
- package/dist/AMQP/EventSourcing/eventQueue.utils.d.ts +2 -71
- package/dist/AMQP/EventSourcing/eventQueue.utils.js +16 -152
- package/dist/AMQP/EventSourcing/eventQueue.utils.js.map +1 -1
- package/dist/AMQP/EventSourcing/eventQueueDetached.d.ts +2 -47
- package/dist/AMQP/EventSourcing/eventQueueDetached.js +14 -421
- package/dist/AMQP/EventSourcing/eventQueueDetached.js.map +1 -1
- package/dist/AMQP/EventSourcing/eventQueueDomain.d.ts +2 -53
- package/dist/AMQP/EventSourcing/eventQueueDomain.js +14 -611
- package/dist/AMQP/EventSourcing/eventQueueDomain.js.map +1 -1
- package/dist/AMQP/EventSourcing/eventQueuePublish.d.ts +2 -17
- package/dist/AMQP/EventSourcing/eventQueuePublish.js +14 -202
- package/dist/AMQP/EventSourcing/eventQueuePublish.js.map +1 -1
- package/dist/AMQP/EventSourcing/synchronization.d.ts +2 -37
- package/dist/AMQP/EventSourcing/synchronization.js +18 -9
- package/dist/AMQP/EventSourcing/synchronization.js.map +1 -1
- package/dist/AMQP/Exchange.d.ts +4 -1
- package/dist/AMQP/Exchange.js +18 -0
- package/dist/AMQP/Exchange.js.map +1 -1
- package/dist/AMQP/IAsyncGotMessage.d.ts +2 -13
- package/dist/AMQP/IAsyncGotMessage.js +18 -0
- package/dist/AMQP/IAsyncGotMessage.js.map +1 -1
- package/dist/AMQP/IChannel.d.ts +5 -43
- package/dist/AMQP/IChannel.js +18 -0
- package/dist/AMQP/IChannel.js.map +1 -1
- package/dist/AMQP/IConsumeOptions.d.ts +5 -106
- package/dist/AMQP/IConsumeOptions.js +18 -0
- package/dist/AMQP/IConsumeOptions.js.map +1 -1
- package/dist/AMQP/IMessageOptions.d.ts +5 -6
- package/dist/AMQP/IMessageOptions.js +18 -0
- package/dist/AMQP/IMessageOptions.js.map +1 -1
- package/dist/AMQP/INackOptions.d.ts +5 -4
- package/dist/AMQP/INackOptions.js +18 -0
- package/dist/AMQP/INackOptions.js.map +1 -1
- package/dist/AMQP/IQueueOptions.d.ts +5 -8
- package/dist/AMQP/IQueueOptions.js +18 -0
- package/dist/AMQP/IQueueOptions.js.map +1 -1
- package/dist/AMQP/Logging/IDeviceLog.d.ts +4 -15
- package/dist/AMQP/Logging/IDeviceLog.js +18 -7
- package/dist/AMQP/Logging/IDeviceLog.js.map +1 -1
- package/dist/AMQP/Logging/logDeviceQueue.d.ts +4 -12
- package/dist/AMQP/Logging/logDeviceQueue.js +16 -102
- package/dist/AMQP/Logging/logDeviceQueue.js.map +1 -1
- package/dist/AMQP/QueueFetcher.d.ts +3 -11
- package/dist/AMQP/QueueFetcher.js +17 -156
- package/dist/AMQP/QueueFetcher.js.map +1 -1
- package/dist/AMQP/QueuePublisher.d.ts +5 -7
- package/dist/AMQP/QueuePublisher.js +19 -127
- package/dist/AMQP/QueuePublisher.js.map +1 -1
- package/dist/AMQP/QueueRepeatableSubscription.d.ts +5 -14
- package/dist/AMQP/QueueRepeatableSubscription.js +19 -154
- package/dist/AMQP/QueueRepeatableSubscription.js.map +1 -1
- package/dist/AMQP/QueueSubscriber.d.ts +5 -27
- package/dist/AMQP/QueueSubscriber.js +9 -303
- package/dist/AMQP/QueueSubscriber.js.map +1 -1
- package/dist/AMQP/ResponseProvider.d.ts +4 -20
- package/dist/AMQP/ResponseProvider.js +16 -188
- package/dist/AMQP/ResponseProvider.js.map +1 -1
- package/dist/AMQP/Static/filesQueue.d.ts +4 -12
- package/dist/AMQP/Static/filesQueue.js +6 -205
- package/dist/AMQP/Static/filesQueue.js.map +1 -1
- package/dist/AMQP/amqpConnectionFactory.d.ts +2 -25
- package/dist/AMQP/amqpConnectionFactory.js +4 -219
- package/dist/AMQP/amqpConnectionFactory.js.map +1 -1
- package/dist/AMQP/amqpErrors.d.ts +4 -5
- package/dist/AMQP/amqpErrors.js +18 -27
- package/dist/AMQP/amqpErrors.js.map +1 -1
- package/dist/AMQP/errors.d.ts +4 -3
- package/dist/AMQP/errors.js +18 -27
- package/dist/AMQP/errors.js.map +1 -1
- package/dist/AMQP/fetchNextMessage.d.ts +3 -12
- package/dist/AMQP/fetchNextMessage.js +20 -111
- package/dist/AMQP/fetchNextMessage.js.map +1 -1
- package/dist/AMQP/queueConfigurator.d.ts +2 -3
- package/dist/AMQP/queueConfigurator.js +14 -71
- package/dist/AMQP/queueConfigurator.js.map +1 -1
- package/dist/DateTime/waitUntil.d.ts +4 -15
- package/dist/DateTime/waitUntil.js +17 -139
- package/dist/DateTime/waitUntil.js.map +1 -1
- package/dist/Events/AsyncEventEmitter.d.ts +2 -29
- package/dist/Events/AsyncEventEmitter.js +14 -118
- package/dist/Events/AsyncEventEmitter.js.map +1 -1
- package/dist/Events/eventsHelpers.d.ts +4 -3
- package/dist/Events/eventsHelpers.js +18 -21
- package/dist/Events/eventsHelpers.js.map +1 -1
- package/dist/Hash/checksum.d.ts +2 -3
- package/dist/Hash/checksum.js +16 -15
- package/dist/Hash/checksum.js.map +1 -1
- package/dist/Hash/checksumFile.d.ts +2 -2
- package/dist/Hash/checksumFile.js +4 -65
- package/dist/Hash/checksumFile.js.map +1 -1
- package/dist/Hash/generator.d.ts +4 -2
- package/dist/Hash/generator.js +18 -12
- package/dist/Hash/generator.js.map +1 -1
- package/dist/HttpStatus/checks/amqpStatusCheck.d.ts +1 -1
- package/dist/HttpStatus/statuses/amqpStatus.d.ts +1 -1
- package/dist/Metrics/MetricsClient.d.ts +2 -44
- package/dist/Metrics/MetricsClient.js +6 -86
- package/dist/Metrics/MetricsClient.js.map +1 -1
- package/dist/Metrics/metrics.d.ts +2 -82
- package/dist/Metrics/metrics.js +4 -238
- package/dist/Metrics/metrics.js.map +1 -1
- package/dist/Metrics/processSocketsMetrics.d.ts +4 -10
- package/dist/Metrics/processSocketsMetrics.js +17 -88
- package/dist/Metrics/processSocketsMetrics.js.map +1 -1
- package/dist/Service/dbConnections.d.ts +1 -1
- package/dist/Service/metrics/connections.js +7 -7
- package/dist/Service/metrics/connections.js.map +1 -1
- package/dist/ThirdParty/connection.d.ts +0 -11
- package/package.json +5 -9
- package/dist/AMQP/IAMQPPool.d.ts +0 -5
- package/dist/AMQP/IAMQPPool.js +0 -3
- package/dist/AMQP/IAMQPPool.js.map +0 -1
- package/dist/Events/genericGracefulExit.d.ts +0 -11
- package/dist/Events/genericGracefulExit.js +0 -90
- package/dist/Events/genericGracefulExit.js.map +0 -1
- package/dist/GenericPool/options.d.ts +0 -63
- package/dist/GenericPool/options.js +0 -3
- package/dist/GenericPool/options.js.map +0 -1
- package/dist/Metrics/deviceConsumerMetrics.d.ts +0 -6
- package/dist/Metrics/deviceConsumerMetrics.js +0 -59
- package/dist/Metrics/deviceConsumerMetrics.js.map +0 -1
- package/dist/Metrics/eventConsumerMetrics.d.ts +0 -19
- package/dist/Metrics/eventConsumerMetrics.js +0 -52
- package/dist/Metrics/eventConsumerMetrics.js.map +0 -1
- package/dist/Metrics/eventQueueMetrics.d.ts +0 -7
- package/dist/Metrics/eventQueueMetrics.js +0 -19
- package/dist/Metrics/eventQueueMetrics.js.map +0 -1
- package/dist/Pool/IBasePool.d.ts +0 -6
- package/dist/Pool/IBasePool.js +0 -3
- package/dist/Pool/IBasePool.js.map +0 -1
- package/dist/System/signalSender.d.ts +0 -1
- package/dist/System/signalSender.js +0 -7
- package/dist/System/signalSender.js.map +0 -1
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { IAMQPConnection } from '../amqpConnectionFactory';
|
|
2
|
-
import IMessageOptions from '../IMessageOptions';
|
|
3
|
-
import IEvent, { IEventPayload } from './IEvent';
|
|
4
|
-
export declare const emitEventEnqueued: (event: IEvent<any>, count?: number) => void;
|
|
5
|
-
export declare function enqueue(amqpConnection: IAMQPConnection, event: IEvent<IEventPayload>, messageOptions?: IMessageOptions, headers?: Record<string, string>): Promise<void>;
|
|
6
1
|
/**
|
|
7
|
-
* @
|
|
8
|
-
* @param batchSize Number of events to enqueue in one batch
|
|
2
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
9
3
|
*/
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use @signageos/user-domain-model/dist/Lib/CQRS/commandSynchronization instead
|
|
13
|
-
*/
|
|
14
|
-
export declare function enqueueNotification(amqpConnection: IAMQPConnection, event: IEvent<IEventPayload>): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Use @signageos/user-domain-model/dist/Lib/CQRS/commandSynchronization instead
|
|
17
|
-
*/
|
|
18
|
-
export declare function enqueueNotificationsBatch(amqpConnection: IAMQPConnection, events: IEvent<IEventPayload>[]): Promise<void>;
|
|
19
|
-
export declare function enqueueToConsumer(amqpConnection: IAMQPConnection, event: IEvent<IEventPayload>, consumerType: string, eventTypeOrDomainName?: string, messageOptions?: IMessageOptions): Promise<void>;
|
|
4
|
+
export * from '@signageos/amqp/dist/EventSourcing/eventQueuePublish';
|
|
@@ -1,209 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
36
7
|
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
15
|
};
|
|
38
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.emitEventEnqueued = void 0;
|
|
40
|
-
exports.enqueue = enqueue;
|
|
41
|
-
exports.enqueueBatch = enqueueBatch;
|
|
42
|
-
exports.enqueueNotification = enqueueNotification;
|
|
43
|
-
exports.enqueueNotificationsBatch = enqueueNotificationsBatch;
|
|
44
|
-
exports.enqueueToConsumer = enqueueToConsumer;
|
|
45
|
-
var eventQueue_utils_1 = require("./eventQueue.utils");
|
|
46
|
-
var eventQueueMetrics_1 = require("../../Metrics/eventQueueMetrics");
|
|
47
|
-
var emitEventEnqueued = function (event, count) {
|
|
48
|
-
eventQueueMetrics_1.metrics.emit('event_enqueued', { eventType: event.type }, count || 1);
|
|
49
|
-
};
|
|
50
|
-
exports.emitEventEnqueued = emitEventEnqueued;
|
|
51
|
-
var createEnqueueChannel = function (amqpConnection, event, exchangeName) { return function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
52
|
-
var channel;
|
|
53
|
-
return __generator(this, function (_a) {
|
|
54
|
-
switch (_a.label) {
|
|
55
|
-
case 0: return [4 /*yield*/, amqpConnection.channelProvider.getChannel(event.type, eventQueue_utils_1.OPTIONS)];
|
|
56
|
-
case 1:
|
|
57
|
-
channel = _a.sent();
|
|
58
|
-
return [4 /*yield*/, channel.assertExchange(eventQueue_utils_1.FAILED_EXCHANGE_NAME, 'direct')];
|
|
59
|
-
case 2:
|
|
60
|
-
_a.sent();
|
|
61
|
-
return [4 /*yield*/, channel.assertExchange(exchangeName, 'fanout', { alternateExchange: eventQueue_utils_1.FAILED_EXCHANGE_NAME })];
|
|
62
|
-
case 3:
|
|
63
|
-
_a.sent();
|
|
64
|
-
return [2 /*return*/, channel];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}); }; };
|
|
68
|
-
var createEnqueueBatchChannel = function (amqpConnection, eventTypes, options) {
|
|
69
|
-
if (options === void 0) { options = {}; }
|
|
70
|
-
return function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
var channel, _i, eventTypes_1, eventType, exchangeName;
|
|
72
|
-
return __generator(this, function (_a) {
|
|
73
|
-
switch (_a.label) {
|
|
74
|
-
case 0: return [4 /*yield*/, amqpConnection.channelProvider.getChannel('batch', eventQueue_utils_1.OPTIONS)];
|
|
75
|
-
case 1:
|
|
76
|
-
channel = _a.sent();
|
|
77
|
-
return [4 /*yield*/, channel.assertExchange(eventQueue_utils_1.FAILED_EXCHANGE_NAME, 'direct')];
|
|
78
|
-
case 2:
|
|
79
|
-
_a.sent();
|
|
80
|
-
_i = 0, eventTypes_1 = eventTypes;
|
|
81
|
-
_a.label = 3;
|
|
82
|
-
case 3:
|
|
83
|
-
if (!(_i < eventTypes_1.length)) return [3 /*break*/, 6];
|
|
84
|
-
eventType = eventTypes_1[_i];
|
|
85
|
-
exchangeName = (0, eventQueue_utils_1.getExchangeName)(options, eventType);
|
|
86
|
-
return [4 /*yield*/, channel.assertExchange(exchangeName, 'fanout', { alternateExchange: eventQueue_utils_1.FAILED_EXCHANGE_NAME })];
|
|
87
|
-
case 4:
|
|
88
|
-
_a.sent();
|
|
89
|
-
_a.label = 5;
|
|
90
|
-
case 5:
|
|
91
|
-
_i++;
|
|
92
|
-
return [3 /*break*/, 3];
|
|
93
|
-
case 6: return [2 /*return*/, channel];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}); };
|
|
97
|
-
};
|
|
98
|
-
function enqueue(amqpConnection_1, event_1) {
|
|
99
|
-
return __awaiter(this, arguments, void 0, function (amqpConnection, event, messageOptions, headers) {
|
|
100
|
-
var exchangeName;
|
|
101
|
-
if (messageOptions === void 0) { messageOptions = {}; }
|
|
102
|
-
if (headers === void 0) { headers = {}; }
|
|
103
|
-
return __generator(this, function (_a) {
|
|
104
|
-
switch (_a.label) {
|
|
105
|
-
case 0:
|
|
106
|
-
exchangeName = (0, eventQueue_utils_1.getExchangeName)({ notification: false }, event.type);
|
|
107
|
-
return [4 /*yield*/, amqpConnection.queuePublisher.enqueue(createEnqueueChannel(amqpConnection, event, exchangeName), event, headers, exchangeName, (0, eventQueue_utils_1.getBasicEventRoutingKey)(event.type), messageOptions)];
|
|
108
|
-
case 1:
|
|
109
|
-
_a.sent();
|
|
110
|
-
(0, exports.emitEventEnqueued)(event);
|
|
111
|
-
return [2 /*return*/];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* @param events Events to enqueue
|
|
118
|
-
* @param batchSize Number of events to enqueue in one batch
|
|
119
|
-
*/
|
|
120
|
-
function enqueueBatch(amqpConnection_1, events_1) {
|
|
121
|
-
return __awaiter(this, arguments, void 0, function (amqpConnection, events, messageOptions, headers, batchSize) {
|
|
122
|
-
var eventTypes;
|
|
123
|
-
if (messageOptions === void 0) { messageOptions = {}; }
|
|
124
|
-
if (headers === void 0) { headers = {}; }
|
|
125
|
-
if (batchSize === void 0) { batchSize = 100; }
|
|
126
|
-
return __generator(this, function (_a) {
|
|
127
|
-
switch (_a.label) {
|
|
128
|
-
case 0:
|
|
129
|
-
if (events.length === 0) {
|
|
130
|
-
// Nothing to enqueue, just resolve
|
|
131
|
-
return [2 /*return*/];
|
|
132
|
-
}
|
|
133
|
-
eventTypes = Array.from(new Set(events.map(function (event) { return event.type; })));
|
|
134
|
-
return [4 /*yield*/, amqpConnection.queuePublisher.enqueueBatch(createEnqueueBatchChannel(amqpConnection, eventTypes), events, headers, function (event) { return (0, eventQueue_utils_1.getExchangeName)({ notification: false }, event.type); }, function (event) { return (0, eventQueue_utils_1.getBasicEventRoutingKey)(event.type); }, messageOptions, function (event) { return (0, exports.emitEventEnqueued)(event); }, batchSize)];
|
|
135
|
-
case 1:
|
|
136
|
-
_a.sent();
|
|
137
|
-
return [2 /*return*/];
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* @deprecated Use @signageos/user-domain-model/dist/Lib/CQRS/commandSynchronization instead
|
|
144
|
-
*/
|
|
145
|
-
function enqueueNotification(amqpConnection, event) {
|
|
146
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
147
|
-
return __generator(this, function (_a) {
|
|
148
|
-
switch (_a.label) {
|
|
149
|
-
case 0: return [4 /*yield*/, enqueueNotificationsBatch(amqpConnection, [event])];
|
|
150
|
-
case 1:
|
|
151
|
-
_a.sent();
|
|
152
|
-
return [2 /*return*/];
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
17
|
/**
|
|
158
|
-
* @deprecated Use
|
|
18
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
159
19
|
*/
|
|
160
|
-
|
|
161
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
-
var eventTypes;
|
|
163
|
-
return __generator(this, function (_a) {
|
|
164
|
-
switch (_a.label) {
|
|
165
|
-
case 0:
|
|
166
|
-
if (events.length === 0) {
|
|
167
|
-
// Nothing to enqueue, just resolve
|
|
168
|
-
return [2 /*return*/];
|
|
169
|
-
}
|
|
170
|
-
eventTypes = Array.from(new Set(events.map(function (event) { return event.type; })));
|
|
171
|
-
return [4 /*yield*/, amqpConnection.queuePublisher.enqueueBatch(createEnqueueBatchChannel(amqpConnection, eventTypes, { notification: true }), events, undefined, function (event) { return (0, eventQueue_utils_1.getExchangeName)({ notification: true }, event.type); }, function (event) { return (0, eventQueue_utils_1.getBasicEventRoutingKey)(event.type); }, { persistent: false }, function (event) { return (0, exports.emitEventEnqueued)(event); })];
|
|
172
|
-
case 1:
|
|
173
|
-
_a.sent();
|
|
174
|
-
return [2 /*return*/];
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
function enqueueToConsumer(amqpConnection_1, event_1, consumerType_1, eventTypeOrDomainName_1) {
|
|
180
|
-
return __awaiter(this, arguments, void 0, function (amqpConnection, event, consumerType, eventTypeOrDomainName, messageOptions) {
|
|
181
|
-
var queueName;
|
|
182
|
-
var _this = this;
|
|
183
|
-
if (messageOptions === void 0) { messageOptions = {}; }
|
|
184
|
-
return __generator(this, function (_a) {
|
|
185
|
-
switch (_a.label) {
|
|
186
|
-
case 0:
|
|
187
|
-
queueName = (0, eventQueue_utils_1.getQueueName)(consumerType, eventTypeOrDomainName !== null && eventTypeOrDomainName !== void 0 ? eventTypeOrDomainName : event.type);
|
|
188
|
-
return [4 /*yield*/, amqpConnection.queuePublisher.enqueue(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
189
|
-
var channel;
|
|
190
|
-
return __generator(this, function (_a) {
|
|
191
|
-
switch (_a.label) {
|
|
192
|
-
case 0: return [4 /*yield*/, amqpConnection.channelProvider.getChannel(event.type, eventQueue_utils_1.OPTIONS)];
|
|
193
|
-
case 1:
|
|
194
|
-
channel = _a.sent();
|
|
195
|
-
return [2 /*return*/, channel];
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}); }, event, undefined, '', // default will auto route to queue with same name as routing key
|
|
199
|
-
queueName, // routingKey equal to queueName (specific consumer only)
|
|
200
|
-
messageOptions)];
|
|
201
|
-
case 1:
|
|
202
|
-
_a.sent();
|
|
203
|
-
(0, exports.emitEventEnqueued)(event);
|
|
204
|
-
return [2 /*return*/];
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
}
|
|
20
|
+
__exportStar(require("@signageos/amqp/dist/EventSourcing/eventQueuePublish"), exports);
|
|
209
21
|
//# sourceMappingURL=eventQueuePublish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventQueuePublish.js","sourceRoot":"","sources":["../../../src/AMQP/EventSourcing/eventQueuePublish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eventQueuePublish.js","sourceRoot":"","sources":["../../../src/AMQP/EventSourcing/eventQueuePublish.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,uFAAqE"}
|
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
export interface ITimestamp {
|
|
2
|
-
/**
|
|
3
|
-
* The date represented as timestamp in milliseconds, when the command was processed and all emitted events was created.
|
|
4
|
-
* More events emitted by the same command will have the same receivedAt timestamp. To determine order of event, see secondaryIndex.
|
|
5
|
-
* It uses javascript date in ISO8601 format (with Z - zero hour offset always). The only important information is UNIX timestamp in ms.
|
|
6
|
-
* Timezone offset is overlooked every time because of bad design of JS Date object.
|
|
7
|
-
*/
|
|
8
|
-
receivedAt: Date;
|
|
9
|
-
/**
|
|
10
|
-
* This value differentiate more events created by same command (they have same receivedAt timestamp).
|
|
11
|
-
* Using this index, you can determine the right order of events in the event store.
|
|
12
|
-
* Index beginning from 0 and is increased by one for every following event.
|
|
13
|
-
*/
|
|
14
|
-
secondaryIndex: number;
|
|
15
|
-
}
|
|
16
1
|
/**
|
|
17
|
-
* @
|
|
2
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
18
3
|
*/
|
|
19
|
-
export
|
|
20
|
-
/**
|
|
21
|
-
* Last event created by successfully processed command.
|
|
22
|
-
* The key is the event type, the value is the timestamp and lock keys used for synchronization.
|
|
23
|
-
* The timestamp can be used to detect synchronization status of consumers.
|
|
24
|
-
* When event type is missing, it means that no event of that type was created by the command.
|
|
25
|
-
*/
|
|
26
|
-
[eventType: string]: {
|
|
27
|
-
/**
|
|
28
|
-
* Timestamp of the last event created by successfully processed command.
|
|
29
|
-
* This timestamp can be used to detect synchronization status of consumers.
|
|
30
|
-
*/
|
|
31
|
-
timestamp: ITimestamp;
|
|
32
|
-
/**
|
|
33
|
-
* List of lock keys which are used to lock the event store and event consumers
|
|
34
|
-
* for the command processing.
|
|
35
|
-
*/
|
|
36
|
-
lockKeys: string[];
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export declare function getAllLockKeys(lastEvents: LastSynchronizationEvents): string[];
|
|
4
|
+
export * from '@signageos/amqp/dist/EventSourcing/synchronization';
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var event_1 = lastEvents[eventType];
|
|
8
|
-
allLockKeys.push.apply(allLockKeys, event_1.lockKeys);
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
7
|
}
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("@signageos/amqp/dist/EventSourcing/synchronization"), exports);
|
|
12
21
|
//# sourceMappingURL=synchronization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronization.js","sourceRoot":"","sources":["../../../src/AMQP/EventSourcing/synchronization.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"synchronization.js","sourceRoot":"","sources":["../../../src/AMQP/EventSourcing/synchronization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qFAAmE"}
|
package/dist/AMQP/Exchange.d.ts
CHANGED
package/dist/AMQP/Exchange.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("@signageos/amqp/dist/Exchange"), exports);
|
|
3
21
|
//# sourceMappingURL=Exchange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exchange.js","sourceRoot":"","sources":["../../src/AMQP/Exchange.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Exchange.js","sourceRoot":"","sources":["../../src/AMQP/Exchange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,gEAA8C"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { AmqplibConsumeFields } from './IChannel';
|
|
2
|
-
import INackOptions from './INackOptions';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
* The message can be acknowledged (ack) or negatively acknowledged (nack) asynchronously.
|
|
6
|
-
* Unlike IGotMessage, the ack and nack methods return Promises that resolve when the operation is complete.
|
|
7
|
-
* The reason is that it can do some cleanup after ack/nack, like closing the channel if no more messages are pending.
|
|
2
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
8
3
|
*/
|
|
9
|
-
export
|
|
10
|
-
message: TMessage;
|
|
11
|
-
headers: object;
|
|
12
|
-
fields: AmqplibConsumeFields;
|
|
13
|
-
ack: () => Promise<void>;
|
|
14
|
-
nack: (nackOptions?: INackOptions) => Promise<void>;
|
|
15
|
-
}
|
|
4
|
+
export * from '@signageos/amqp/dist/IAsyncGotMessage';
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("@signageos/amqp/dist/IAsyncGotMessage"), exports);
|
|
3
21
|
//# sourceMappingURL=IAsyncGotMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAsyncGotMessage.js","sourceRoot":"","sources":["../../src/AMQP/IAsyncGotMessage.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"IAsyncGotMessage.js","sourceRoot":"","sources":["../../src/AMQP/IAsyncGotMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,wEAAsD"}
|
package/dist/AMQP/IChannel.d.ts
CHANGED
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type ICancelConsumption = () => Promise<void>;
|
|
7
|
-
export interface AmqplibConsumeFields {
|
|
8
|
-
redelivered?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface IBinding {
|
|
11
|
-
exchangeName: string;
|
|
12
|
-
/** persistent=false means that binding is removed when consumption is canceled */
|
|
13
|
-
persistent: boolean;
|
|
14
|
-
routingKey?: string;
|
|
15
|
-
routingHeaders?: {
|
|
16
|
-
'x-match': 'all' | 'any';
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export interface IGotMessage<TMessage> {
|
|
21
|
-
message: TMessage;
|
|
22
|
-
headers: object;
|
|
23
|
-
fields: AmqplibConsumeFields;
|
|
24
|
-
ack: () => void;
|
|
25
|
-
nack: (nackOptions?: INackOptions) => void;
|
|
26
|
-
}
|
|
27
|
-
export default IChannel;
|
|
28
|
-
interface IChannel<TMessage> {
|
|
29
|
-
assertExchange(exchangeName: string, type: ExchangeType, exchangeOptions?: AmqplibOptions.AssertExchange): Promise<void>;
|
|
30
|
-
send(message: TMessage, messageOptions: IMessageOptions, headers: object, exchangeName: string, routingKey: string): Promise<void>;
|
|
31
|
-
sendBatch(messages: TMessage[], messageOptions: IMessageOptions, headers: object, getExchangeName: (message: TMessage) => string, getRoutingKey: (message: TMessage) => string, onMessagePublished: (message: TMessage) => void, batchSize: number): Promise<void>;
|
|
32
|
-
sendExpectingResponse<TResponseMessage>(message: TMessage, messageOptions: IMessageOptions, headers: object, exchangeName: string, routingKey: string, responseTimeout?: number): Promise<TResponseMessage>;
|
|
33
|
-
assertRejectableQueue(queueName: string, consumeOptions?: IConsumeOptions): Promise<{
|
|
34
|
-
messageCount: number;
|
|
35
|
-
}>;
|
|
36
|
-
consumeSimple<TResponseMessage>(queueName: string, bindings: IBinding[], onMessage: (message: any, headers: object) => Promise<TResponseMessage>, consumeOptions?: IConsumeOptions, onEnded?: () => void): Promise<ICancelConsumption>;
|
|
37
|
-
consume<TResponseMessage>(queueName: string, bindings: IBinding[], onMessage: (message: any, headers: object, ack: () => void, nack: () => void, fields: AmqplibConsumeFields) => Promise<TResponseMessage>, consumeOptions?: IConsumeOptions, onEnded?: () => void): Promise<ICancelConsumption>;
|
|
38
|
-
unbind(queueName: string, binding: IBinding): Promise<void>;
|
|
39
|
-
get<TPayload>(queueName: string): Promise<IGotMessage<TPayload> | null>;
|
|
40
|
-
purge(queueName: string): Promise<void>;
|
|
41
|
-
delete(queueName: string): Promise<void>;
|
|
42
|
-
close(): Promise<void>;
|
|
43
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
3
|
+
*/
|
|
4
|
+
export * from '@signageos/amqp/dist/IChannel';
|
|
5
|
+
export { default } from '@signageos/amqp/dist/IChannel';
|
package/dist/AMQP/IChannel.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("@signageos/amqp/dist/IChannel"), exports);
|
|
3
21
|
//# sourceMappingURL=IChannel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IChannel.js","sourceRoot":"","sources":["../../src/AMQP/IChannel.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"IChannel.js","sourceRoot":"","sources":["../../src/AMQP/IChannel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,gEAA8C"}
|
|
@@ -1,106 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* This is proprietary option, not amqp or rabbit native
|
|
7
|
-
*/
|
|
8
|
-
autoDeleteDeadLetter: true;
|
|
9
|
-
/** Imply true because if consumption is not exclusive it cannot detect no consumer and auto rejecting messages */
|
|
10
|
-
exclusiveConsumption: true;
|
|
11
|
-
/**
|
|
12
|
-
* Cannot be autoDelete because is deleted by application after consumption is canceled after messages are dead-lettered
|
|
13
|
-
* But all bindings should be persistent=false to make it work properly
|
|
14
|
-
*/
|
|
15
|
-
autoDelete: false;
|
|
16
|
-
/** Cannot be exclusive because is deleted by application after consumption is canceled after messages are dead-lettered */
|
|
17
|
-
exclusive: false;
|
|
18
|
-
/** Has to have at least deadLetterExchange because otherwise, it can be used just standard amqp autoDelete */
|
|
19
|
-
deadLetterExchange: string;
|
|
20
|
-
deadLetterRoutingKey: string;
|
|
21
|
-
/**
|
|
22
|
-
* Has to be set to allow delete queue even when amqp connection is closed before application can dead-letter all messages.
|
|
23
|
-
* Messages have to have shorter expiration than queueExpiresMs to make it work properly
|
|
24
|
-
*/
|
|
25
|
-
queueExpiresMs: number;
|
|
26
|
-
};
|
|
27
|
-
type IBasicConsumeOptions = {
|
|
28
|
-
/** Auto delete queue when number of consumers decreased to zero */
|
|
29
|
-
autoDelete?: boolean;
|
|
30
|
-
/** Only one consumer can be for queue, after consumption canceled, queue is deleted */
|
|
31
|
-
exclusive?: boolean;
|
|
32
|
-
/** Queue is deleted when rabbitmq is restarted (keeps schema in memory only) */
|
|
33
|
-
durable?: boolean;
|
|
34
|
-
exclusiveConsumption?: boolean;
|
|
35
|
-
deadLetterExchange?: string;
|
|
36
|
-
deadLetterRoutingKey?: string;
|
|
37
|
-
/**
|
|
38
|
-
* When message was already nacked (requeue: true), then next consumption will be delayed by number of milliseconds
|
|
39
|
-
* @deprecated Use messageExpiresMs in dead-letter queue instead. This option is misused and should not exists.
|
|
40
|
-
*/
|
|
41
|
-
redeliverDelayMs?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Whether first simple consumption error should not be thrown (just nacked for next redeliver)
|
|
44
|
-
* @deprecated Use deadLetterIfErred instead. The suppressFirstError is misused and should not exists.
|
|
45
|
-
*/
|
|
46
|
-
suppressFirstError?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* If flag is set, the message will be rejected with requeue=false in case
|
|
49
|
-
* the message was redelivered already and now the error was thrown
|
|
50
|
-
* @deprecated Use deadLetterIfErred instead. The suppressFirstError is misused and should not exists.
|
|
51
|
-
*/
|
|
52
|
-
deadLetterIfRedeliveredAndErred?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* It will immediately dead-letter the message if the error is thrown during the consumption
|
|
55
|
-
* Unlike deadLetterIfRedeliveredAndErred, it does not care about redelivered flag and dead-letters immediately
|
|
56
|
-
*/
|
|
57
|
-
deadLetterIfErred?: boolean;
|
|
58
|
-
/** If respond is set, the consumption will reply response message if replyTo parameter is set in coming message. Default false */
|
|
59
|
-
respond?: boolean;
|
|
60
|
-
/** Define how long the queue will exists without consumer until is automatically deleted (RabbitMQ feature only) */
|
|
61
|
-
queueExpiresMs?: number;
|
|
62
|
-
/**
|
|
63
|
-
* Define how long can be the messages in the queue until they are automatically rejected (dead-lettered).
|
|
64
|
-
* Internally used header 'x-message-ttl'.
|
|
65
|
-
* It can be set also as 'expiration' attribute of every message. See IMessageOptions.
|
|
66
|
-
*/
|
|
67
|
-
messageExpiresMs?: number;
|
|
68
|
-
/**
|
|
69
|
-
* Defines if a queue is allowed to be consumed by only one single consumer at the same time (RabbitMQ 3.8+ feature only)
|
|
70
|
-
* https://www.rabbitmq.com/consumers.html#single-active-consumer
|
|
71
|
-
*/
|
|
72
|
-
singleActiveConsumer?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Detect whether the queue is the quorum type or classic.
|
|
75
|
-
* Quorum is better option for consistency of message of durable queue.
|
|
76
|
-
* Default is classic.
|
|
77
|
-
*/
|
|
78
|
-
queueType?: QueueType;
|
|
79
|
-
/**
|
|
80
|
-
* When is true, all messages are acknowledged immediately after client populate them.
|
|
81
|
-
* There is not need to call ack() method on message.
|
|
82
|
-
*/
|
|
83
|
-
noAck?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Limit the number of messages in the queue.
|
|
86
|
-
* When the limit is reached, the oldest messages are handled by the overflow policy.
|
|
87
|
-
* If overflow is not set, the default policy is to drop the oldest messages.
|
|
88
|
-
*/
|
|
89
|
-
maxLength?: number;
|
|
90
|
-
/**
|
|
91
|
-
* Internally used header 'x-overflow'.
|
|
92
|
-
* Sets the strategy for handling messages when the queue reaches its maximum length @see `maxLength`.
|
|
93
|
-
* The default policy is to drop the oldest messages.
|
|
94
|
-
* The other options are:
|
|
95
|
-
* - `reject-publish`: Reject the message and do not publish it to the queue.
|
|
96
|
-
* - `reject-publish-dlx`: Reject the message and publish it to the dead-letter exchange.
|
|
97
|
-
* - `drop-head`: Drop the oldest message in the queue.
|
|
98
|
-
*/
|
|
99
|
-
overflow?: 'reject-publish' | 'reject-publish-dlx' | 'drop-head';
|
|
100
|
-
};
|
|
101
|
-
type IQuorumOptions = IBasicConsumeOptions & {
|
|
102
|
-
durable: true;
|
|
103
|
-
queueType: 'quorum';
|
|
104
|
-
};
|
|
105
|
-
type IConsumeOptions = IBasicConsumeOptions | IQuorumOptions | (IBasicConsumeOptions & IAutoDeleteDeadLetterOptions) | (IQuorumOptions & IAutoDeleteDeadLetterOptions);
|
|
106
|
-
export default IConsumeOptions;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
3
|
+
*/
|
|
4
|
+
export * from '@signageos/amqp/dist/IConsumeOptions';
|
|
5
|
+
export { default } from '@signageos/amqp/dist/IConsumeOptions';
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `@signageos/amqp` instead.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("@signageos/amqp/dist/IConsumeOptions"), exports);
|
|
3
21
|
//# sourceMappingURL=IConsumeOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IConsumeOptions.js","sourceRoot":"","sources":["../../src/AMQP/IConsumeOptions.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"IConsumeOptions.js","sourceRoot":"","sources":["../../src/AMQP/IConsumeOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,uEAAqD"}
|