@beam-network/sdk 0.5.17-dev.3 → 0.5.17-dev.4
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 +1 -1
- package/dist/client.js +16 -2
- package/dist/models.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -161,7 +161,7 @@ Create and resume accept an ownership `signal`. Aborting it stops initial routes
|
|
|
161
161
|
|
|
162
162
|
The stream ID derives from the transfer, selected flow, and immutable plan identity, and each ordered batch ID includes its route-coordinate checksum. Manual multi-destination attachment requires `delivery_index` on every route. Lifecycle mutations retry transient failures up to three times with the same request identity. A non-recoverable provider setup or route failure raises `BeamProviderTransferError`, whose `errors`, `transferCancelled`, and `multipartCleanupComplete` fields retain the original provider, cancellation, and cleanup outcomes. `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.
|
|
163
163
|
|
|
164
|
-
During the pre-completion `integrity_check` phase, Runtime may include an `integrity_audit_challenge` in status. The TypeScript client signs exact read-only source and final-destination GET ranges and submits `transfer.integrity_audit_grants`. S3-compatible source and destination grants use the prepared source ETag and Runtime-verified final-object ETag as `If-Match` conditions. Submission failures retry on the next status poll; the transfer completes with a warning if the check cannot finish by its deadline.
|
|
164
|
+
During the pre-completion `integrity_check` phase, Runtime may include an `integrity_audit_challenge` in status. The TypeScript client signs exact read-only source and final-destination GET ranges and submits `transfer.integrity_audit_grants`. S3-compatible source and destination grants use the prepared source ETag and Runtime-verified final-object ETag as `If-Match` conditions. Submission failures retry on the next status poll and appear as a URL-safe `integrity_audit_submission_error` on that status response; the transfer completes with a warning if the check cannot finish by its deadline.
|
|
165
165
|
|
|
166
166
|
Hippius uses canonical non-multipart `signed_url` routes, so its manifest is empty and group-level final HEAD verification is not available from that provider flow.
|
|
167
167
|
|
package/dist/client.js
CHANGED
|
@@ -121,7 +121,12 @@ export class BeamClient {
|
|
|
121
121
|
validateId(transferId, "transferId");
|
|
122
122
|
const status = await this.control.request("transfer.status", { transfer_id: transferId }, { transferId });
|
|
123
123
|
if (status.integrity_audit_challenge) {
|
|
124
|
-
|
|
124
|
+
try {
|
|
125
|
+
await this.submitIntegrityAuditGrantsIfPresent(status);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
status.integrity_audit_submission_error = integrityAuditErrorSummary(error);
|
|
129
|
+
}
|
|
125
130
|
}
|
|
126
131
|
if (["completed", "failed", "cancelled"].includes(status.status)) {
|
|
127
132
|
this.control.releaseRecoveryLease(transferId);
|
|
@@ -929,7 +934,7 @@ export class BeamClient {
|
|
|
929
934
|
return;
|
|
930
935
|
const signer = this.integrityAuditSigners.get(challenge.transfer_id);
|
|
931
936
|
if (!signer)
|
|
932
|
-
|
|
937
|
+
throw new Error("integrity audit signer unavailable");
|
|
933
938
|
const existing = this.integrityAuditSubmissions.get(challenge.audit_id);
|
|
934
939
|
if (existing) {
|
|
935
940
|
await existing;
|
|
@@ -1357,6 +1362,15 @@ async function mapOrderedWithConcurrency(values, concurrency, map) {
|
|
|
1357
1362
|
await Promise.all(workers);
|
|
1358
1363
|
return results;
|
|
1359
1364
|
}
|
|
1365
|
+
function integrityAuditErrorSummary(error) {
|
|
1366
|
+
if (!(error instanceof Error))
|
|
1367
|
+
return "unknown_error";
|
|
1368
|
+
const message = error.message.trim();
|
|
1369
|
+
if (!message || /https?:\/\/|x-amz|password|secret|token|authorization|credential/i.test(message)) {
|
|
1370
|
+
return error.name || "unknown_error";
|
|
1371
|
+
}
|
|
1372
|
+
return message.slice(0, 200);
|
|
1373
|
+
}
|
|
1360
1374
|
function positiveInteger(value, label) {
|
|
1361
1375
|
if (!Number.isInteger(value) || value < 1)
|
|
1362
1376
|
throw new Error(`${label} must be a positive integer.`);
|
package/dist/models.d.ts
CHANGED
|
@@ -171,6 +171,7 @@ export interface TransferStatusInfo {
|
|
|
171
171
|
completedDestinationIds: string[];
|
|
172
172
|
};
|
|
173
173
|
integrity_audit_challenge?: IntegrityAuditChallenge;
|
|
174
|
+
integrity_audit_submission_error?: string;
|
|
174
175
|
}
|
|
175
176
|
export interface ProviderTransferResumeInput extends Omit<ProviderTransferCreateInput, "idempotencyKey" | "routeGenerationId"> {
|
|
176
177
|
transferId: string;
|