@bitfab/sdk 0.36.7 → 0.36.8

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
@@ -77,6 +77,12 @@ declare class BitfabError extends Error {
77
77
  * cannot supply. Absent for network failures and non-HTTP errors.
78
78
  */
79
79
  readonly status?: number | undefined;
80
+ /**
81
+ * `Retry-After` in milliseconds, when the server sent one. A 429 or 503
82
+ * carries the server's own instruction about when to come back; retrying
83
+ * on our own schedule ignores it and keeps the pressure on.
84
+ */
85
+ readonly retryAfterMs?: number | undefined;
80
86
  constructor(message: string, url?: string | undefined,
81
87
  /**
82
88
  * HTTP status the request failed with, when it failed with one. The
@@ -84,7 +90,13 @@ declare class BitfabError extends Error {
84
90
  * never a 4xx the server will reject again), which a formatted message
85
91
  * cannot supply. Absent for network failures and non-HTTP errors.
86
92
  */
87
- status?: number | undefined);
93
+ status?: number | undefined,
94
+ /**
95
+ * `Retry-After` in milliseconds, when the server sent one. A 429 or 503
96
+ * carries the server's own instruction about when to come back; retrying
97
+ * on our own schedule ignores it and keeps the pressure on.
98
+ */
99
+ retryAfterMs?: number | undefined);
88
100
  }
89
101
 
90
102
  /**
@@ -334,17 +346,20 @@ interface CapturedSpan {
334
346
  startedAt: string | null;
335
347
  endedAt: string | null;
336
348
  }
337
- /**
338
- * HTTP client for Bitfab API requests.
339
- *
340
- * Provides methods for different API endpoints with proper error handling,
341
- * timeouts, and authentication.
342
- */
349
+ /** What a caller learns about one tracked trace once it takes it back. */
350
+ interface DeliveryReport {
351
+ spanCount: number;
352
+ /** A closing carrier was submitted, so the expected set is final. */
353
+ closed: boolean;
354
+ /** Every carrier submitted under this trace came back accepted. */
355
+ delivered: boolean;
356
+ }
343
357
  declare class HttpClient {
344
358
  private readonly apiKey;
345
359
  private readonly serviceUrl;
346
360
  private readonly timeout;
347
361
  private traceTransport;
362
+ private readonly traceDeliveries;
348
363
  private readonly deferredWork;
349
364
  private closed;
350
365
  private closing;
@@ -363,6 +378,39 @@ declare class HttpClient {
363
378
  * of each spinning up their own.
364
379
  */
365
380
  private getTraceTransport;
381
+ /**
382
+ * Post one encoded batch and decide what the server's answer means, so the
383
+ * transport never reads a response. Rejections and permanent statuses come
384
+ * back as a non-retryable {@link DeliveryError}; anything the server might
385
+ * still accept on a second try comes back retryable.
386
+ */
387
+ private deliverCarriers;
388
+ /**
389
+ * Start tracking delivery for `traceIds`. Nothing is recorded for a trace
390
+ * that was never tracked, so ordinary tracing costs no bookkeeping at all.
391
+ */
392
+ trackTraceDeliveries(traceIds: string[]): void;
393
+ /** Whether any tracked trace has had its closing carrier submitted. */
394
+ hasClosedDeliveries(traceIds: string[]): boolean;
395
+ /**
396
+ * Report what each tracked trace submitted and whether the server confirmed
397
+ * it, and stop tracking them. Every id passed is freed, so a caller cannot
398
+ * leak a record for a trace that never closed.
399
+ *
400
+ * `delivered` is only meaningful once a flush has settled: acks land before
401
+ * an export resolves, so a flush that reported success has already collected
402
+ * every ack it is going to collect.
403
+ */
404
+ takeTraceDeliveries(traceIds: string[]): Record<string, DeliveryReport>;
405
+ /** Build a carrier's meta and record what it adds to its trace's expected set. */
406
+ private recordedMeta;
407
+ private recordSubmittedCarrier;
408
+ /**
409
+ * Ingestion commits every carrier in a request before it answers, so a
410
+ * delivered ref is proof its row exists: the same fact the replay status
411
+ * endpoint would report, already in hand.
412
+ */
413
+ private recordDeliveredCarriers;
366
414
  /**
367
415
  * Track deferred span work so this client's own lifecycle waits for it, and
368
416
  * so the process-wide flush and exit hook do too.
@@ -2509,7 +2557,7 @@ declare class BitfabFunction {
2509
2557
  /**
2510
2558
  * SDK version from package.json (injected at build time)
2511
2559
  */
2512
- declare const __version__ = "0.36.7";
2560
+ declare const __version__ = "0.36.8";
2513
2561
 
2514
2562
  /**
2515
2563
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -77,6 +77,12 @@ declare class BitfabError extends Error {
77
77
  * cannot supply. Absent for network failures and non-HTTP errors.
78
78
  */
79
79
  readonly status?: number | undefined;
80
+ /**
81
+ * `Retry-After` in milliseconds, when the server sent one. A 429 or 503
82
+ * carries the server's own instruction about when to come back; retrying
83
+ * on our own schedule ignores it and keeps the pressure on.
84
+ */
85
+ readonly retryAfterMs?: number | undefined;
80
86
  constructor(message: string, url?: string | undefined,
81
87
  /**
82
88
  * HTTP status the request failed with, when it failed with one. The
@@ -84,7 +90,13 @@ declare class BitfabError extends Error {
84
90
  * never a 4xx the server will reject again), which a formatted message
85
91
  * cannot supply. Absent for network failures and non-HTTP errors.
86
92
  */
87
- status?: number | undefined);
93
+ status?: number | undefined,
94
+ /**
95
+ * `Retry-After` in milliseconds, when the server sent one. A 429 or 503
96
+ * carries the server's own instruction about when to come back; retrying
97
+ * on our own schedule ignores it and keeps the pressure on.
98
+ */
99
+ retryAfterMs?: number | undefined);
88
100
  }
89
101
 
90
102
  /**
@@ -334,17 +346,20 @@ interface CapturedSpan {
334
346
  startedAt: string | null;
335
347
  endedAt: string | null;
336
348
  }
337
- /**
338
- * HTTP client for Bitfab API requests.
339
- *
340
- * Provides methods for different API endpoints with proper error handling,
341
- * timeouts, and authentication.
342
- */
349
+ /** What a caller learns about one tracked trace once it takes it back. */
350
+ interface DeliveryReport {
351
+ spanCount: number;
352
+ /** A closing carrier was submitted, so the expected set is final. */
353
+ closed: boolean;
354
+ /** Every carrier submitted under this trace came back accepted. */
355
+ delivered: boolean;
356
+ }
343
357
  declare class HttpClient {
344
358
  private readonly apiKey;
345
359
  private readonly serviceUrl;
346
360
  private readonly timeout;
347
361
  private traceTransport;
362
+ private readonly traceDeliveries;
348
363
  private readonly deferredWork;
349
364
  private closed;
350
365
  private closing;
@@ -363,6 +378,39 @@ declare class HttpClient {
363
378
  * of each spinning up their own.
364
379
  */
365
380
  private getTraceTransport;
381
+ /**
382
+ * Post one encoded batch and decide what the server's answer means, so the
383
+ * transport never reads a response. Rejections and permanent statuses come
384
+ * back as a non-retryable {@link DeliveryError}; anything the server might
385
+ * still accept on a second try comes back retryable.
386
+ */
387
+ private deliverCarriers;
388
+ /**
389
+ * Start tracking delivery for `traceIds`. Nothing is recorded for a trace
390
+ * that was never tracked, so ordinary tracing costs no bookkeeping at all.
391
+ */
392
+ trackTraceDeliveries(traceIds: string[]): void;
393
+ /** Whether any tracked trace has had its closing carrier submitted. */
394
+ hasClosedDeliveries(traceIds: string[]): boolean;
395
+ /**
396
+ * Report what each tracked trace submitted and whether the server confirmed
397
+ * it, and stop tracking them. Every id passed is freed, so a caller cannot
398
+ * leak a record for a trace that never closed.
399
+ *
400
+ * `delivered` is only meaningful once a flush has settled: acks land before
401
+ * an export resolves, so a flush that reported success has already collected
402
+ * every ack it is going to collect.
403
+ */
404
+ takeTraceDeliveries(traceIds: string[]): Record<string, DeliveryReport>;
405
+ /** Build a carrier's meta and record what it adds to its trace's expected set. */
406
+ private recordedMeta;
407
+ private recordSubmittedCarrier;
408
+ /**
409
+ * Ingestion commits every carrier in a request before it answers, so a
410
+ * delivered ref is proof its row exists: the same fact the replay status
411
+ * endpoint would report, already in hand.
412
+ */
413
+ private recordDeliveredCarriers;
366
414
  /**
367
415
  * Track deferred span work so this client's own lifecycle waits for it, and
368
416
  * so the process-wide flush and exit hook do too.
@@ -2509,7 +2557,7 @@ declare class BitfabFunction {
2509
2557
  /**
2510
2558
  * SDK version from package.json (injected at build time)
2511
2559
  */
2512
- declare const __version__ = "0.36.7";
2560
+ declare const __version__ = "0.36.8";
2513
2561
 
2514
2562
  /**
2515
2563
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  getCurrentReplayBranch,
12
12
  getCurrentSpan,
13
13
  getCurrentTrace
14
- } from "./chunk-EDOZ3DP3.js";
14
+ } from "./chunk-B4HK3BPE.js";
15
15
  import {
16
16
  BITFAB_PROGRESS_PREFIX,
17
17
  BitfabError,
@@ -23,7 +23,7 @@ import {
23
23
  flushTraces,
24
24
  reportReplayProgress,
25
25
  serializeReplayResult
26
- } from "./chunk-CFECTUDU.js";
26
+ } from "./chunk-QUX6N7ON.js";
27
27
  export {
28
28
  BITFAB_PROGRESS_PREFIX,
29
29
  Bitfab,