@bitfab/sdk 0.51.0 → 0.52.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.
@@ -5,7 +5,7 @@ import {
5
5
  replayContextReady,
6
6
  runWithReplayContext,
7
7
  warnOnce
8
- } from "./chunk-RGC7IEOI.js";
8
+ } from "./chunk-4EOEBN3M.js";
9
9
 
10
10
  // src/codeChange.ts
11
11
  var MAX_FILES = 60;
@@ -1210,4 +1210,4 @@ export {
1210
1210
  sleepForReplayPersistence,
1211
1211
  replay
1212
1212
  };
1213
- //# sourceMappingURL=chunk-DNYZJLNY.js.map
1213
+ //# sourceMappingURL=chunk-SJ65MW4K.js.map
@@ -14,7 +14,7 @@ import {
14
14
  serializeValue,
15
15
  toJsonSafe,
16
16
  toJsonSafeReport
17
- } from "./chunk-DNYZJLNY.js";
17
+ } from "./chunk-SJ65MW4K.js";
18
18
  import {
19
19
  BitfabError,
20
20
  DEFAULT_SERVICE_URL,
@@ -22,7 +22,7 @@ import {
22
22
  MixedTracingError,
23
23
  getReplayContext,
24
24
  warnOnce
25
- } from "./chunk-RGC7IEOI.js";
25
+ } from "./chunk-4EOEBN3M.js";
26
26
  import {
27
27
  __privateAdd,
28
28
  __privateGet,
@@ -33,7 +33,8 @@ import {
33
33
  } from "./chunk-H6LZRFMN.js";
34
34
 
35
35
  // src/assertions.ts
36
- function expectationsPath(traceId, suffix = "") {
36
+ var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
37
+ function traceAssertionsPath(traceId, suffix = "") {
37
38
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
38
39
  }
39
40
  var TracesClient = class {
@@ -41,18 +42,29 @@ var TracesClient = class {
41
42
  this.httpClient = httpClient;
42
43
  }
43
44
  async getAssertions(traceId) {
44
- return this.httpClient.get(expectationsPath(traceId));
45
+ return this.httpClient.get(
46
+ traceAssertionsPath(traceId)
47
+ );
45
48
  }
46
49
  async saveAssertions(params) {
47
- const response = await this.httpClient.request(expectationsPath(params.traceId), {
48
- assertions: params.assertions,
50
+ return this.saveAssertionsAll({
51
+ updates: [{ traceId: params.traceId, assertions: params.assertions }],
52
+ source: params.source
53
+ });
54
+ }
55
+ async saveAssertionsAll(params) {
56
+ if (params.updates.length === 0) {
57
+ return [];
58
+ }
59
+ const response = await this.httpClient.request(ASSERTIONS_PATH, {
60
+ updates: params.updates,
49
61
  source: params.source ?? "agent"
50
62
  });
51
63
  return response.assertions;
52
64
  }
53
65
  async archiveAssertions(params) {
54
66
  const response = await this.httpClient.request(
55
- expectationsPath(params.traceId, "/archive"),
67
+ traceAssertionsPath(params.traceId, "/archive"),
56
68
  { assertionIds: params.assertionIds }
57
69
  );
58
70
  return response.archived;
@@ -4555,7 +4567,7 @@ var Bitfab = class {
4555
4567
  await runWithSeedContext({ traceId }, async () => target(...args));
4556
4568
  } finally {
4557
4569
  try {
4558
- const { flushTraces: flushTraces2 } = await import("./http-HLRWCSFF.js");
4570
+ const { flushTraces: flushTraces2 } = await import("./http-W6SXQA3Q.js");
4559
4571
  await flushTraces2(3e4);
4560
4572
  } finally {
4561
4573
  unrecorded = activeTraceStates.delete(traceId);
@@ -4583,7 +4595,7 @@ var Bitfab = class {
4583
4595
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
4584
4596
  );
4585
4597
  }
4586
- const { replay: doReplay } = await import("./replay-ISXRCXUP.js");
4598
+ const { replay: doReplay } = await import("./replay-SY74BXDK.js");
4587
4599
  return doReplay(
4588
4600
  this.httpClient,
4589
4601
  this.serviceUrl,
@@ -4849,7 +4861,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
4849
4861
  sessionId: seedCase.sessionId
4850
4862
  })
4851
4863
  );
4852
- const { flushTraces: flushTraces2 } = await import("./http-HLRWCSFF.js");
4864
+ const { flushTraces: flushTraces2 } = await import("./http-W6SXQA3Q.js");
4853
4865
  await flushTraces2(3e4);
4854
4866
  return { pipeline, traceFunctionKey, traceIds };
4855
4867
  }
@@ -4885,4 +4897,4 @@ export {
4885
4897
  defineReplayRegistry,
4886
4898
  seedFromRegistry
4887
4899
  };
4888
- //# sourceMappingURL=chunk-VXD27AJ3.js.map
4900
+ //# sourceMappingURL=chunk-VEDTNQQE.js.map