@healthzkit/rabbitmq 0.0.3 → 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.
@@ -1,4 +1,4 @@
1
- import { n as HealthAdapter, t as BaseRabbitOptions } from "./shared-CFs71YeN.mjs";
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"./dist-iC8gGE1z.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 e=await a(),r=Date.now();if(!e.isConnected())throw Error(`rabbitmq adapter: connection manager has no active connections.`);let i=Date.now()-r,o=n.metadata?n.metadata(e):void 0;return t(i,o instanceof Promise?await o:o)}catch(t){return e(t)}}}}export{n as amqpConnectionManagerAdapter};
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};
@@ -1,4 +1,4 @@
1
- import { n as HealthAdapter, t as BaseRabbitOptions } from "./shared-CFs71YeN.mjs";
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"./dist-iC8gGE1z.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 e=await a(),r=Date.now();await(await e.createChannel()).close();let i=Date.now()-r,o=n.metadata?n.metadata(e):void 0;return t(i,o instanceof Promise?await o:o)}catch(t){return e(t)}}}}export{n as amqplibAdapter};
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};
@@ -0,0 +1,12 @@
1
+ import { HealthAdapter, MetadataFn } from "@healthzkit/shared";
2
+
3
+ //#region src/shared.d.ts
4
+ interface BaseRabbitOptions<TClient> {
5
+ /**
6
+ * Optional function to populate metadata in the check result.
7
+ * Receives the resolved client so you can run additional operations.
8
+ */
9
+ metadata?: MetadataFn<TClient>;
10
+ }
11
+ //#endregion
12
+ export { HealthAdapter as n, BaseRabbitOptions as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthzkit/rabbitmq",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "AGPL-3.0-only",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,6 +20,9 @@
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
28
  "@types/node": "^24",
@@ -29,7 +32,6 @@
29
32
  "bumpp": "^11.1.0",
30
33
  "typescript": "^5",
31
34
  "vite-plus": "latest",
32
- "@healthzkit/shared": "0.0.0",
33
35
  "healthzkit": "0.0.3"
34
36
  },
35
37
  "peerDependencies": {
@@ -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{t as n,e as t};
@@ -1,16 +0,0 @@
1
- import { HealthAdapter } from "healthzkit";
2
-
3
- //#region ../../tools/shared/dist/index.d.mts
4
- //#region src/index.d.ts
5
- type MetadataFn<TClient> = (client: TClient) => Promise<Record<string, unknown>> | Record<string, unknown>;
6
- //#endregion
7
- //#region src/shared.d.ts
8
- interface BaseRabbitOptions<TClient> {
9
- /**
10
- * Optional function to populate metadata in the check result.
11
- * Receives the resolved client so you can run additional operations.
12
- */
13
- metadata?: MetadataFn<TClient>;
14
- }
15
- //#endregion
16
- export { HealthAdapter as n, BaseRabbitOptions as t };