@crvouga/mockingbird-service-redis 2.3.0 → 2.5.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.
package/dist/index.d.ts CHANGED
@@ -73,6 +73,7 @@ type RedisFault = "readonly" | "oom" | "busy" | "disconnect" | "timeout" | "nosc
73
73
  latencyMs: number;
74
74
  } | null;
75
75
  interface Session {
76
+ controlPrivileged?: boolean;
76
77
  id: number;
77
78
  db: number;
78
79
  protocol: 2 | 3;
@@ -136,9 +137,13 @@ declare class Redis {
136
137
  connections(): number;
137
138
  pendingJobs(): number;
138
139
  activeCommands(): number;
140
+ nextEvent(): number | undefined;
141
+ settleTimers(): void;
139
142
  activeJobs(): number;
140
143
  fence(): () => void;
141
144
  snapshot(): object;
145
+ exportSnapshot(handle: unknown): unknown;
146
+ importSnapshot(document: unknown): object;
142
147
  restore(handle: unknown): void;
143
148
  disconnect(session: Session): void;
144
149
  inspect(db?: number): Array<{
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  encodeReply,
10
10
  manualClock,
11
11
  wallClock
12
- } from "./chunk-IWEHAJ2L.js";
12
+ } from "./chunk-Z3XQGVTX.js";
13
13
  export {
14
14
  Redis,
15
15
  RedisClient,
package/dist/server.d.ts CHANGED
@@ -209,6 +209,8 @@ type SnapshotDocument = {
209
209
  faults?: unknown;
210
210
  latency?: unknown;
211
211
  virtualTime?: boolean;
212
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
213
+ webhooks?: unknown;
212
214
  };
213
215
  /** Controls for one namespace. */
214
216
  type NamespaceControls = {
@@ -246,7 +248,15 @@ type FleetDiagnostics = {
246
248
  };
247
249
  /** Protocol packages own their state, listeners, credentials and namespace selection. */
248
250
  type FleetChild = {
249
- protocol: "http" | "postgres" | "redis";
251
+ targetName?: string;
252
+ dependencies?: string[];
253
+ coverage?: {
254
+ included: string[];
255
+ excluded: string[];
256
+ };
257
+ outboundPolicy?: "webhook-hub" | "unsupported";
258
+ packageVersion?: string;
259
+ protocol: "http" | "postgres" | "redis" | "external";
250
260
  url: string;
251
261
  connection?: string;
252
262
  connections?: Record<string, string>;
@@ -262,11 +272,37 @@ type FleetChild = {
262
272
  restore(namespace: string, checkpoint: unknown): Promise<void>;
263
273
  reset(namespace: string): Promise<void>;
264
274
  clock(namespace: string): Clock;
265
- settle?(namespace: string): Promise<void>;
275
+ nextEvent?(namespace: string): number | undefined | Promise<number | undefined>;
276
+ settle?(namespace: string, signal?: AbortSignal): Promise<void>;
277
+ exportCheckpoint?(namespace: string, checkpoint: unknown): Promise<unknown>;
278
+ importCheckpoint?(namespace: string, document: unknown): Promise<unknown>;
279
+ createNamespace?(namespace: string): Promise<void>;
280
+ deleteNamespace?(namespace: string): Promise<void>;
281
+ inspect?(namespace: string, options: {
282
+ offset: number;
283
+ limit: number;
284
+ collection?: string;
285
+ }): Promise<unknown>;
286
+ configure?(namespace: string, controls: Record<string, unknown>): Promise<unknown>;
287
+ unmatched?(namespace: string, limit: number): {
288
+ entries: unknown[];
289
+ truncated: boolean;
290
+ };
291
+ lastActivity?(namespace: string): number;
292
+ setAdmission?(allow: (namespace: string) => boolean): void;
293
+ initializationAccess?(): Promise<{
294
+ connections: Record<string, string>;
295
+ close(): Promise<void>;
296
+ }>;
266
297
  };
267
298
 
268
299
  /** A service entry in `mockingbird.json`. */
269
300
  type ConfigService = {
301
+ /** Stable config key is the instance identity; target defaults to that key. */
302
+ target?: string;
303
+ publicOrigin?: string;
304
+ publicPath?: string;
305
+ dependsOn?: string[];
270
306
  protocol?: "http" | "postgres" | "redis";
271
307
  port?: number;
272
308
  host?: string;
@@ -351,6 +387,7 @@ type RedisFault = "readonly" | "oom" | "busy" | "disconnect" | "timeout" | "nosc
351
387
  latencyMs: number;
352
388
  } | null;
353
389
  interface Session {
390
+ controlPrivileged?: boolean;
354
391
  id: number;
355
392
  db: number;
356
393
  protocol: 2 | 3;
@@ -414,9 +451,13 @@ declare class Redis {
414
451
  connections(): number;
415
452
  pendingJobs(): number;
416
453
  activeCommands(): number;
454
+ nextEvent(): number | undefined;
455
+ settleTimers(): void;
417
456
  activeJobs(): number;
418
457
  fence(): () => void;
419
458
  snapshot(): object;
459
+ exportSnapshot(handle: unknown): unknown;
460
+ importSnapshot(document: unknown): object;
420
461
  restore(handle: unknown): void;
421
462
  disconnect(session: Session): void;
422
463
  inspect(db?: number): Array<{
@@ -545,8 +586,12 @@ declare const DEFAULT_PORT = 8827;
545
586
  interface ServeOptions {
546
587
  port?: number;
547
588
  host?: string;
589
+ admit?: () => boolean;
590
+ closeEngine?: boolean;
591
+ controlPrivileged?: boolean;
548
592
  }
549
593
  interface RedisListening {
594
+ readonly listening: boolean;
550
595
  host: string;
551
596
  port: number;
552
597
  close(): Promise<void>;
package/dist/server.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  DEFAULT_PORT,
3
3
  serve,
4
4
  serveTarget
5
- } from "./chunk-LHM64CLD.js";
6
- import "./chunk-IWEHAJ2L.js";
5
+ } from "./chunk-LHUY4G3I.js";
6
+ import "./chunk-Z3XQGVTX.js";
7
7
  export {
8
8
  DEFAULT_PORT,
9
9
  serve,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-redis",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "In-process Redis RESP server for tests: strings, hashes, lists, sets, sorted sets, streams, transactions, pub/sub, and a Lua subset, with an injected clock. Not an HTTP emulator.",
5
5
  "license": "MIT",
6
6
  "type": "module",