@axah/mq
Advanced tools
Comparing version
import type { VhostConfig } from 'rascal'; | ||
export declare const vhost = "rabbit"; | ||
export declare type DefaultVostConfig = { | ||
export type DefaultVostConfig = { | ||
queueName: string; | ||
@@ -15,3 +15,3 @@ options: { | ||
}; | ||
export declare type VhostConfigs = { | ||
export type VhostConfigs = { | ||
[key: string]: VhostConfig | DefaultVostConfig; | ||
@@ -18,0 +18,0 @@ }; |
@@ -5,3 +5,3 @@ export { initBroker } from './broker'; | ||
export declare const mq: { | ||
initBroker: (vhostConfig: import("./config").VhostConfigs, log: import("pino").default.Logger<import("pino").default.LoggerOptions>) => Promise<void>; | ||
initBroker: (vhostConfig: import("./config").VhostConfigs, log: import("pino").default.Logger) => Promise<void>; | ||
publish: <T>(publication: import("./publication").Publication<T>) => Promise<{ | ||
@@ -13,3 +13,3 @@ messageId: string; | ||
vHostConfig: import("rascal").VhostConfig | import("./config").DefaultVostConfig; | ||
log: import("pino").Logger<import("pino").LoggerOptions>; | ||
log: import("pino").Logger; | ||
initialPollingDelay?: number | undefined; | ||
@@ -16,0 +16,0 @@ pollingDelay?: number | undefined; |
@@ -5,3 +5,3 @@ import type { z } from 'zod'; | ||
import type { DefaultVostConfig } from './config'; | ||
export declare type Publication<T> = PublicationConfig & { | ||
export type Publication<T> = PublicationConfig & { | ||
vHostConfig: VhostConfig | DefaultVostConfig; | ||
@@ -12,3 +12,3 @@ contentValidator: z.ZodType<T>; | ||
}; | ||
declare type PublishResult = { | ||
type PublishResult = { | ||
messageId: string; | ||
@@ -15,0 +15,0 @@ }; |
@@ -6,3 +6,3 @@ import type { Logger } from 'pino'; | ||
import type { DefaultVostConfig } from './config'; | ||
export declare type Message<T> = { | ||
export type Message<T> = { | ||
content: T; | ||
@@ -12,4 +12,4 @@ fields: MessageFields; | ||
}; | ||
export declare type MessageHandler<T> = (message: Message<T>) => Promise<void>; | ||
export declare type Subscription<T> = SubscriptionConfig & { | ||
export type MessageHandler<T> = (message: Message<T>) => Promise<void>; | ||
export type Subscription<T> = SubscriptionConfig & { | ||
vHostConfig: VhostConfig | DefaultVostConfig; | ||
@@ -16,0 +16,0 @@ contentValidator: z.ZodType<T>; |
@@ -65,3 +65,3 @@ "use strict"; | ||
const error = (0, js_utils_1.throwableToError)(e); | ||
log.error({ error, content }, `Error while reading message from ${subscriptionName}. Error "${error.message}" occurred while processing message. Will nack message and send to dead letter queue`); | ||
log.error({ err: error, content }, `Error while reading message from ${subscriptionName}. Error "${error.message}" occurred while processing message. Will nack message and send to dead letter queue`); | ||
ackOrNack(error, { strategy: 'nack' }); | ||
@@ -68,0 +68,0 @@ } |
{ | ||
"name": "@axah/mq", | ||
"version": "0.0.0-20230301092043", | ||
"version": "0.0.0-20230412160442", | ||
"description": "", | ||
@@ -16,3 +16,3 @@ "main": "lib/index.js", | ||
"@types/async-retry": "^1.4.5", | ||
"amqplib": "^0.10.2", | ||
"amqplib": "^0.10.3", | ||
"async-retry": "^1.3.3", | ||
@@ -24,23 +24,23 @@ "cross-fetch": "^3.1.5", | ||
"uuid": "^9.0.0", | ||
"zod": "^3.20.6" | ||
"zod": "^3.21.4" | ||
}, | ||
"devDependencies": { | ||
"@axah/eslint-config": "^1.2.2", | ||
"@axah/tsconfig": "^1.0.3", | ||
"@changesets/cli": "^2.25.0", | ||
"@axah/eslint-config": "^2.0.0", | ||
"@axah/tsconfig": "^1.1.0", | ||
"@changesets/cli": "^2.26.1", | ||
"@types/amqplib": "^0.10.1", | ||
"@types/jest": "^29.2.0", | ||
"@types/jest": "^29.5.0", | ||
"@types/lodash.merge": "^4.6.7", | ||
"@types/lodash.mergewith": "^4.6.7", | ||
"@types/node": "^18.11.7", | ||
"@types/node": "^18.15.11", | ||
"@types/rascal": "^10.0.6", | ||
"@types/uuid": "^9.0.0", | ||
"eslint": "^8.26.0", | ||
"jest": "^29.2.2", | ||
"pino": "^8.8.0", | ||
"prettier": "^2.8.4", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^29.0.3", | ||
"@types/uuid": "^9.0.1", | ||
"eslint": "^8.37.0", | ||
"jest": "^29.5.0", | ||
"pino": "^8.11.0", | ||
"prettier": "^2.8.7", | ||
"rimraf": "^4.4.1", | ||
"ts-jest": "^29.1.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.4" | ||
"typescript": "^5.0.3" | ||
}, | ||
@@ -47,0 +47,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
41221
-0.26%Updated
Updated