@healthzkit/rabbitmq 0.0.2 → 0.0.4
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/amqp-connection-manager.d.mts +1 -1
- package/dist/amqp-connection-manager.mjs +1 -1
- package/dist/amqplib.d.mts +1 -1
- package/dist/amqplib.mjs +1 -1
- package/dist/shared-BiUsKU63.mjs +1 -0
- package/dist/{shared-CBgGC1WB.d.mts → shared-CtilZ8c_.d.mts} +1 -2
- package/package.json +8 -5
- package/dist/shared-B-1hAtzF.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HealthAdapter, t as BaseRabbitOptions } from "./shared-
|
|
1
|
+
import { n as HealthAdapter, t as BaseRabbitOptions } from "./shared-CtilZ8c_.mjs";
|
|
2
2
|
import { AmqpConnectionManager, AmqpConnectionManagerOptions } from "amqp-connection-manager";
|
|
3
3
|
|
|
4
4
|
//#region src/amqp-connection-manager.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./shared-
|
|
1
|
+
import{n as e,t}from"./shared-BiUsKU63.mjs";function n(n){let r=null,i=null;async function a(){return`connection`in n&&n.connection?n.connection:r||i||(i=(async()=>{let{connect:e}=await import(`amqp-connection-manager`),t=e(n.urls,n.connectionOptions);return r=t,i=null,t})(),i)}return{async check(){try{let t=await a(),r=Date.now();if(!t.isConnected())throw Error(`rabbitmq adapter: connection manager has no active connections.`);let i=Date.now()-r,o=n.metadata?n.metadata(t):void 0;return e(i,o instanceof Promise?await o:o)}catch(e){return t(e)}}}}export{n as amqpConnectionManagerAdapter};
|
package/dist/amqplib.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HealthAdapter, t as BaseRabbitOptions } from "./shared-
|
|
1
|
+
import { n as HealthAdapter, t as BaseRabbitOptions } from "./shared-CtilZ8c_.mjs";
|
|
2
2
|
import { ChannelModel, Options, RecoveringChannelModel, SocketOptions } from "amqplib";
|
|
3
3
|
|
|
4
4
|
//#region src/amqplib.d.ts
|
package/dist/amqplib.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./shared-
|
|
1
|
+
import{n as e,t}from"./shared-BiUsKU63.mjs";function n(n){let r=null,i=null;async function a(){return`connection`in n&&n.connection?n.connection:r||i||(i=(async()=>{try{let{default:e}=await import(`amqplib`),t=await e.connect(n.url,n.socketOptions);return r=t,t}finally{i=null}})(),i)}return{async check(){try{let t=await a(),r=Date.now();await(await t.createChannel()).close();let i=Date.now()-r,o=n.metadata?n.metadata(t):void 0;return e(i,o instanceof Promise?await o:o)}catch(e){return t(e)}}}}export{n as amqplibAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildErrorResult as e,buildResult as t}from"@healthzkit/shared";export{t as n,e as t};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { HealthAdapter } from "healthzkit";
|
|
1
|
+
import { HealthAdapter, MetadataFn } from "@healthzkit/shared";
|
|
2
2
|
|
|
3
3
|
//#region src/shared.d.ts
|
|
4
|
-
type MetadataFn<TClient> = (client: TClient) => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
5
4
|
interface BaseRabbitOptions<TClient> {
|
|
6
5
|
/**
|
|
7
6
|
* Optional function to populate metadata in the check result.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@healthzkit/rabbitmq",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,16 +20,19 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@healthzkit/shared": "0.0.0"
|
|
25
|
+
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@types/amqplib": "^0.10.8",
|
|
25
|
-
"@types/node": "^
|
|
28
|
+
"@types/node": "^24",
|
|
26
29
|
"@typescript/native-preview": "7.0.0-dev.20260509.2",
|
|
27
30
|
"amqp-connection-manager": "^5.0.0",
|
|
28
31
|
"amqplib": "^2.0.1",
|
|
29
32
|
"bumpp": "^11.1.0",
|
|
30
|
-
"typescript": "^
|
|
31
|
-
"vite-plus": "
|
|
32
|
-
"healthzkit": "0.0.
|
|
33
|
+
"typescript": "^5",
|
|
34
|
+
"vite-plus": "latest",
|
|
35
|
+
"healthzkit": "0.0.3"
|
|
33
36
|
},
|
|
34
37
|
"peerDependencies": {
|
|
35
38
|
"amqp-connection-manager": ">=4.0.0 || >=5.0.0",
|
package/dist/shared-B-1hAtzF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){return{status:`ok`,metadata:{...t,latencyMs:e}}}function t(e){return{status:`fail`,error:e instanceof Error?e:Error(String(e))}}export{e as n,t};
|