@bitfab/sdk 0.16.0 → 0.16.1

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.cts CHANGED
@@ -343,9 +343,9 @@ declare class ReplayEnvironment {
343
343
  type MockStrategy = "none" | "all" | "marked";
344
344
  interface ReplayOptions {
345
345
  /**
346
- * Maximum number of traces to replay (1100, default 5). Mutually
347
- * exclusive with `traceIds` an explicit ID list already determines how
348
- * many traces replay, so passing both throws.
346
+ * Maximum number of traces to replay (1-100, default 5). Ignored when
347
+ * `traceIds` is passed (with a warning): an explicit ID list already
348
+ * determines how many traces replay.
349
349
  */
350
350
  limit?: number;
351
351
  /** Optional list of specific trace IDs to replay (max 100). */
@@ -959,9 +959,9 @@ declare class Bitfab {
959
959
  *
960
960
  * @param traceFunctionKey - The trace function key to replay
961
961
  * @param fn - The function to replay (must be the return value of `withSpan`)
962
- * @param options - Optional replay options. `limit` and `traceIds` are
963
- * mutually exclusive an explicit ID list already determines how many
964
- * traces replay, so passing both throws a BitfabError.
962
+ * @param options - Optional replay options. When `traceIds` is passed,
963
+ * `limit` is ignored (with a warning): an explicit ID list already
964
+ * determines how many traces replay.
965
965
  * @returns ReplayResult with items, testRunId, and testRunUrl
966
966
  */
967
967
  replay<TReturn>(traceFunctionKey: string, fn: (...args: any[]) => TReturn | Promise<TReturn>, options?: ReplayOptions): Promise<ReplayResult<TReturn>>;
@@ -1027,7 +1027,7 @@ declare class BitfabFunction {
1027
1027
  /**
1028
1028
  * SDK version from package.json (injected at build time)
1029
1029
  */
1030
- declare const __version__ = "0.16.0";
1030
+ declare const __version__ = "0.16.1";
1031
1031
 
1032
1032
  /**
1033
1033
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -343,9 +343,9 @@ declare class ReplayEnvironment {
343
343
  type MockStrategy = "none" | "all" | "marked";
344
344
  interface ReplayOptions {
345
345
  /**
346
- * Maximum number of traces to replay (1100, default 5). Mutually
347
- * exclusive with `traceIds` an explicit ID list already determines how
348
- * many traces replay, so passing both throws.
346
+ * Maximum number of traces to replay (1-100, default 5). Ignored when
347
+ * `traceIds` is passed (with a warning): an explicit ID list already
348
+ * determines how many traces replay.
349
349
  */
350
350
  limit?: number;
351
351
  /** Optional list of specific trace IDs to replay (max 100). */
@@ -959,9 +959,9 @@ declare class Bitfab {
959
959
  *
960
960
  * @param traceFunctionKey - The trace function key to replay
961
961
  * @param fn - The function to replay (must be the return value of `withSpan`)
962
- * @param options - Optional replay options. `limit` and `traceIds` are
963
- * mutually exclusive an explicit ID list already determines how many
964
- * traces replay, so passing both throws a BitfabError.
962
+ * @param options - Optional replay options. When `traceIds` is passed,
963
+ * `limit` is ignored (with a warning): an explicit ID list already
964
+ * determines how many traces replay.
965
965
  * @returns ReplayResult with items, testRunId, and testRunUrl
966
966
  */
967
967
  replay<TReturn>(traceFunctionKey: string, fn: (...args: any[]) => TReturn | Promise<TReturn>, options?: ReplayOptions): Promise<ReplayResult<TReturn>>;
@@ -1027,7 +1027,7 @@ declare class BitfabFunction {
1027
1027
  /**
1028
1028
  * SDK version from package.json (injected at build time)
1029
1029
  */
1030
- declare const __version__ = "0.16.0";
1030
+ declare const __version__ = "0.16.1";
1031
1031
 
1032
1032
  /**
1033
1033
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  flushTraces,
12
12
  getCurrentSpan,
13
13
  getCurrentTrace
14
- } from "./chunk-53G5GR7B.js";
14
+ } from "./chunk-P4WFJ5O3.js";
15
15
  import {
16
16
  BitfabError
17
17
  } from "./chunk-QT7HWOKU.js";
package/dist/node.cjs CHANGED
@@ -324,9 +324,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
324
324
  }
325
325
  }
326
326
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
327
- throw new BitfabError(
328
- "Pass either limit or traceIds, not both: an explicit trace ID list already determines how many traces replay."
329
- );
327
+ try {
328
+ console.warn(
329
+ "Bitfab: limit is ignored when traceIds is passed: the explicit trace ID list already determines how many traces replay."
330
+ );
331
+ } catch {
332
+ }
330
333
  }
331
334
  await replayContextReady;
332
335
  const {
@@ -443,7 +446,7 @@ registerAsyncLocalStorageClass(
443
446
  );
444
447
 
445
448
  // src/version.generated.ts
446
- var __version__ = "0.16.0";
449
+ var __version__ = "0.16.1";
447
450
 
448
451
  // src/constants.ts
449
452
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -3233,9 +3236,9 @@ var Bitfab = class {
3233
3236
  *
3234
3237
  * @param traceFunctionKey - The trace function key to replay
3235
3238
  * @param fn - The function to replay (must be the return value of `withSpan`)
3236
- * @param options - Optional replay options. `limit` and `traceIds` are
3237
- * mutually exclusive an explicit ID list already determines how many
3238
- * traces replay, so passing both throws a BitfabError.
3239
+ * @param options - Optional replay options. When `traceIds` is passed,
3240
+ * `limit` is ignored (with a warning): an explicit ID list already
3241
+ * determines how many traces replay.
3239
3242
  * @returns ReplayResult with items, testRunId, and testRunUrl
3240
3243
  */
3241
3244
  async replay(traceFunctionKey, fn, options) {