@message-queue-toolkit/core 1.1.0 → 1.2.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { QueueConsumer, AsyncPublisher, SyncPublisher, TransactionObservabilityManager, Logger, } from './lib/types/MessageQueueTypes';
|
|
2
2
|
export { AbstractQueueService } from './lib/queues/AbstractQueueService';
|
|
3
|
-
export type { QueueOptions, QueueDependencies, QueueConsumerDependencies, Deserializer, } from './lib/queues/AbstractQueueService';
|
|
3
|
+
export type { QueueOptions, QueueDependencies, QueueConsumerDependencies, Deserializer, CommonQueueLocator, } from './lib/queues/AbstractQueueService';
|
|
4
4
|
export { isMessageError, MessageValidationError, MessageInvalidFormatError, } from './lib/errors/Errors';
|
|
5
5
|
export { objectToBuffer } from './lib/utils/queueUtils';
|
|
6
6
|
export { waitAndRetry } from './lib/utils/waitUtils';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAQA,0EAAwE;AAA/D,4HAAA,oBAAoB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAQA,0EAAwE;AAA/D,4HAAA,oBAAoB,OAAA;AAS7B,8CAI4B;AAH1B,wGAAA,cAAc,OAAA;AACd,gHAAA,sBAAsB,OAAA;AACtB,mHAAA,yBAAyB,OAAA;AAG3B,qDAAuD;AAA9C,4GAAA,cAAc,OAAA;AACvB,mDAAoD;AAA3C,yGAAA,YAAY,OAAA"}
|
|
@@ -11,20 +11,25 @@ export type QueueConsumerDependencies = {
|
|
|
11
11
|
transactionObservabilityManager: TransactionObservabilityManager;
|
|
12
12
|
};
|
|
13
13
|
export type Deserializer<MessagePayloadType extends object, QueueEngineMessageType extends object> = (message: QueueEngineMessageType, type: ZodType<MessagePayloadType>, errorProcessor: ErrorResolver) => Either<MessageInvalidFormatError | MessageValidationError, MessagePayloadType>;
|
|
14
|
-
export type QueueOptions<MessagePayloadType extends object, QueueConfiguration extends object> = {
|
|
14
|
+
export type QueueOptions<MessagePayloadType extends object, QueueConfiguration extends object, QueueLocatorType extends object> = {
|
|
15
15
|
messageSchema: ZodSchema<MessagePayloadType>;
|
|
16
16
|
messageTypeField: string;
|
|
17
17
|
queueName: string;
|
|
18
|
-
|
|
18
|
+
queueLocator?: QueueLocatorType;
|
|
19
|
+
queueConfiguration?: QueueConfiguration;
|
|
19
20
|
};
|
|
20
|
-
export
|
|
21
|
+
export type CommonQueueLocator = {
|
|
22
|
+
queueName: string;
|
|
23
|
+
};
|
|
24
|
+
export declare abstract class AbstractQueueService<MessagePayloadType extends object, DependenciesType extends QueueDependencies, QueueConfiguration extends object, QueueLocatorType extends object = CommonQueueLocator, OptionsType extends QueueOptions<MessagePayloadType, QueueConfiguration, QueueLocatorType> = QueueOptions<MessagePayloadType, QueueConfiguration, QueueLocatorType>> {
|
|
21
25
|
protected readonly queueName: string;
|
|
22
26
|
protected readonly errorReporter: ErrorReporter;
|
|
23
27
|
protected readonly messageSchema: ZodSchema<MessagePayloadType>;
|
|
24
28
|
protected readonly logger: Logger;
|
|
25
29
|
protected readonly messageTypeField: string;
|
|
26
|
-
protected readonly queueConfiguration
|
|
27
|
-
|
|
30
|
+
protected readonly queueConfiguration?: QueueConfiguration;
|
|
31
|
+
protected readonly queueLocator?: QueueLocatorType;
|
|
32
|
+
constructor({ errorReporter, logger }: DependenciesType, { messageSchema, messageTypeField, queueName, queueConfiguration, queueLocator }: OptionsType);
|
|
28
33
|
protected handleError(err: unknown): void;
|
|
29
34
|
abstract close(): Promise<unknown>;
|
|
30
35
|
}
|
|
@@ -10,13 +10,15 @@ class AbstractQueueService {
|
|
|
10
10
|
logger;
|
|
11
11
|
messageTypeField;
|
|
12
12
|
queueConfiguration;
|
|
13
|
-
|
|
13
|
+
queueLocator;
|
|
14
|
+
constructor({ errorReporter, logger }, { messageSchema, messageTypeField, queueName, queueConfiguration, queueLocator }) {
|
|
14
15
|
this.errorReporter = errorReporter;
|
|
15
16
|
this.logger = logger;
|
|
16
17
|
this.queueName = queueName;
|
|
17
18
|
this.messageSchema = messageSchema;
|
|
18
19
|
this.messageTypeField = messageTypeField;
|
|
19
20
|
this.queueConfiguration = queueConfiguration;
|
|
21
|
+
this.queueLocator = queueLocator;
|
|
20
22
|
}
|
|
21
23
|
handleError(err) {
|
|
22
24
|
const logObject = (0, node_core_1.resolveGlobalErrorLogObject)(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractQueueService.js","sourceRoot":"","sources":["../../../lib/queues/AbstractQueueService.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AAGjC,mDAAiE;
|
|
1
|
+
{"version":3,"file":"AbstractQueueService.js","sourceRoot":"","sources":["../../../lib/queues/AbstractQueueService.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AAGjC,mDAAiE;AAyCjE,MAAsB,oBAAoB;IAWrB,SAAS,CAAQ;IACjB,aAAa,CAAe;IAC5B,aAAa,CAA+B;IAC5C,MAAM,CAAQ;IACd,gBAAgB,CAAQ;IACxB,kBAAkB,CAAqB;IACvC,YAAY,CAAmB;IAElD,YACE,EAAE,aAAa,EAAE,MAAM,EAAoB,EAC3C,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,EAAE,YAAY,EAAe;QAE7F,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QAEpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACxC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAES,WAAW,CAAC,GAAY;QAChC,MAAM,SAAS,GAAG,IAAA,uCAA2B,EAAC,GAAG,CAAC,CAAA;QAClD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC5B,IAAI,iBAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;SAC1C;IACH,CAAC;CAGF;AA1CD,oDA0CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@message-queue-toolkit/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "^20.
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
31
|
-
"@typescript-eslint/parser": "^5.
|
|
29
|
+
"@types/node": "^20.4.1",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
31
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
32
32
|
"del-cli": "^5.0.0",
|
|
33
|
-
"eslint": "^8.
|
|
33
|
+
"eslint": "^8.44.0",
|
|
34
34
|
"eslint-config-prettier": "^8.8.0",
|
|
35
35
|
"eslint-plugin-import": "^2.27.5",
|
|
36
36
|
"eslint-plugin-prettier": "^4.2.1",
|
|
37
37
|
"prettier": "^2.8.8",
|
|
38
|
-
"typescript": "^5.1.
|
|
38
|
+
"typescript": "^5.1.6"
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/kibertoad/message-queue-toolkit",
|
|
41
41
|
"repository": {
|