graphile-realtime-subscriptions 1.9.2 → 1.10.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.
@@ -12,7 +12,7 @@
12
12
  * The caller provides a Queryable (typically a pg.Pool from pg-cache)
13
13
  * and this class calls pool.query() directly for each operation.
14
14
  */
15
- import type { CursorTrackerOptions, ChangeLogEntry } from './types';
15
+ import type { ChangeLogEntry, CursorTrackerOptions } from './types';
16
16
  declare const DEFAULT_POLL_INTERVAL_MS = 5000;
17
17
  declare const DEFAULT_HEARTBEAT_INTERVAL_MS = 30000;
18
18
  declare const DEFAULT_BATCH_LIMIT = 500;
@@ -39,4 +39,4 @@ export declare class CursorTracker {
39
39
  get isRunning(): boolean;
40
40
  private quoteIdent;
41
41
  }
42
- export { DEFAULT_POLL_INTERVAL_MS, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_BATCH_LIMIT, DEFAULT_SCHEMA, };
42
+ export { DEFAULT_BATCH_LIMIT, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SCHEMA, };
package/cursor-tracker.js CHANGED
@@ -14,10 +14,10 @@
14
14
  * and this class calls pool.query() directly for each operation.
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.DEFAULT_SCHEMA = exports.DEFAULT_BATCH_LIMIT = exports.DEFAULT_HEARTBEAT_INTERVAL_MS = exports.DEFAULT_POLL_INTERVAL_MS = exports.CursorTracker = void 0;
18
- const crypto_1 = require("crypto");
17
+ exports.DEFAULT_SCHEMA = exports.DEFAULT_POLL_INTERVAL_MS = exports.DEFAULT_HEARTBEAT_INTERVAL_MS = exports.DEFAULT_BATCH_LIMIT = exports.CursorTracker = void 0;
19
18
  const logger_1 = require("@pgpmjs/logger");
20
19
  const quotes_1 = require("@pgsql/quotes");
20
+ const crypto_1 = require("crypto");
21
21
  const log = new logger_1.Logger('cursor-tracker');
22
22
  const DEFAULT_POLL_INTERVAL_MS = 5000;
23
23
  exports.DEFAULT_POLL_INTERVAL_MS = DEFAULT_POLL_INTERVAL_MS;
@@ -12,7 +12,7 @@
12
12
  * The caller provides a Queryable (typically a pg.Pool from pg-cache)
13
13
  * and this class calls pool.query() directly for each operation.
14
14
  */
15
- import type { CursorTrackerOptions, ChangeLogEntry } from './types';
15
+ import type { ChangeLogEntry, CursorTrackerOptions } from './types';
16
16
  declare const DEFAULT_POLL_INTERVAL_MS = 5000;
17
17
  declare const DEFAULT_HEARTBEAT_INTERVAL_MS = 30000;
18
18
  declare const DEFAULT_BATCH_LIMIT = 500;
@@ -39,4 +39,4 @@ export declare class CursorTracker {
39
39
  get isRunning(): boolean;
40
40
  private quoteIdent;
41
41
  }
42
- export { DEFAULT_POLL_INTERVAL_MS, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_BATCH_LIMIT, DEFAULT_SCHEMA, };
42
+ export { DEFAULT_BATCH_LIMIT, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SCHEMA, };
@@ -12,9 +12,9 @@
12
12
  * The caller provides a Queryable (typically a pg.Pool from pg-cache)
13
13
  * and this class calls pool.query() directly for each operation.
14
14
  */
15
- import { randomUUID } from 'crypto';
16
15
  import { Logger } from '@pgpmjs/logger';
17
16
  import { QuoteUtils } from '@pgsql/quotes';
17
+ import { randomUUID } from 'crypto';
18
18
  const log = new Logger('cursor-tracker');
19
19
  const DEFAULT_POLL_INTERVAL_MS = 5000;
20
20
  const DEFAULT_HEARTBEAT_INTERVAL_MS = 30000;
@@ -123,4 +123,4 @@ export class CursorTracker {
123
123
  return QuoteUtils.quoteIdentifier(identifier);
124
124
  }
125
125
  }
126
- export { DEFAULT_POLL_INTERVAL_MS, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_BATCH_LIMIT, DEFAULT_SCHEMA, };
126
+ export { DEFAULT_BATCH_LIMIT, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_SCHEMA, };
package/esm/index.d.ts CHANGED
@@ -16,9 +16,9 @@
16
16
  * };
17
17
  * ```
18
18
  */
19
+ export { CursorTracker } from './cursor-tracker';
19
20
  export { createRealtimeSubscriptionsPlugin, RealtimeSubscriptionsPlugin } from './plugin';
20
21
  export { RealtimeSubscriptionsPreset } from './preset';
21
- export { CursorTracker } from './cursor-tracker';
22
22
  export { RealtimeManager } from './realtime-manager';
23
23
  export type { RealtimeSubscriptionsPluginOptions } from './types';
24
- export type { CursorTrackerOptions, ChangeLogEntry, Queryable, RealtimeManagerOptions, } from './types';
24
+ export type { ChangeLogEntry, CursorTrackerOptions, Queryable, RealtimeManagerOptions, } from './types';
package/esm/index.js CHANGED
@@ -16,7 +16,7 @@
16
16
  * };
17
17
  * ```
18
18
  */
19
+ export { CursorTracker } from './cursor-tracker';
19
20
  export { createRealtimeSubscriptionsPlugin, RealtimeSubscriptionsPlugin } from './plugin';
20
21
  export { RealtimeSubscriptionsPreset } from './preset';
21
- export { CursorTracker } from './cursor-tracker';
22
22
  export { RealtimeManager } from './realtime-manager';
package/esm/plugin.d.ts CHANGED
@@ -80,5 +80,5 @@ export declare function createRealtimeSubscriptionsPlugin(options?: RealtimeSubs
80
80
  export { createRealtimeSubscriptionsPlugin as RealtimeSubscriptionsPlugin };
81
81
  export { CursorTracker } from './cursor-tracker';
82
82
  export { RealtimeManager } from './realtime-manager';
83
- export type { CursorTrackerOptions, ChangeLogEntry, Queryable, RealtimeManagerOptions } from './types';
84
- export { parseNotifyPayload, EventThrottle, DEFAULT_OVERFLOW_THRESHOLD };
83
+ export type { ChangeLogEntry, CursorTrackerOptions, Queryable, RealtimeManagerOptions } from './types';
84
+ export { DEFAULT_OVERFLOW_THRESHOLD, EventThrottle, parseNotifyPayload };
package/esm/plugin.js CHANGED
@@ -45,9 +45,9 @@
45
45
  * - When ids are provided, only events for those specific rows are delivered,
46
46
  * preventing cross-tenant event leaks.
47
47
  */
48
- import { context as grafastContext, listen, object, constant, lambda } from 'grafast';
49
- import { extendSchema } from 'graphile-utils';
50
48
  import { Logger } from '@pgpmjs/logger';
49
+ import { constant, context as grafastContext, lambda, listen, object } from 'grafast';
50
+ import { extendSchema } from 'graphile-utils';
51
51
  const log = new Logger('graphile-realtime-subscriptions');
52
52
  /** Default overflow threshold: events per second per table per subscriber */
53
53
  const DEFAULT_OVERFLOW_THRESHOLD = 50;
@@ -262,4 +262,4 @@ export { createRealtimeSubscriptionsPlugin as RealtimeSubscriptionsPlugin };
262
262
  export { CursorTracker } from './cursor-tracker';
263
263
  export { RealtimeManager } from './realtime-manager';
264
264
  // Exported for testing
265
- export { parseNotifyPayload, EventThrottle, DEFAULT_OVERFLOW_THRESHOLD };
265
+ export { DEFAULT_OVERFLOW_THRESHOLD, EventThrottle, parseNotifyPayload };
@@ -64,4 +64,4 @@ export declare class RealtimeManager {
64
64
  */
65
65
  private getEventEmitter;
66
66
  }
67
- export { extractRowId, entryToNotifyPayload, entryToChannel };
67
+ export { entryToChannel, entryToNotifyPayload, extractRowId };
@@ -131,4 +131,4 @@ export class RealtimeManager {
131
131
  return null;
132
132
  }
133
133
  }
134
- export { extractRowId, entryToNotifyPayload, entryToChannel };
134
+ export { entryToChannel, entryToNotifyPayload, extractRowId };
package/index.d.ts CHANGED
@@ -16,9 +16,9 @@
16
16
  * };
17
17
  * ```
18
18
  */
19
+ export { CursorTracker } from './cursor-tracker';
19
20
  export { createRealtimeSubscriptionsPlugin, RealtimeSubscriptionsPlugin } from './plugin';
20
21
  export { RealtimeSubscriptionsPreset } from './preset';
21
- export { CursorTracker } from './cursor-tracker';
22
22
  export { RealtimeManager } from './realtime-manager';
23
23
  export type { RealtimeSubscriptionsPluginOptions } from './types';
24
- export type { CursorTrackerOptions, ChangeLogEntry, Queryable, RealtimeManagerOptions, } from './types';
24
+ export type { ChangeLogEntry, CursorTrackerOptions, Queryable, RealtimeManagerOptions, } from './types';
package/index.js CHANGED
@@ -18,13 +18,13 @@
18
18
  * ```
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.RealtimeManager = exports.CursorTracker = exports.RealtimeSubscriptionsPreset = exports.RealtimeSubscriptionsPlugin = exports.createRealtimeSubscriptionsPlugin = void 0;
21
+ exports.RealtimeManager = exports.RealtimeSubscriptionsPreset = exports.RealtimeSubscriptionsPlugin = exports.createRealtimeSubscriptionsPlugin = exports.CursorTracker = void 0;
22
+ var cursor_tracker_1 = require("./cursor-tracker");
23
+ Object.defineProperty(exports, "CursorTracker", { enumerable: true, get: function () { return cursor_tracker_1.CursorTracker; } });
22
24
  var plugin_1 = require("./plugin");
23
25
  Object.defineProperty(exports, "createRealtimeSubscriptionsPlugin", { enumerable: true, get: function () { return plugin_1.createRealtimeSubscriptionsPlugin; } });
24
26
  Object.defineProperty(exports, "RealtimeSubscriptionsPlugin", { enumerable: true, get: function () { return plugin_1.RealtimeSubscriptionsPlugin; } });
25
27
  var preset_1 = require("./preset");
26
28
  Object.defineProperty(exports, "RealtimeSubscriptionsPreset", { enumerable: true, get: function () { return preset_1.RealtimeSubscriptionsPreset; } });
27
- var cursor_tracker_1 = require("./cursor-tracker");
28
- Object.defineProperty(exports, "CursorTracker", { enumerable: true, get: function () { return cursor_tracker_1.CursorTracker; } });
29
29
  var realtime_manager_1 = require("./realtime-manager");
30
30
  Object.defineProperty(exports, "RealtimeManager", { enumerable: true, get: function () { return realtime_manager_1.RealtimeManager; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-realtime-subscriptions",
3
- "version": "1.9.2",
3
+ "version": "1.10.0",
4
4
  "description": "Realtime subscription plugin for PostGraphile v5 — per-table GraphQL subscriptions via LISTEN/NOTIFY",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "homepage": "https://github.com/constructive-io/constructive",
@@ -40,8 +40,8 @@
40
40
  "url": "https://github.com/constructive-io/constructive/issues"
41
41
  },
42
42
  "dependencies": {
43
- "@pgpmjs/logger": "^2.23.2",
44
- "@pgsql/quotes": "^18.1.0"
43
+ "@pgpmjs/logger": "^2.24.0",
44
+ "@pgsql/quotes": "^18.2.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "grafast": "1.0.2",
@@ -56,5 +56,5 @@
56
56
  "@types/node": "^22.19.11",
57
57
  "makage": "^0.3.0"
58
58
  },
59
- "gitHead": "90f447482b056a4949134565db2665f21d11aca3"
59
+ "gitHead": "d508453a32a2f1d70ff6916871046615226e6f33"
60
60
  }
package/plugin.d.ts CHANGED
@@ -80,5 +80,5 @@ export declare function createRealtimeSubscriptionsPlugin(options?: RealtimeSubs
80
80
  export { createRealtimeSubscriptionsPlugin as RealtimeSubscriptionsPlugin };
81
81
  export { CursorTracker } from './cursor-tracker';
82
82
  export { RealtimeManager } from './realtime-manager';
83
- export type { CursorTrackerOptions, ChangeLogEntry, Queryable, RealtimeManagerOptions } from './types';
84
- export { parseNotifyPayload, EventThrottle, DEFAULT_OVERFLOW_THRESHOLD };
83
+ export type { ChangeLogEntry, CursorTrackerOptions, Queryable, RealtimeManagerOptions } from './types';
84
+ export { DEFAULT_OVERFLOW_THRESHOLD, EventThrottle, parseNotifyPayload };
package/plugin.js CHANGED
@@ -47,13 +47,13 @@
47
47
  * preventing cross-tenant event leaks.
48
48
  */
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.DEFAULT_OVERFLOW_THRESHOLD = exports.EventThrottle = exports.RealtimeManager = exports.CursorTracker = void 0;
50
+ exports.EventThrottle = exports.DEFAULT_OVERFLOW_THRESHOLD = exports.RealtimeManager = exports.CursorTracker = void 0;
51
51
  exports.createRealtimeSubscriptionsPlugin = createRealtimeSubscriptionsPlugin;
52
52
  exports.RealtimeSubscriptionsPlugin = createRealtimeSubscriptionsPlugin;
53
53
  exports.parseNotifyPayload = parseNotifyPayload;
54
+ const logger_1 = require("@pgpmjs/logger");
54
55
  const grafast_1 = require("grafast");
55
56
  const graphile_utils_1 = require("graphile-utils");
56
- const logger_1 = require("@pgpmjs/logger");
57
57
  const log = new logger_1.Logger('graphile-realtime-subscriptions');
58
58
  /** Default overflow threshold: events per second per table per subscriber */
59
59
  const DEFAULT_OVERFLOW_THRESHOLD = 50;
@@ -64,4 +64,4 @@ export declare class RealtimeManager {
64
64
  */
65
65
  private getEventEmitter;
66
66
  }
67
- export { extractRowId, entryToNotifyPayload, entryToChannel };
67
+ export { entryToChannel, entryToNotifyPayload, extractRowId };
@@ -25,9 +25,9 @@
25
25
  */
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.RealtimeManager = void 0;
28
- exports.extractRowId = extractRowId;
29
- exports.entryToNotifyPayload = entryToNotifyPayload;
30
28
  exports.entryToChannel = entryToChannel;
29
+ exports.entryToNotifyPayload = entryToNotifyPayload;
30
+ exports.extractRowId = extractRowId;
31
31
  const logger_1 = require("@pgpmjs/logger");
32
32
  const cursor_tracker_1 = require("./cursor-tracker");
33
33
  const log = new logger_1.Logger('realtime-manager');