pg-interleave 0.2.0 → 0.3.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
@@ -22,6 +22,11 @@ export declare class PgInterleaveClient {
22
22
  */
23
23
  static tag(sql: string, sessionTag: string): string;
24
24
  reset(): Promise<void>;
25
+ resumeNext(): Promise<{
26
+ status: string;
27
+ barrier_id?: string;
28
+ }>;
29
+ barriers(): Promise<string[]>;
25
30
  hasTimeouts(): Promise<boolean>;
26
31
  getPid(client: Client): Promise<number>;
27
32
  intercept(options: InterceptOptions): Promise<BarrierHandle>;
package/dist/index.js CHANGED
@@ -54,6 +54,22 @@ class PgInterleaveClient {
54
54
  throw new Error(`Failed to reset proxy: HTTP ${res.status}`);
55
55
  }
56
56
  }
57
+ async resumeNext() {
58
+ const res = await fetch(`${this.controlUrl}/resume-next`, {
59
+ method: "POST",
60
+ });
61
+ if (!res.ok) {
62
+ throw new Error(`Failed to resume next barrier: HTTP ${res.status}`);
63
+ }
64
+ return (await res.json());
65
+ }
66
+ async barriers() {
67
+ const res = await fetch(`${this.controlUrl}/barriers`);
68
+ if (!res.ok) {
69
+ throw new Error(`Failed to fetch active barriers: HTTP ${res.status}`);
70
+ }
71
+ return (await res.json());
72
+ }
57
73
  async hasTimeouts() {
58
74
  const res = await fetch(`${this.controlUrl}/events`);
59
75
  if (!res.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-interleave",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Deterministic PostgreSQL wire-protocol proxy client for concurrency and chaos testing",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",