@crvouga/mockingbird-service-postgres 3.6.0 → 3.8.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.
@@ -56,6 +56,15 @@ type FaultRule = {
56
56
  requestHeaders?: Record<string, string>;
57
57
  /** Fault only requests carrying these query parameters. `"*"` matches any value. */
58
58
  query?: Record<string, string>;
59
+ /**
60
+ * Fault only requests whose JSON body carries these fields. Each key is a dotted path into
61
+ * the parsed body (`"patient_details.email"`; a number steps into an array, `"items.0.sku"`)
62
+ * and each value is what the field must equal: a string, number, boolean or `null`, compared
63
+ * strictly (`3` is not `"3"`). `"*"` matches any value that is present. A request whose body
64
+ * is missing, is not JSON, or is not a JSON object never matches. Not `body`, which is the
65
+ * response a rule injects.
66
+ */
67
+ requestBody?: Record<string, RequestBodyValue>;
59
68
  /**
60
69
  * Fault only this namespace. Omit (or `"*"`) to fault every namespace — which is what
61
70
  * an in-process caller usually wants, and what a parallel worker usually does not:
@@ -122,6 +131,8 @@ type FaultRule = {
122
131
  /** The preset this rule was expanded from, if any. */
123
132
  fromPreset?: string;
124
133
  };
134
+ /** What a field of the request body must equal in {@link FaultRule.requestBody}. */
135
+ type RequestBodyValue = string | number | boolean | null;
125
136
 
126
137
  /**
127
138
  * The admin controls every mock shares, as one document.
@@ -309,6 +320,13 @@ type ConfigService = {
309
320
  adminPrefix?: string;
310
321
  adminKey?: string;
311
322
  seed?: string;
323
+ /**
324
+ * Where this service's generated ids start: a non-negative integer or `"boot"` (derived from
325
+ * the clock). Replaces the fleet-wide `idBase`. Default: the same ids on every boot.
326
+ */
327
+ idBase?: number | string;
328
+ /** Boot settings, checked by the service's settings schema; every namespace starts from them. */
329
+ settings?: Record<string, unknown>;
312
330
  /** Admin controls this service boots with. A key given here replaces the fleet-wide one. */
313
331
  adminControls?: MockControls;
314
332
  fixtures?: Record<string, unknown>;