bitfab 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-4Z5FCOMO.js";
8
+ } from "./chunk-6M3EOIRH.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-TCOMLVHK.js.map
1213
+ //# sourceMappingURL=chunk-LLS4QMFH.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-4Z5FCOMO.js";
9
+ } from "./chunk-6M3EOIRH.js";
10
10
  import "./chunk-H6LZRFMN.js";
11
11
  export {
12
12
  BitfabError,
@@ -17,4 +17,4 @@ export {
17
17
  parseRetryAfterMs,
18
18
  serializePayloadBody
19
19
  };
20
- //# sourceMappingURL=http-CS565CIX.js.map
20
+ //# sourceMappingURL=http-EBBRHSDB.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-WBV4YW7X.js";
9
+ } from "./chunk-K4XVZ7BD.js";
10
10
  export {
11
11
  BitfabError,
12
12
  HttpClient,
@@ -16,4 +16,4 @@ export {
16
16
  parseRetryAfterMs,
17
17
  serializePayloadBody
18
18
  };
19
- //# sourceMappingURL=http-RQXNGCUQ.js.map
19
+ //# sourceMappingURL=http-OVESYGOV.js.map
package/dist/index.cjs CHANGED
@@ -51,7 +51,7 @@ var __version__, __packageName__;
51
51
  var init_version_generated = __esm({
52
52
  "src/version.generated.ts"() {
53
53
  "use strict";
54
- __version__ = "0.51.0";
54
+ __version__ = "0.52.0";
55
55
  __packageName__ = "bitfab";
56
56
  }
57
57
  });
@@ -3325,7 +3325,8 @@ __export(index_exports, {
3325
3325
  module.exports = __toCommonJS(index_exports);
3326
3326
 
3327
3327
  // src/assertions.ts
3328
- function expectationsPath(traceId, suffix = "") {
3328
+ var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
3329
+ function traceAssertionsPath(traceId, suffix = "") {
3329
3330
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
3330
3331
  }
3331
3332
  var TracesClient = class {
@@ -3333,18 +3334,29 @@ var TracesClient = class {
3333
3334
  this.httpClient = httpClient;
3334
3335
  }
3335
3336
  async getAssertions(traceId) {
3336
- return this.httpClient.get(expectationsPath(traceId));
3337
+ return this.httpClient.get(
3338
+ traceAssertionsPath(traceId)
3339
+ );
3337
3340
  }
3338
3341
  async saveAssertions(params) {
3339
- const response = await this.httpClient.request(expectationsPath(params.traceId), {
3340
- assertions: params.assertions,
3342
+ return this.saveAssertionsAll({
3343
+ updates: [{ traceId: params.traceId, assertions: params.assertions }],
3344
+ source: params.source
3345
+ });
3346
+ }
3347
+ async saveAssertionsAll(params) {
3348
+ if (params.updates.length === 0) {
3349
+ return [];
3350
+ }
3351
+ const response = await this.httpClient.request(ASSERTIONS_PATH, {
3352
+ updates: params.updates,
3341
3353
  source: params.source ?? "agent"
3342
3354
  });
3343
3355
  return response.assertions;
3344
3356
  }
3345
3357
  async archiveAssertions(params) {
3346
3358
  const response = await this.httpClient.request(
3347
- expectationsPath(params.traceId, "/archive"),
3359
+ traceAssertionsPath(params.traceId, "/archive"),
3348
3360
  { assertionIds: params.assertionIds }
3349
3361
  );
3350
3362
  return response.archived;