@beam-network/sdk 0.2.23 → 0.4.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.
package/README.md CHANGED
@@ -40,6 +40,7 @@ const transfer = await beam.createTransfer({
40
40
 
41
41
  const status = await beam.waitForTransfer(transfer.transfer_id);
42
42
  console.log(status.status);
43
+ await beam.close();
43
44
  ```
44
45
 
45
46
  The main `createTransfer` API is provider-aware and strictly typed for S3, R2, S3-compatible, and Hippius configs.
@@ -95,6 +96,10 @@ For low-level raw transfer configs, use `createRawTransfer`; lifecycle transport
95
96
 
96
97
  ## Route Streaming And Payload Size
97
98
 
98
- Provider transfers materialize the compact Runtime plan lazily, sign up to 64 routes concurrently by default, and stream a 256-route bootstrap batch followed by 2,048-route steady batches. Set `routeSigningConcurrency` on `BeamClientOptions` to tune the signing bound. Completed batches are sent FIFO while signing continues. Shared route fields use compact dictionaries, and encoded MessagePack requests split under `maxPayloadBytes`, which defaults to 24 MiB.
99
+ Provider transfers use `signed_url_v2` and `transfer-client-control/v3`. Before route streaming, S3, R2, and S3-compatible destinations create one metadata-bearing multipart upload per source/destination object. Its deduplicated manifest contains complete/abort and final HEAD controls, expected object size/count, required Beam object metadata, and exactly `ceil(max_part_number / 1000)` unique URLs in each of `list_page_urls` and `staging_list_urls`. Staging pages fix `MaxKeys=1000`; keys are ordered by unsigned UTF-8 bytes, page zero omits `StartAfter`, and later pages start after the preceding page's last key. Per-route batches carry only the stable group ID and route-attempt metadata. Part number is `source_chunk_index + 1`, and retries overwrite that same part.
100
+
101
+ The client signs up to 64 routes concurrently by default and emits a 32-route bootstrap batch followed by 256-route steady batches. Out-of-order signing completions are buffered until the next deterministic delivery index, keeping batch contents reproducible. The stream ID derives from the transfer and immutable plan identity, and each ordered batch ID includes its route-coordinate checksum. Manual multi-destination attachment requires `delivery_index` on every route. Encoded MessagePack requests still split under `maxPayloadBytes` (24 MiB by default), and lifecycle mutations retry transient failures up to three times with the same request identity. `waitForTransfer` subscribes to the API-key-owned, at-most-once terminal signal before its first status read and reconciles every signal through authoritative status; subscription failure degrades to the same jittered 15-to-30-second status fallback. Call `close()` when the client is no longer needed; it also closes outstanding terminal waiters.
102
+
103
+ Hippius uses genuine non-multipart v2 routes, so its manifest is empty and group-level final HEAD verification is not available from that provider flow.
99
104
 
100
105
  NATS requires this guard because the broker rejects messages above its configured `max_payload`. This limit applies only to lifecycle/control metadata; transfer file bytes do not flow through NATS.
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AttachSignedUrlsResponse, BeamClientOptions, DistributeResponse, PlanningHttpSource, PreparedDestination, PreparedHttpSource, ProviderTransferCreateInput, RawTransferCreateInput, SignedChunkRoute, SignedUrlFlow, TransferCancelResponse, TransferCreateResponse, TransferPlanResponse, TransferPrepareResponse, TransferStatusInfo } from "./models.js";
1
+ import type { AttachSignedUrlsResponse, BeamClientOptions, DistributeResponse, MultipartGroupManifest, PlanningHttpSource, PreparedDestination, PreparedHttpSource, ProviderTransferCreateInput, RawTransferCreateInput, SignedChunkRoute, SignedUrlFlow, TransferCancelResponse, TransferCreateResponse, TransferPlanResponse, TransferPrepareResponse, TransferStatusInfo, TransferTerminalSignalWaiter } from "./models.js";
2
2
  import { BEAM_DEFAULT_NATS_URL } from "./nats-control.js";
3
3
  export { BEAM_DEFAULT_NATS_URL };
4
4
  export declare class BeamApiError extends Error {
@@ -12,9 +12,10 @@ export declare class BeamClient {
12
12
  private readonly fetchImpl;
13
13
  private readonly control;
14
14
  private readonly routeSigningConcurrency;
15
- private readonly recoverySigners;
15
+ private readonly routeSigningConcurrencyOverridden;
16
16
  constructor(options?: BeamClientOptions);
17
17
  close(): Promise<void>;
18
+ openTransferTerminalWaiter(transferId: string): Promise<TransferTerminalSignalWaiter>;
18
19
  createRawTransfer(input: RawTransferCreateInput): Promise<TransferCreateResponse>;
19
20
  createTransfer(input: ProviderTransferCreateInput): Promise<TransferPrepareResponse>;
20
21
  transferStatus(transferId: string): Promise<TransferStatusInfo>;
@@ -35,23 +36,22 @@ export declare class BeamClient {
35
36
  testMode?: boolean;
36
37
  urlsExpiresAt?: string;
37
38
  signedUrlFlow?: SignedUrlFlow;
39
+ idempotencyKey?: string;
38
40
  }): Promise<TransferPrepareResponse>;
39
41
  attachSignedUrls(transferId: string, input: {
40
42
  chunkRoutes: SignedChunkRoute[];
43
+ multipartGroupManifest: MultipartGroupManifest[];
41
44
  transferKey?: string;
42
45
  urlsExpiresAt?: string;
43
- signedUrlFlow?: SignedUrlFlow;
44
46
  autoDistribute?: boolean;
45
47
  }): Promise<AttachSignedUrlsResponse>;
46
48
  prepareProviderTransfer(input: ProviderTransferCreateInput): Promise<TransferPrepareResponse>;
47
49
  private signProviderRoute;
48
- private startProviderRouteRecoverySigner;
49
- private stopRecoverySigner;
50
- private stopAllRecoverySigners;
51
50
  createAndDistribute(input: RawTransferCreateInput): Promise<TransferCreateResponse>;
52
51
  waitForTransfer(transferId: string, options?: {
53
52
  timeoutMs?: number;
54
53
  pollIntervalMs?: number;
54
+ maxPollIntervalMs?: number;
55
55
  }): Promise<TransferStatusInfo>;
56
56
  }
57
57
  export declare function buildStagingObjectPrefix(input: {