@bitfab/sdk 0.28.6 → 0.28.7

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
@@ -1014,6 +1014,15 @@ interface CurrentTrace {
1014
1014
  * Context entries are stored in rawData.contexts as [{key, value}, ...].
1015
1015
  */
1016
1016
  addContext(context: Record<string, unknown>): void;
1017
+ /**
1018
+ * Flag this trace to be dropped. When the trace completes, the server scrubs
1019
+ * its payloads (trace, external trace, and all spans) and marks it `dropped`
1020
+ * instead of `completed`, retaining only a skeleton audit record. Use this to
1021
+ * discard runs you never want stored (e.g. health checks, or a run you know
1022
+ * contains sensitive data). Takes effect at trace completion; a trace that is
1023
+ * flagged but never completes is not scrubbed.
1024
+ */
1025
+ drop(): void;
1017
1026
  }
1018
1027
  /**
1019
1028
  * Get a handle to the current active span.
@@ -1603,7 +1612,7 @@ declare class BitfabFunction {
1603
1612
  /**
1604
1613
  * SDK version from package.json (injected at build time)
1605
1614
  */
1606
- declare const __version__ = "0.28.6";
1615
+ declare const __version__ = "0.28.7";
1607
1616
 
1608
1617
  /**
1609
1618
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -1014,6 +1014,15 @@ interface CurrentTrace {
1014
1014
  * Context entries are stored in rawData.contexts as [{key, value}, ...].
1015
1015
  */
1016
1016
  addContext(context: Record<string, unknown>): void;
1017
+ /**
1018
+ * Flag this trace to be dropped. When the trace completes, the server scrubs
1019
+ * its payloads (trace, external trace, and all spans) and marks it `dropped`
1020
+ * instead of `completed`, retaining only a skeleton audit record. Use this to
1021
+ * discard runs you never want stored (e.g. health checks, or a run you know
1022
+ * contains sensitive data). Takes effect at trace completion; a trace that is
1023
+ * flagged but never completes is not scrubbed.
1024
+ */
1025
+ drop(): void;
1017
1026
  }
1018
1027
  /**
1019
1028
  * Get a handle to the current active span.
@@ -1603,7 +1612,7 @@ declare class BitfabFunction {
1603
1612
  /**
1604
1613
  * SDK version from package.json (injected at build time)
1605
1614
  */
1606
- declare const __version__ = "0.28.6";
1615
+ declare const __version__ = "0.28.7";
1607
1616
 
1608
1617
  /**
1609
1618
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  flushTraces,
15
15
  getCurrentSpan,
16
16
  getCurrentTrace
17
- } from "./chunk-P4YXY7J4.js";
17
+ } from "./chunk-TIMBGA3A.js";
18
18
  import {
19
19
  BITFAB_PROGRESS_PREFIX,
20
20
  BitfabError,
package/dist/node.cjs CHANGED
@@ -697,7 +697,7 @@ registerAsyncLocalStorageClass(
697
697
  );
698
698
 
699
699
  // src/version.generated.ts
700
- var __version__ = "0.28.6";
700
+ var __version__ = "0.28.7";
701
701
 
702
702
  // src/constants.ts
703
703
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -3348,6 +3348,8 @@ var noOpTrace = {
3348
3348
  setMetadata() {
3349
3349
  },
3350
3350
  addContext() {
3351
+ },
3352
+ drop() {
3351
3353
  }
3352
3354
  };
3353
3355
  function getCurrentSpan() {
@@ -3424,6 +3426,12 @@ function getCurrentTrace() {
3424
3426
  traceState.contexts.push(context);
3425
3427
  } catch {
3426
3428
  }
3429
+ },
3430
+ drop() {
3431
+ try {
3432
+ getOrCreateTraceState().dropped = true;
3433
+ } catch {
3434
+ }
3427
3435
  }
3428
3436
  };
3429
3437
  }
@@ -4013,6 +4021,7 @@ var Bitfab = class {
4013
4021
  testRunId: traceState?.testRunId,
4014
4022
  inputSourceTraceId: traceState?.inputSourceTraceId,
4015
4023
  dbSnapshotRef: traceState?.dbSnapshotRef,
4024
+ dropped: traceState?.dropped,
4016
4025
  // Built AFTER the wrapped fn finished, so `accessed` reflects
4017
4026
  // whether customer code obtained the branch URL during this
4018
4027
  // item. Omitted entirely when no lease was attached, so the
@@ -4258,6 +4267,7 @@ var Bitfab = class {
4258
4267
  traceFunctionKey: params.traceFunctionKey,
4259
4268
  externalTrace: rawTrace,
4260
4269
  completed: true,
4270
+ ...params.dropped && { dropped: true },
4261
4271
  ...params.sessionId && { sessionId: params.sessionId },
4262
4272
  ...params.testRunId && { testRunId: params.testRunId }
4263
4273
  });