@postgresx/bun-listen 0.3.1 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +9 -10
  2. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -13,8 +13,8 @@ interface ResolvedTlsOptions {
13
13
  tls: PgTlsOptions;
14
14
  allowPlainFallback: boolean;
15
15
  }
16
- type NotifyHandler = (channel: string, payload: string) => void;
17
- interface PgListenerHealth {
16
+ export type NotifyHandler = (channel: string, payload: string) => void;
17
+ export interface PgListenerHealth {
18
18
  status: "connecting" | "connected" | "reconnecting" | "closed" | "error";
19
19
  connected: boolean;
20
20
  listeningChannels: string[];
@@ -26,7 +26,7 @@ interface PgListenerHealth {
26
26
  lastNotificationAt: number | null;
27
27
  lastError: string | null;
28
28
  }
29
- interface PgListenerEvents {
29
+ export interface PgListenerEvents {
30
30
  connected: PgListenerHealth;
31
31
  close: {
32
32
  willReconnect: boolean;
@@ -43,7 +43,7 @@ interface PgListenerEvents {
43
43
  delayMs: number;
44
44
  };
45
45
  }
46
- interface PgListenerOptions {
46
+ export interface PgListenerOptions {
47
47
  channels?: string[];
48
48
  onNotify?: NotifyHandler;
49
49
  tls?: PgTlsOptions;
@@ -53,7 +53,7 @@ interface PgListenerOptions {
53
53
  healthCheckIntervalMs?: number;
54
54
  logger?: PgLogger | false;
55
55
  }
56
- interface PgListenerHandle {
56
+ export interface PgListenerHandle {
57
57
  close(): void;
58
58
  notify(channel: string, payload?: string): Promise<void>;
59
59
  getHealth(): PgListenerHealth;
@@ -66,9 +66,9 @@ declare function quoteIdentifier(identifier: string): string;
66
66
  declare function quoteLiteral(value: string): string;
67
67
  declare function buildListenQuery(channels: string[]): string;
68
68
  declare function buildNotifyQuery(channel: string, payload?: string): string;
69
- declare function createPgListener(databaseUrl: string, channels: string[], onNotify: NotifyHandler, options?: PgListenerOptions): PgListenerHandle;
70
- declare function createPgListener(databaseUrl: string, options?: PgListenerOptions): PgListenerHandle;
71
- declare const __pgListenInternals: {
69
+ export declare function createPgListener(databaseUrl: string, channels: string[], onNotify: NotifyHandler, options?: PgListenerOptions): PgListenerHandle;
70
+ export declare function createPgListener(databaseUrl: string, options?: PgListenerOptions): PgListenerHandle;
71
+ export declare const __pgListenInternals: {
72
72
  buildListenQuery: typeof buildListenQuery;
73
73
  buildNotifyQuery: typeof buildNotifyQuery;
74
74
  quoteIdentifier: typeof quoteIdentifier;
@@ -76,5 +76,4 @@ declare const __pgListenInternals: {
76
76
  parseDSN: typeof parseDSN;
77
77
  resolveTlsOptions: typeof resolveTlsOptions;
78
78
  };
79
-
80
- export { type NotifyHandler, type PgListenerEvents, type PgListenerHandle, type PgListenerHealth, type PgListenerOptions, __pgListenInternals, createPgListener };
79
+ export {};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@postgresx/bun-listen",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Bun-native PostgreSQL LISTEN/NOTIFY client for pgredis and standalone realtime use cases",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/zuohuadong/postgresx",
9
+ "url": "https://github.com/vibeunion/postgresx",
10
10
  "directory": "packages/bun-listen"
11
11
  },
12
12
  "sideEffects": false,
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "scripts": {
27
- "build": "tsup src/index.ts --format esm --dts --clean --out-dir dist",
27
+ "build": "tsup src/index.ts --format esm --clean --out-dir dist && tsc -p tsconfig.build.json && node ../../scripts/rewrite-dts-extensions.mjs dist",
28
28
  "test": "bun test src/*.test.ts",
29
29
  "check": "tsc --noEmit -p tsconfig.json"
30
30
  },
@@ -32,6 +32,6 @@
32
32
  "@types/bun": "^1.3.14",
33
33
  "@types/node": "^25.0.0",
34
34
  "tsup": "^8.5.0",
35
- "typescript": "^6.0.3"
35
+ "typescript": "^7.0.2"
36
36
  }
37
37
  }