@sylphx/sdk 0.20.1 → 0.21.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.
@@ -14997,6 +14997,24 @@ async function putWithRetry(url, body, headers, signal, onProgress) {
14997
14997
  }
14998
14998
  throw lastErr;
14999
14999
  }
15000
+ function fileFromCompletion(completion, options, blob) {
15001
+ const now = /* @__PURE__ */ new Date();
15002
+ return {
15003
+ id: completion.fileId,
15004
+ filename: options.filename ?? (isFile(blob) ? blob.name : void 0) ?? "upload.bin",
15005
+ contentType: options.contentType ?? (blob.type || "application/octet-stream"),
15006
+ size: completion.size,
15007
+ checksumSha256: completion.checksumSha256,
15008
+ etag: completion.etag,
15009
+ visibility: options.visibility ?? "private",
15010
+ folder: options.folder ?? null,
15011
+ metadata: options.metadata ?? {},
15012
+ url: completion.url,
15013
+ isDeleted: false,
15014
+ createdAt: now,
15015
+ updatedAt: now
15016
+ };
15017
+ }
15000
15018
  async function uploadsCreate(config2, blob, options) {
15001
15019
  const signal = options.signal;
15002
15020
  if (signal?.aborted) throw toAbortError();
@@ -15063,7 +15081,7 @@ async function runSinglePart(config2, blob, session, options, idempotencyKey) {
15063
15081
  }
15064
15082
  );
15065
15083
  clearResume(String(session.uploadId));
15066
- return await fetchFile(config2, completion.fileId);
15084
+ return fileFromCompletion(completion, options, blob);
15067
15085
  }
15068
15086
  async function runMultipart(config2, blob, session, options, idempotencyKey) {
15069
15087
  const { onProgress, signal } = options;
@@ -15108,10 +15126,7 @@ async function runMultipart(config2, blob, session, options, idempotencyKey) {
15108
15126
  }
15109
15127
  );
15110
15128
  clearResume(String(session.uploadId));
15111
- return await fetchFile(config2, completion.fileId);
15112
- }
15113
- async function fetchFile(config2, fileId) {
15114
- return callApi(config2, PATHS.file(fileId), { method: "GET" });
15129
+ return fileFromCompletion(completion, options, blob);
15115
15130
  }
15116
15131
  async function uploadsAbort(config2, uploadId) {
15117
15132
  await withRetry(() => callApi(config2, PATHS.upload(uploadId), { method: "DELETE" }), {
@@ -29846,7 +29861,7 @@ var DEFAULT_CONFIG = {
29846
29861
  uploadInterval: SESSION_REPLAY_UPLOAD_INTERVAL_MS
29847
29862
  };
29848
29863
 
29849
- // ../../node_modules/web-vitals/dist/web-vitals.js
29864
+ // ../../../../.bun-cache/links/web-vitals@5.1.0-8d3498403ac6cf73/node_modules/web-vitals/dist/web-vitals.js
29850
29865
  var e = -1;
29851
29866
  var t = (t2) => {
29852
29867
  addEventListener("pageshow", ((n2) => {