@durable-streams/client-conformance-tests 0.2.8 → 0.2.10

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  const require_chunk = require('../chunk-BCwAaXi7.cjs');
4
- const require_protocol = require('../protocol-sDk3deGa.cjs');
4
+ const require_protocol = require('../protocol-DiMr0Kml.cjs');
5
5
  const node_readline = require_chunk.__toESM(require("node:readline"));
6
6
  const __durable_streams_client = require_chunk.__toESM(require("@durable-streams/client"));
7
7
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { ErrorCodes, decodeBase64, parseCommand, serializeResult } from "../protocol-BnqUAMKe.js";
2
+ import { ErrorCodes, decodeBase64, parseCommand, serializeResult } from "../protocol-JumvT5Vs.js";
3
3
  import { createInterface } from "node:readline";
4
4
  import { DurableStream, DurableStreamError, FetchError, IdempotentProducer, StreamClosedError, stream } from "@durable-streams/client";
5
5
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./chunk-BCwAaXi7.cjs');
3
- const require_protocol = require('./protocol-sDk3deGa.cjs');
3
+ const require_protocol = require('./protocol-DiMr0Kml.cjs');
4
4
  const node_child_process = require_chunk.__toESM(require("node:child_process"));
5
5
  const node_readline = require_chunk.__toESM(require("node:readline"));
6
6
  const node_crypto = require_chunk.__toESM(require("node:crypto"));
@@ -1,4 +1,4 @@
1
- import { calculateStats, formatStats, parseResult, serializeCommand } from "./protocol-BnqUAMKe.js";
1
+ import { calculateStats, formatStats, parseResult, serializeCommand } from "./protocol-JumvT5Vs.js";
2
2
  import { spawn } from "node:child_process";
3
3
  import { createInterface } from "node:readline";
4
4
  import { randomUUID } from "node:crypto";
package/dist/cli.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- require('./protocol-sDk3deGa.cjs');
4
- const require_benchmark_runner = require('./benchmark-runner-BQiarXdy.cjs');
3
+ require('./protocol-DiMr0Kml.cjs');
4
+ const require_benchmark_runner = require('./benchmark-runner-BZB5Nwsl.cjs');
5
5
 
6
6
  //#region src/cli.ts
7
7
  const HELP = `
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import "./protocol-BnqUAMKe.js";
3
- import { aggregateBenchmarkResults, runBenchmarks, runConformanceTests } from "./benchmark-runner-IGT51RTF.js";
2
+ import "./protocol-JumvT5Vs.js";
3
+ import { aggregateBenchmarkResults, runBenchmarks, runConformanceTests } from "./benchmark-runner-Dqg7zMvB.js";
4
4
 
5
5
  //#region src/cli.ts
6
6
  const HELP = `
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_protocol = require('./protocol-sDk3deGa.cjs');
2
- const require_benchmark_runner = require('./benchmark-runner-BQiarXdy.cjs');
1
+ const require_protocol = require('./protocol-DiMr0Kml.cjs');
2
+ const require_benchmark_runner = require('./benchmark-runner-BZB5Nwsl.cjs');
3
3
 
4
4
  exports.ErrorCodes = require_protocol.ErrorCodes
5
5
  exports.allScenarios = require_benchmark_runner.allScenarios
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ErrorCodes, calculateStats, decodeBase64, encodeBase64, formatStats, parseCommand, parseResult, serializeCommand, serializeResult } from "./protocol-BnqUAMKe.js";
2
- import { allScenarios, countTests, filterByCategory, getScenarioById, getScenariosByCategory, loadEmbeddedTestSuites, loadTestSuites, runBenchmarks, runConformanceTests, scenariosByCategory } from "./benchmark-runner-IGT51RTF.js";
1
+ import { ErrorCodes, calculateStats, decodeBase64, encodeBase64, formatStats, parseCommand, parseResult, serializeCommand, serializeResult } from "./protocol-JumvT5Vs.js";
2
+ import { allScenarios, countTests, filterByCategory, getScenarioById, getScenariosByCategory, loadEmbeddedTestSuites, loadTestSuites, runBenchmarks, runConformanceTests, scenariosByCategory } from "./benchmark-runner-Dqg7zMvB.js";
3
3
 
4
4
  export { ErrorCodes, allScenarios, calculateStats, countTests, decodeBase64, encodeBase64, filterByCategory, formatStats, getScenarioById, getScenariosByCategory, loadEmbeddedTestSuites, loadTestSuites, parseCommand, parseResult, runBenchmarks, runConformanceTests, scenariosByCategory, serializeCommand, serializeResult };
@@ -11,7 +11,7 @@ function parseCommand(line) {
11
11
  * Serialize a TestResult to a JSON line.
12
12
  */
13
13
  function serializeResult(result) {
14
- return JSON.stringify(result);
14
+ return serializeJsonLine(result);
15
15
  }
16
16
  /**
17
17
  * Parse a JSON line into a TestResult.
@@ -23,7 +23,10 @@ function parseResult(line) {
23
23
  * Serialize a TestCommand to a JSON line.
24
24
  */
25
25
  function serializeCommand(command) {
26
- return JSON.stringify(command);
26
+ return serializeJsonLine(command);
27
+ }
28
+ function serializeJsonLine(value) {
29
+ return JSON.stringify(value).replace(/[\u2028\u2029]/g, (char) => char === `\u2028` ? `\\u2028` : `\\u2029`);
27
30
  }
28
31
  /**
29
32
  * Encode binary data to base64 for transmission.
@@ -9,7 +9,7 @@ function parseCommand(line) {
9
9
  * Serialize a TestResult to a JSON line.
10
10
  */
11
11
  function serializeResult(result) {
12
- return JSON.stringify(result);
12
+ return serializeJsonLine(result);
13
13
  }
14
14
  /**
15
15
  * Parse a JSON line into a TestResult.
@@ -21,7 +21,10 @@ function parseResult(line) {
21
21
  * Serialize a TestCommand to a JSON line.
22
22
  */
23
23
  function serializeCommand(command) {
24
- return JSON.stringify(command);
24
+ return serializeJsonLine(command);
25
+ }
26
+ function serializeJsonLine(value) {
27
+ return JSON.stringify(value).replace(/[\u2028\u2029]/g, (char) => char === `\u2028` ? `\\u2028` : `\\u2029`);
25
28
  }
26
29
  /**
27
30
  * Encode binary data to base64 for transmission.
package/dist/protocol.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_protocol = require('./protocol-sDk3deGa.cjs');
1
+ const require_protocol = require('./protocol-DiMr0Kml.cjs');
2
2
 
3
3
  exports.ErrorCodes = require_protocol.ErrorCodes
4
4
  exports.calculateStats = require_protocol.calculateStats
package/dist/protocol.js CHANGED
@@ -1,3 +1,3 @@
1
- import { ErrorCodes, calculateStats, decodeBase64, encodeBase64, formatStats, parseCommand, parseResult, serializeCommand, serializeResult } from "./protocol-BnqUAMKe.js";
1
+ import { ErrorCodes, calculateStats, decodeBase64, encodeBase64, formatStats, parseCommand, parseResult, serializeCommand, serializeResult } from "./protocol-JumvT5Vs.js";
2
2
 
3
3
  export { ErrorCodes, calculateStats, decodeBase64, encodeBase64, formatStats, parseCommand, parseResult, serializeCommand, serializeResult };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@durable-streams/client-conformance-tests",
3
3
  "description": "Conformance test suite for Durable Streams client implementations (producer and consumer)",
4
- "version": "0.2.8",
4
+ "version": "0.2.10",
5
5
  "author": "Durable Stream contributors",
6
6
  "bin": {
7
7
  "client-conformance-tests": "./dist/cli.js",
@@ -14,8 +14,8 @@
14
14
  "fast-check": "^4.4.0",
15
15
  "tsx": "^4.19.2",
16
16
  "yaml": "^2.7.1",
17
- "@durable-streams/client": "0.2.5",
18
- "@durable-streams/server": "0.3.4"
17
+ "@durable-streams/client": "0.2.6",
18
+ "@durable-streams/server": "0.3.6"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsdown": "^0.9.0",
package/src/protocol.ts CHANGED
@@ -744,7 +744,7 @@ export function parseCommand(line: string): TestCommand {
744
744
  * Serialize a TestResult to a JSON line.
745
745
  */
746
746
  export function serializeResult(result: TestResult): string {
747
- return JSON.stringify(result)
747
+ return serializeJsonLine(result)
748
748
  }
749
749
 
750
750
  /**
@@ -758,7 +758,13 @@ export function parseResult(line: string): TestResult {
758
758
  * Serialize a TestCommand to a JSON line.
759
759
  */
760
760
  export function serializeCommand(command: TestCommand): string {
761
- return JSON.stringify(command)
761
+ return serializeJsonLine(command)
762
+ }
763
+
764
+ function serializeJsonLine(value: unknown): string {
765
+ return JSON.stringify(value).replace(/[\u2028\u2029]/g, (char) =>
766
+ char === `\u2028` ? `\\u2028` : `\\u2029`
767
+ )
762
768
  }
763
769
 
764
770
  /**