@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.
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-4CLJF2DZ.js";
9
+ } from "./chunk-KXBXRR4I.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-AKFJONE7.js.map
19
+ //# sourceMappingURL=http-4A2JEPBD.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-RGC7IEOI.js";
9
+ } from "./chunk-4EOEBN3M.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-HLRWCSFF.js.map
20
+ //# sourceMappingURL=http-W6SXQA3Q.js.map
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ var __version__, __packageName__;
42
42
  var init_version_generated = __esm({
43
43
  "src/version.generated.ts"() {
44
44
  "use strict";
45
- __version__ = "0.51.0";
45
+ __version__ = "0.52.0";
46
46
  __packageName__ = "@bitfab/sdk";
47
47
  }
48
48
  });
@@ -3316,7 +3316,8 @@ __export(index_exports, {
3316
3316
  module.exports = __toCommonJS(index_exports);
3317
3317
 
3318
3318
  // src/assertions.ts
3319
- function expectationsPath(traceId, suffix = "") {
3319
+ var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
3320
+ function traceAssertionsPath(traceId, suffix = "") {
3320
3321
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
3321
3322
  }
3322
3323
  var TracesClient = class {
@@ -3324,18 +3325,29 @@ var TracesClient = class {
3324
3325
  this.httpClient = httpClient;
3325
3326
  }
3326
3327
  async getAssertions(traceId) {
3327
- return this.httpClient.get(expectationsPath(traceId));
3328
+ return this.httpClient.get(
3329
+ traceAssertionsPath(traceId)
3330
+ );
3328
3331
  }
3329
3332
  async saveAssertions(params) {
3330
- const response = await this.httpClient.request(expectationsPath(params.traceId), {
3331
- assertions: params.assertions,
3333
+ return this.saveAssertionsAll({
3334
+ updates: [{ traceId: params.traceId, assertions: params.assertions }],
3335
+ source: params.source
3336
+ });
3337
+ }
3338
+ async saveAssertionsAll(params) {
3339
+ if (params.updates.length === 0) {
3340
+ return [];
3341
+ }
3342
+ const response = await this.httpClient.request(ASSERTIONS_PATH, {
3343
+ updates: params.updates,
3332
3344
  source: params.source ?? "agent"
3333
3345
  });
3334
3346
  return response.assertions;
3335
3347
  }
3336
3348
  async archiveAssertions(params) {
3337
3349
  const response = await this.httpClient.request(
3338
- expectationsPath(params.traceId, "/archive"),
3350
+ traceAssertionsPath(params.traceId, "/archive"),
3339
3351
  { assertionIds: params.assertionIds }
3340
3352
  );
3341
3353
  return response.archived;