@sparkvault/sdk-mobile 9.0.10 → 10.0.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/src/types.ts CHANGED
@@ -874,9 +874,8 @@ export interface UploadResult {
874
874
  created?: boolean;
875
875
  /**
876
876
  * The ingot status the upload confirmed: `active`, the server's read of
877
- * the published ingot. An upload whose activation the poll budget could
878
- * not confirm never resolves: it rejects with a `TusUploadError` whose
879
- * `retryLater` is set.
877
+ * the published ingot. An upload whose read finds any other status never
878
+ * resolves: it rejects with a `TusUploadError` in phase `finalize`.
880
879
  */
881
880
  status?: Ingot['status'];
882
881
  /**
@@ -1035,23 +1034,15 @@ export interface MobileFileReader {
1035
1034
 
1036
1035
  /**
1037
1036
  * A tus upload session as Forge created it: the session URL, the per-upload
1038
- * token every request on it must carry, the chunk geometry Forge fixed for
1039
- * it, and when it lapses. Persist it to resume the upload after a failed
1040
- * attempt or a relaunch (`ingots.resumeUpload`) instead of re-sending bytes
1041
- * Forge holds.
1037
+ * token every request on it must carry, and the chunk geometry Forge fixed
1038
+ * for it. Persist it to resume the upload after a failed attempt or a
1039
+ * relaunch (`ingots.resumeUpload`) instead of re-sending bytes Forge holds;
1040
+ * the resume asks Forge (HEAD) whether it still holds the session.
1042
1041
  */
1043
1042
  export interface TusSessionInfo {
1044
1043
  uploadUrl: string;
1045
1044
  istk: string;
1046
1045
  chunkSize: number;
1047
- /**
1048
- * When the session lapses (epoch ms, Forge's `Upload-Expires`), or null
1049
- * when Forge named no expiry. Forge slides it forward on every committed
1050
- * chunk, so a caller that persists the session keeps this current through
1051
- * the upload's `onSessionExpiry`; past it, Forge refuses every request to
1052
- * the session (`isSessionExpired`).
1053
- */
1054
- expiresAt: number | null;
1055
1046
  }
1056
1047
 
1057
1048
  /**
@@ -1077,15 +1068,11 @@ export interface IngotUploadSession extends TusSessionInfo {
1077
1068
  /**
1078
1069
  * Which transport a tus upload rides. `foreground` (the default) streams
1079
1070
  * chunks over XHR with progress events, abort, and the stall watchdog.
1080
- * `background` asks for the transfer to survive the app being suspended, and
1081
- * resolves to the best engine the app provides, in order: the OS transfer
1082
- * engine (`backgroundTransfer`: any file size, any offset, progress and
1083
- * abort, chunks chained natively while the app is suspended), else the
1084
- * single-request uploader (`backgroundUploader`: only a file that fits one
1085
- * chunk, sent as one PATCH with no progress and no abort; whether it
1086
- * outlives a suspension is the uploader's, see MobileBackgroundUploader),
1087
- * else plain XHR. The upload semantics are the same on every engine; only
1088
- * what survives a suspension differs.
1071
+ * `background` asks for the transfer to survive the app being suspended: the
1072
+ * OS transfer engine (`backgroundTransfer`: any file size, any offset,
1073
+ * progress and abort, chunks chained natively while the app is suspended)
1074
+ * takes it when the app provides one, and plain XHR otherwise. The upload
1075
+ * semantics are the same on both; only what survives a suspension differs.
1089
1076
  */
1090
1077
  export type UploadTransport = 'foreground' | 'background';
1091
1078
 
@@ -1140,7 +1127,7 @@ export interface MobileBackgroundTransfer {
1140
1127
  cancel(uploadUrl: string): Promise<void>;
1141
1128
  }
1142
1129
 
1143
- /** Network policy an upload carries into the OS transfer engine; ignored by the XHR and single-request paths (JS gates those). Defaults: both true. */
1130
+ /** Network policy an upload carries into the OS transfer engine; ignored by the XHR path (JS gates it). Defaults: both true. */
1144
1131
  export interface UploadTransferPolicy {
1145
1132
  allowsCellularAccess?: boolean;
1146
1133
  allowsConstrainedNetworkAccess?: boolean;
@@ -1161,35 +1148,6 @@ export interface UploadTransferPolicy {
1161
1148
  */
1162
1149
  export type UploadAbortBehavior = 'terminate' | 'keep';
1163
1150
 
1164
- /**
1165
- * App-provided adapter that PATCHes a whole local file as the request body.
1166
- * The fallback behind `backgroundTransfer`: the tus uploader reaches for it
1167
- * only when no OS transfer engine is configured and the file fits one chunk;
1168
- * everything else keeps the streaming XHR path.
1169
- *
1170
- * The SDK does not ask for an OS background session here, and a host should
1171
- * think twice before backing this with one. A background session hands the
1172
- * body's path to a system daemon that opens the file in its own process,
1173
- * outside whatever sandbox extensions the app holds; a file the app can read
1174
- * is not necessarily one the daemon can. Where `fileUri` may point outside
1175
- * the app's container - a photo library original, a document-picker result -
1176
- * a background session fails at open() before a byte moves, and reports it
1177
- * as a transport error indistinguishable from a dead connection. A host that
1178
- * wants suspension-survival should stage the body into its own container
1179
- * first, the way the OS transfer engine does, or supply
1180
- * `backgroundTransfer` instead. Note that opting out can take an explicit
1181
- * flag: expo-file-system's `uploadAsync` writes `sessionType: BACKGROUND`
1182
- * into its options before spreading the caller's, so omitting the key selects
1183
- * a background session rather than declining one.
1184
- */
1185
- export interface MobileBackgroundUploader {
1186
- uploadFile(
1187
- url: string,
1188
- fileUri: string,
1189
- options: { method: 'PATCH'; headers: Record<string, string> }
1190
- ): Promise<{ status: number; headers: Record<string, string>; body: string }>;
1191
- }
1192
-
1193
1151
  export interface MobileDownloadProgress {
1194
1152
  bytesWritten: number;
1195
1153
  bytesTotal?: number;