@message-queue-toolkit/core 7.0.0 → 8.0.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.
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { QueueConsumer, AsyncPublisher, SyncPublisher, TransactionObservabi
|
|
|
2
2
|
export { AbstractQueueService } from './lib/queues/AbstractQueueService';
|
|
3
3
|
export type { NewQueueOptions, ExistingQueueOptions, NewQueueOptionsMultiSchema, ExistingQueueOptionsMultiSchema, MonoSchemaQueueOptions, MultiSchemaConsumerOptions, QueueDependencies, QueueConsumerDependencies, Deserializer, CommonQueueLocator, DeletionConfig, MultiSchemaPublisherOptions, } from './lib/queues/AbstractQueueService';
|
|
4
4
|
export { isMessageError, MessageValidationError, MessageInvalidFormatError, } from './lib/errors/Errors';
|
|
5
|
-
export {
|
|
5
|
+
export { isShallowSubset, objectMatches } from './lib/utils/matchUtils';
|
|
6
6
|
export { HandlerContainer, MessageHandlerConfig, MessageHandlerConfigBuilder, BarrierCallbackMultiConsumers, BarrierResult, BarrierResultPositive, BarrierResultNegative, } from './lib/queues/HandlerContainer';
|
|
7
7
|
export type { HandlerContainerOptions, Handler } from './lib/queues/HandlerContainer';
|
|
8
8
|
export { HandlerSpy } from './lib/queues/HandlerSpy';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isProduction = exports.reloadConfig = exports.parseMessage = exports.waitAndRetry = exports.objectToBuffer = exports.MessageSchemaContainer = exports.HandlerSpy = exports.MessageHandlerConfigBuilder = exports.MessageHandlerConfig = exports.HandlerContainer = exports.
|
|
3
|
+
exports.isProduction = exports.reloadConfig = exports.parseMessage = exports.waitAndRetry = exports.objectToBuffer = exports.MessageSchemaContainer = exports.HandlerSpy = exports.MessageHandlerConfigBuilder = exports.MessageHandlerConfig = exports.HandlerContainer = exports.objectMatches = exports.isShallowSubset = exports.MessageInvalidFormatError = exports.MessageValidationError = exports.isMessageError = exports.AbstractQueueService = void 0;
|
|
4
4
|
var AbstractQueueService_1 = require("./lib/queues/AbstractQueueService");
|
|
5
5
|
Object.defineProperty(exports, "AbstractQueueService", { enumerable: true, get: function () { return AbstractQueueService_1.AbstractQueueService; } });
|
|
6
6
|
var Errors_1 = require("./lib/errors/Errors");
|
|
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "isMessageError", { enumerable: true, get: functi
|
|
|
8
8
|
Object.defineProperty(exports, "MessageValidationError", { enumerable: true, get: function () { return Errors_1.MessageValidationError; } });
|
|
9
9
|
Object.defineProperty(exports, "MessageInvalidFormatError", { enumerable: true, get: function () { return Errors_1.MessageInvalidFormatError; } });
|
|
10
10
|
var matchUtils_1 = require("./lib/utils/matchUtils");
|
|
11
|
-
Object.defineProperty(exports, "
|
|
11
|
+
Object.defineProperty(exports, "isShallowSubset", { enumerable: true, get: function () { return matchUtils_1.isShallowSubset; } });
|
|
12
|
+
Object.defineProperty(exports, "objectMatches", { enumerable: true, get: function () { return matchUtils_1.objectMatches; } });
|
|
12
13
|
var HandlerContainer_1 = require("./lib/queues/HandlerContainer");
|
|
13
14
|
Object.defineProperty(exports, "HandlerContainer", { enumerable: true, get: function () { return HandlerContainer_1.HandlerContainer; } });
|
|
14
15
|
Object.defineProperty(exports, "MessageHandlerConfig", { enumerable: true, get: function () { return HandlerContainer_1.MessageHandlerConfig; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAWA,0EAAwE;AAA/D,4HAAA,oBAAoB,OAAA;AAgB7B,8CAI4B;AAH1B,wGAAA,cAAc,OAAA;AACd,gHAAA,sBAAsB,OAAA;AACtB,mHAAA,yBAAyB,OAAA;AAG3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAWA,0EAAwE;AAA/D,4HAAA,oBAAoB,OAAA;AAgB7B,8CAI4B;AAH1B,wGAAA,cAAc,OAAA;AACd,gHAAA,sBAAsB,OAAA;AACtB,mHAAA,yBAAyB,OAAA;AAG3B,qDAAuE;AAA9D,6GAAA,eAAe,OAAA;AAAE,2GAAA,aAAa,OAAA;AAEvC,kEAQsC;AAPpC,oHAAA,gBAAgB,OAAA;AAChB,wHAAA,oBAAoB,OAAA;AACpB,+HAAA,2BAA2B,OAAA;AAO7B,sDAAoD;AAA3C,wGAAA,UAAU,OAAA;AAGnB,8EAA4E;AAAnE,gIAAA,sBAAsB,OAAA;AAG/B,qDAAuD;AAA9C,4GAAA,cAAc,OAAA;AACvB,mDAAoD;AAA3C,yGAAA,YAAY,OAAA;AACrB,qDAAqD;AAA5C,0GAAA,YAAY,OAAA;AAErB,iDAAiE;AAAxD,wGAAA,YAAY,OAAA;AAAE,wGAAA,YAAY,OAAA"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if `maybeSubset` does not contain any fields in addition to the fields that `maybeSuperset` contain, and all of the overlapping fields are equal on a shallow level.
|
|
3
|
+
*/
|
|
4
|
+
export declare function isShallowSubset(maybeSubset?: Record<string, unknown>, maybeSuperset?: Record<string, unknown>): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Returns true if `validatedObject` contains all of the fields included on `matcher`, and their values are deeply equal
|
|
7
|
+
*/
|
|
2
8
|
export declare function objectMatches(matcher: Record<string, any>, validatedObject: Record<string, any>): boolean;
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectMatches = exports.
|
|
3
|
+
exports.objectMatches = exports.isShallowSubset = void 0;
|
|
4
4
|
const fast_equals_1 = require("fast-equals");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (!
|
|
5
|
+
/**
|
|
6
|
+
* Returns true if `maybeSubset` does not contain any fields in addition to the fields that `maybeSuperset` contain, and all of the overlapping fields are equal on a shallow level.
|
|
7
|
+
*/
|
|
8
|
+
function isShallowSubset(maybeSubset, maybeSuperset) {
|
|
9
|
+
if (!maybeSubset) {
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
|
+
const keysSubset = Object.keys(maybeSubset);
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const keysSuperset = Object.keys(maybeSuperset);
|
|
15
|
+
if (keysSubset.length === 0) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (keysSubset.length > keysSuperset.length) {
|
|
17
19
|
return false;
|
|
18
20
|
}
|
|
19
21
|
// eslint-disable-next-line prefer-const
|
|
20
|
-
for (let key of
|
|
22
|
+
for (let key of keysSubset) {
|
|
21
23
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22
|
-
if (
|
|
24
|
+
if (maybeSubset[key] !== maybeSuperset[key]) {
|
|
23
25
|
return false;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
return true;
|
|
27
29
|
}
|
|
28
|
-
exports.
|
|
30
|
+
exports.isShallowSubset = isShallowSubset;
|
|
31
|
+
/**
|
|
32
|
+
* Returns true if `validatedObject` contains all of the fields included on `matcher`, and their values are deeply equal
|
|
33
|
+
*/
|
|
29
34
|
function objectMatches(
|
|
30
35
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
36
|
matcher,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchUtils.js","sourceRoot":"","sources":["../../../lib/utils/matchUtils.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,SAAgB,
|
|
1
|
+
{"version":3,"file":"matchUtils.js","sourceRoot":"","sources":["../../../lib/utils/matchUtils.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AAI,EAAE,CAAC;YAC9D,IAAI,OAAO,eAAe,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC9E,OAAO,KAAK,CAAA;YACd,CAAC;YAED,iEAAiE;YACjE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBACvD,OAAO,KAAK,CAAA;YACd,CAAC;YACD,iEAAiE;QACnE,CAAC;aAAM,IAAI,CAAC,IAAA,uBAAS,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC1D,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AA5BD,sCA4BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@message-queue-toolkit/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Useful utilities, interfaces and base classes for message queue handling. Supports AMQP and SQS with a common abstraction on top currently",
|