@sparkvault/sdk-mobile 8.0.5 → 9.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/README.md +84 -115
- package/dist/app-sdk/content-conflict.d.ts +54 -0
- package/dist/app-sdk/content-conflict.js +57 -0
- package/dist/app-sdk/content-conflict.js.map +1 -0
- package/dist/app-sdk/email-address.d.ts +28 -0
- package/dist/app-sdk/email-address.js +8 -1
- package/dist/app-sdk/email-address.js.map +1 -1
- package/dist/app-sdk/ids.d.ts +14 -0
- package/dist/app-sdk/ids.js +24 -4
- package/dist/app-sdk/ids.js.map +1 -1
- package/dist/app-sdk/platform-domains.d.ts +22 -5
- package/dist/app-sdk/platform-domains.js +28 -9
- package/dist/app-sdk/platform-domains.js.map +1 -1
- package/dist/app-sdk/upload-publication.d.ts +20 -6
- package/dist/app-sdk/upload-publication.js +20 -6
- package/dist/app-sdk/upload-publication.js.map +1 -1
- package/dist/config.d.ts +6 -4
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +8 -6
- package/dist/errors.js +8 -6
- package/dist/errors.js.map +1 -1
- package/dist/ingots.js +8 -4
- package/dist/ingots.js.map +1 -1
- package/dist/notify.d.ts +15 -11
- package/dist/notify.js +6 -4
- package/dist/notify.js.map +1 -1
- package/dist/notify.test-d.d.ts +12 -7
- package/dist/notify.test-d.js +12 -7
- package/dist/notify.test-d.js.map +1 -1
- package/dist/tus.d.ts +19 -16
- package/dist/tus.js +26 -22
- package/dist/tus.js.map +1 -1
- package/dist/types.d.ts +25 -12
- package/package.json +1 -1
- package/src/app-sdk/content-conflict.js +61 -0
- package/src/app-sdk/email-address.js +9 -1
- package/src/app-sdk/ids.js +28 -4
- package/src/app-sdk/platform-domains.js +30 -9
- package/src/app-sdk/upload-publication.js +21 -6
- package/src/config.ts +6 -4
- package/src/errors.ts +8 -6
- package/src/ingots.ts +10 -4
- package/src/notify.test-d.ts +16 -10
- package/src/notify.ts +15 -11
- package/src/tus.ts +38 -32
- package/src/types.ts +25 -12
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The upload publication contract between Forge and Core's activation, and
|
|
7
|
-
* the facts of a transfer
|
|
8
|
-
* publication
|
|
9
|
-
* names),
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* too: the upload id its delete is
|
|
7
|
+
* the facts of a transfer both services spell: its token's shape and the
|
|
8
|
+
* publication the token is bound to (a content version, and the one an ingot
|
|
9
|
+
* row names), its charge's ledger reference and category, Core's revocation
|
|
10
|
+
* of an upload's token, and the refusals of Core's a transfer's answer names
|
|
11
|
+
* (the header, and the lock of a vault scheduled for deletion). Every client
|
|
12
|
+
* ends an upload it gives up by one rule here too: the upload id its delete is
|
|
13
|
+
* conditioned on (givenUpUploadId).
|
|
13
14
|
*
|
|
14
15
|
* Forge stamps UPLOAD_PUBLICATION_PROTOCOL on every upload session it creates
|
|
15
16
|
* and on the final state it hands Core's activation (POST
|
|
@@ -130,6 +131,20 @@ export function uploadTransferReference(istk) {
|
|
|
130
131
|
return `forge_ingot_transfer_upload_${istk.slice(0, TRANSFER_REFERENCE_ISTK_CHARS)}`;
|
|
131
132
|
}
|
|
132
133
|
|
|
134
|
+
/**
|
|
135
|
+
* The usage-ledger category, and type, of a Forge transfer's charge, by
|
|
136
|
+
* direction. Every charge of one upload (Core's activation, Core's charge of
|
|
137
|
+
* an upload that never publishes, Forge's cancel) lands under the one
|
|
138
|
+
* reference uploadTransferReference names, so each spells its category from
|
|
139
|
+
* here, and the console counts both directions as the bandwidth the ledger
|
|
140
|
+
* measures. Each day's usage summary is keyed by category, so a category's
|
|
141
|
+
* spelling is the key its rows sum under.
|
|
142
|
+
*/
|
|
143
|
+
export const TRANSFER_CHARGE_CATEGORIES = Object.freeze({
|
|
144
|
+
UPLOAD: 'Ingot Transfer - Forge Encryption',
|
|
145
|
+
DOWNLOAD: 'Ingot Transfer - Forge Decryption'
|
|
146
|
+
});
|
|
147
|
+
|
|
133
148
|
/**
|
|
134
149
|
* The codes Core's activation refuses an upload with, which Forge's refusal
|
|
135
150
|
* map reads (the status is Core's):
|
package/src/config.ts
CHANGED
|
@@ -52,10 +52,12 @@ export interface SparkVaultMobileConfig {
|
|
|
52
52
|
*/
|
|
53
53
|
backgroundTransfer?: MobileBackgroundTransfer;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* Whole-file PATCH adapter (one request, no progress, no abort; see
|
|
56
|
+
* MobileBackgroundUploader on backing it with a background session), the
|
|
57
|
+
* fallback when no `backgroundTransfer` engine is configured. Used only by
|
|
58
|
+
* uploads that ask for it (`transport: 'background'`) and fit one chunk;
|
|
59
|
+
* every other upload, and every upload when this is unset, streams over
|
|
60
|
+
* XHR.
|
|
59
61
|
*/
|
|
60
62
|
backgroundUploader?: MobileBackgroundUploader;
|
|
61
63
|
/**
|
package/src/errors.ts
CHANGED
|
@@ -148,12 +148,14 @@ export interface IngotNameHolder {
|
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* Thrown when a create is refused because an ingot already holds the name in
|
|
151
|
-
* the target folder (409 `details.reason === 'NAME_HELD'`)
|
|
152
|
-
* `onNameConflict: 'complete_pending'` a published
|
|
153
|
-
* holder. The server decided before writing
|
|
154
|
-
* untouched; `holder` is the row it read, which
|
|
155
|
-
* (send its bytes into its own row by id, adopt it,
|
|
156
|
-
* without a second read.
|
|
151
|
+
* the target folder (409 `details.reason === 'NAME_HELD'`) and the refusal
|
|
152
|
+
* describes that ingot: with `onNameConflict: 'complete_pending'` a published
|
|
153
|
+
* holder, with `'refuse'` any holder. The server decided before writing
|
|
154
|
+
* anything, so the holder is untouched; `holder` is the row it read, which
|
|
155
|
+
* lets the caller act on it (send its bytes into its own row by id, adopt it,
|
|
156
|
+
* or try another name) without a second read. A NAME_HELD that describes no
|
|
157
|
+
* holder (one another app manages, or a name another request claimed first)
|
|
158
|
+
* is a plain `SparkVaultMobileError`.
|
|
157
159
|
*/
|
|
158
160
|
export class IngotNameHeldError extends SparkVaultMobileError {
|
|
159
161
|
readonly holder: IngotNameHolder;
|
package/src/ingots.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTENT_CONFLICT_REASONS } from './app-sdk/content-conflict.js';
|
|
1
2
|
import { readForgeTransferUrl } from './app-sdk/forge-url.js';
|
|
2
3
|
import { INGOT_ACCESS_EVENT_TYPES, readIngotAccess } from './app-sdk/ingot-access-log.js';
|
|
3
4
|
import { givenUpUploadId } from './app-sdk/upload-publication.js';
|
|
@@ -397,13 +398,18 @@ function toTypedDownloadError(err: unknown): unknown {
|
|
|
397
398
|
|
|
398
399
|
/**
|
|
399
400
|
* A create refused over its holder (`complete_pending` over a published one,
|
|
400
|
-
* `refuse` over any) answers 409 CONFLICT with `details.reason
|
|
401
|
-
*
|
|
402
|
-
*
|
|
401
|
+
* `refuse` over any) answers 409 CONFLICT with `details.reason` NAME_HELD and
|
|
402
|
+
* the holder the server read. A NAME_HELD that describes no holder (one
|
|
403
|
+
* another app manages, or a name another request claimed first) and every
|
|
404
|
+
* other 409 on the create (a folder being deleted) stay a plain
|
|
403
405
|
* `SparkVaultMobileError`.
|
|
404
406
|
*/
|
|
405
407
|
function toTypedCreateError(err: unknown): unknown {
|
|
406
|
-
if (
|
|
408
|
+
if (
|
|
409
|
+
!(err instanceof SparkVaultMobileError) ||
|
|
410
|
+
err.statusCode !== 409 ||
|
|
411
|
+
err.details?.reason !== CONTENT_CONFLICT_REASONS.NAME_HELD
|
|
412
|
+
) {
|
|
407
413
|
return err;
|
|
408
414
|
}
|
|
409
415
|
const { ingot_id: ingotId, status, size_bytes: sizeBytes } = err.details;
|
package/src/notify.test-d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Notify wire-contract assertions — COMPILE-TIME ONLY.
|
|
3
3
|
*
|
|
4
|
-
* `NotificationRow` has no runtime, so a unit test can never
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* push and again on every SDK publish)
|
|
8
|
-
*
|
|
4
|
+
* `NotificationRow` has no runtime, so a unit test can never see how a field is
|
|
5
|
+
* typed: the transpiler strips it and every assertion passes. This file is the
|
|
6
|
+
* gate for that instead — `tsc --noEmit` (`pnpm typecheck`, which CI runs on
|
|
7
|
+
* every push and again on every SDK publish) refuses to compile the moment a
|
|
8
|
+
* member below stops being typed as stated there; the statements mirror
|
|
9
|
+
* `apps/api/src/notify/inbox.js` (`projectRow`) by hand.
|
|
10
|
+
*
|
|
11
|
+
* WHICH fields the row carries is gated across packages rather than here:
|
|
12
|
+
* tests/notify-contract.test.ts holds `NotificationRow` to
|
|
13
|
+
* `NOTIFY_RESPONSE_FIELDS.inboxRow` (`@sparkvault/app-sdk/notify-contract`),
|
|
14
|
+
* the list the Core API's suite holds its projection to.
|
|
9
15
|
*
|
|
10
16
|
* It is deliberately NOT a `*.test.ts`: that suffix is excluded from `tsconfig`,
|
|
11
17
|
* which would put these assertions exactly where the compiler cannot see them.
|
|
12
18
|
*
|
|
13
19
|
* The row shape is shared verbatim with `@sparkvault/sdk-js`, whose own contract
|
|
14
|
-
* file asserts the same four members
|
|
15
|
-
* server source is `apps/api/src/notify/inbox.js` (`projectRow`).
|
|
20
|
+
* file asserts the same four members, so both move together.
|
|
16
21
|
*/
|
|
17
22
|
|
|
18
23
|
import type { NotificationRow } from './notify.js';
|
|
@@ -34,10 +39,11 @@ export type NotifyWireContract = [
|
|
|
34
39
|
// it optional would let the app skip the "no longer available" branch and fall
|
|
35
40
|
// through to a reveal that opens nothing.
|
|
36
41
|
Assert<Equals<NotificationRow['recalled'], boolean>>,
|
|
37
|
-
// `locked` is
|
|
42
|
+
// `locked` is whether the row carries its pointer — always present.
|
|
38
43
|
Assert<Equals<NotificationRow['locked'], boolean>>,
|
|
39
|
-
// The pointer is
|
|
40
|
-
// it is optional in both directions and must be guarded
|
|
44
|
+
// The pointer is carried only while its grant still opens and is absent on a
|
|
45
|
+
// cleartext row, so it is optional in both directions and must be guarded
|
|
46
|
+
// before use.
|
|
41
47
|
Assert<Equals<NotificationRow['sparklink_code'], string | undefined>>,
|
|
42
48
|
// The URL the pointer opens travels with it: absent exactly when the pointer is.
|
|
43
49
|
Assert<Equals<NotificationRow['pointer_url'], string | undefined>>,
|
package/src/notify.ts
CHANGED
|
@@ -34,9 +34,11 @@ export interface NotificationRow {
|
|
|
34
34
|
archived_at: number | null;
|
|
35
35
|
/**
|
|
36
36
|
* The grant to open. Present only while a live reveal stands behind it — a
|
|
37
|
-
* SEALED (secure) send
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* SEALED (secure) send whose grant still opens: not yet opened (on a send that
|
|
38
|
+
* asks for an answer, not yet answered), not expired, not gone and not
|
|
39
|
+
* recalled. A cleartext send delivers its content inline in the channel and
|
|
40
|
+
* mints no grant; once the reveal no longer opens, the pointer is withheld
|
|
41
|
+
* rather than echoed.
|
|
40
42
|
*/
|
|
41
43
|
sparklink_code?: string;
|
|
42
44
|
/**
|
|
@@ -47,9 +49,10 @@ export interface NotificationRow {
|
|
|
47
49
|
pointer_url?: string;
|
|
48
50
|
/**
|
|
49
51
|
* True only when there is a secure part left to reveal — exactly when
|
|
50
|
-
* `sparklink_code` is present. `false` does NOT mean "cleartext row": a
|
|
51
|
-
* row
|
|
52
|
-
*
|
|
52
|
+
* `sparklink_code` is present. `false` does NOT mean "cleartext row": a sealed
|
|
53
|
+
* row whose reveal no longer opens (opened, answered, expired or gone) is
|
|
54
|
+
* unlocked too, and so is a recalled one, with nothing behind it. Branch on
|
|
55
|
+
* `recalled` before treating an unlocked row as plain text.
|
|
53
56
|
*/
|
|
54
57
|
locked: boolean;
|
|
55
58
|
/**
|
|
@@ -58,7 +61,6 @@ export interface NotificationRow {
|
|
|
58
61
|
* tap-to-reveal that opens nothing.
|
|
59
62
|
*/
|
|
60
63
|
recalled: boolean;
|
|
61
|
-
thread_id?: string;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export interface ListNotificationsOptions {
|
|
@@ -143,10 +145,12 @@ export interface RegisterDeviceResponse {
|
|
|
143
145
|
const MARK_ALL_MAX_PAGES = 100;
|
|
144
146
|
|
|
145
147
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
148
|
+
* SparkVault's first-party Notify surface: the metadata-only inbox of a user
|
|
149
|
+
* signed in to SparkVault itself, holding the notifications SparkVault delivered
|
|
150
|
+
* to them `in_app`, plus this device's push registration. The recipient is
|
|
151
|
+
* ALWAYS derived from the session on the server — no method takes a
|
|
152
|
+
* `recipient_id`, and any account/recipient a caller might try to supply is
|
|
153
|
+
* ignored.
|
|
150
154
|
*/
|
|
151
155
|
export class MobileNotifyClient {
|
|
152
156
|
private readonly http: MobileHttpClient;
|
package/src/tus.ts
CHANGED
|
@@ -104,19 +104,21 @@ export interface TusUploadFromUriOptions {
|
|
|
104
104
|
* Invoked whenever the session's expiry, as its latest answer named it,
|
|
105
105
|
* changes: Forge slides it forward with every committed chunk and names it
|
|
106
106
|
* on its answers (`Upload-Expires`). It is null (unknown) after an answer
|
|
107
|
-
* that named none, and from the hand-off of a request
|
|
108
|
-
*
|
|
109
|
-
* PATCH): either may have moved it unread. A caller
|
|
110
|
-
* session keeps its `expiresAt` current with this, so a
|
|
111
|
-
* expired (`isSessionExpired`) really is. A throw here
|
|
107
|
+
* that named none, and from the hand-off of a request JS cannot follow
|
|
108
|
+
* while it runs (the transfer engine's range, the single-chunk
|
|
109
|
+
* `backgroundUploader` PATCH): either may have moved it unread. A caller
|
|
110
|
+
* that persists the session keeps its `expiresAt` current with this, so a
|
|
111
|
+
* session it judges expired (`isSessionExpired`) really is. A throw here
|
|
112
|
+
* fails the upload.
|
|
112
113
|
*/
|
|
113
114
|
onSessionExpiry?: (expiresAt: number | null) => void;
|
|
114
115
|
/**
|
|
115
|
-
* `background`
|
|
116
|
-
*
|
|
117
|
-
* range of any file, else
|
|
118
|
-
* progress, no abort
|
|
119
|
-
*
|
|
116
|
+
* `background` asks for a transfer that survives suspension and rides the
|
|
117
|
+
* best engine the app provides: the OS transfer engine
|
|
118
|
+
* (`backgroundTransfer`) for the whole remaining range of any file, else
|
|
119
|
+
* the single-chunk `backgroundUploader` (no progress, no abort; whether it
|
|
120
|
+
* outlives a suspension is the uploader's) for a file that fits one chunk,
|
|
121
|
+
* else XHR. Default `foreground`: every chunk goes over XHR.
|
|
120
122
|
*/
|
|
121
123
|
transport?: UploadTransport;
|
|
122
124
|
/**
|
|
@@ -537,9 +539,11 @@ class SessionExpiry {
|
|
|
537
539
|
}
|
|
538
540
|
|
|
539
541
|
/**
|
|
540
|
-
* A request
|
|
541
|
-
*
|
|
542
|
-
* possibly while the app is not
|
|
542
|
+
* A request JS cannot follow while it runs is about to leave: the OS
|
|
543
|
+
* transfer engine's range, whose chunks commit (each sliding the expiry)
|
|
544
|
+
* with answers this upload never reads, possibly while the app is not
|
|
545
|
+
* running; or the single-chunk `backgroundUploader` PATCH, which reports
|
|
546
|
+
* nothing until it answers.
|
|
543
547
|
*/
|
|
544
548
|
forget(): void {
|
|
545
549
|
this.become(null);
|
|
@@ -958,11 +962,12 @@ function sendChunkOverXhr(
|
|
|
958
962
|
}
|
|
959
963
|
|
|
960
964
|
/**
|
|
961
|
-
* PATCH a whole file as the session's only chunk
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
* is read exactly like the
|
|
965
|
+
* PATCH a whole file as the session's only chunk through the app's
|
|
966
|
+
* single-request uploader (`backgroundUploader`) and resolve with Forge's
|
|
967
|
+
* answer, or with no answer when the adapter got none. The request reports
|
|
968
|
+
* no progress and takes no abort; whether it outlives a suspension is the
|
|
969
|
+
* uploader's (MobileBackgroundUploader). Its answer is read exactly like the
|
|
970
|
+
* XHR path's, so callers see one error taxonomy.
|
|
966
971
|
*/
|
|
967
972
|
async function sendWholeFileInBackground(
|
|
968
973
|
uploader: MobileBackgroundUploader,
|
|
@@ -1471,14 +1476,14 @@ export class MobileTusUploader {
|
|
|
1471
1476
|
private async sendChunk(transfer: TusTransfer, offset: number, chunks: ChunkSource): Promise<TransferAnswer> {
|
|
1472
1477
|
const backgroundUploader = chunks.transport === 'background' ? this.config.backgroundUploader : undefined;
|
|
1473
1478
|
if (backgroundUploader && this.fitsOneBackgroundRequest(offset, transfer.fileSize, transfer.chunkSize)) {
|
|
1474
|
-
// The
|
|
1475
|
-
// flight cannot stop it
|
|
1476
|
-
//
|
|
1477
|
-
//
|
|
1478
|
-
//
|
|
1479
|
-
//
|
|
1480
|
-
//
|
|
1481
|
-
//
|
|
1479
|
+
// The uploader takes no abort, so an abort that fires while this
|
|
1480
|
+
// request is in flight cannot stop it. It only ever carries a whole
|
|
1481
|
+
// single-chunk file, so a 2xx here means the transfer is complete: the
|
|
1482
|
+
// loop ends and the upload finishes normally (the caller verifies the
|
|
1483
|
+
// ingot), because a finished upload must never be reported as
|
|
1484
|
+
// cancelled, and a DELETE now would drop bytes Forge has already
|
|
1485
|
+
// finalized. Only an answer that leaves bytes missing reaches the abort
|
|
1486
|
+
// check before the next request.
|
|
1482
1487
|
transfer.expiry.forget();
|
|
1483
1488
|
return sendWholeFileInBackground(backgroundUploader, transfer, chunks.uri, offset);
|
|
1484
1489
|
}
|
|
@@ -1669,12 +1674,13 @@ export class MobileTusUploader {
|
|
|
1669
1674
|
}
|
|
1670
1675
|
|
|
1671
1676
|
/**
|
|
1672
|
-
* Whether the remaining transfer is ONE PATCH the
|
|
1673
|
-
* send: nothing uploaded yet and the whole file
|
|
1674
|
-
*
|
|
1675
|
-
* not exactly `X-Chunk-Size`, so a multi-chunk
|
|
1676
|
-
* request, and a partially uploaded session would
|
|
1677
|
-
* A zero-byte file stays on the XHR path (it
|
|
1677
|
+
* Whether the remaining transfer is ONE PATCH the single-request uploader
|
|
1678
|
+
* (`backgroundUploader`) can send: nothing uploaded yet and the whole file
|
|
1679
|
+
* inside a single chunk. The uploader sends whole files and Forge rejects
|
|
1680
|
+
* any non-final chunk that is not exactly `X-Chunk-Size`, so a multi-chunk
|
|
1681
|
+
* file has no legal single request, and a partially uploaded session would
|
|
1682
|
+
* resend bytes Forge holds. A zero-byte file stays on the XHR path (it
|
|
1683
|
+
* sends no PATCH at all there).
|
|
1678
1684
|
*/
|
|
1679
1685
|
private fitsOneBackgroundRequest(offset: number, fileSize: number, chunkSize: number): boolean {
|
|
1680
1686
|
return offset === 0 && fileSize > 0 && fileSize <= chunkSize;
|
package/src/types.ts
CHANGED
|
@@ -167,8 +167,10 @@ export interface ResendInviteResponse {
|
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
169
|
* Identity attempts usage. `attempts_cap` is the EFFECTIVE monthly allowance:
|
|
170
|
-
* the
|
|
171
|
-
* `attempts_cap_base` is
|
|
170
|
+
* the tier the period paid for, or the trial allowance while a trial is live.
|
|
171
|
+
* `attempts_cap_base` is the tier bought, as the subscription renews it: 0 on
|
|
172
|
+
* a trial, and the lower tier (0 for a cancel) while a decrease waits for the
|
|
173
|
+
* renewal, the period keeping the tier it paid for until then.
|
|
172
174
|
*/
|
|
173
175
|
export interface SubscriptionIdentityStatus {
|
|
174
176
|
attempts_cap: number | null;
|
|
@@ -226,13 +228,22 @@ export interface SparkVaultSubscription {
|
|
|
226
228
|
prepaid: boolean;
|
|
227
229
|
};
|
|
228
230
|
blocks: {
|
|
229
|
-
/** Effective capacity blocks
|
|
231
|
+
/** Effective capacity blocks: those this subscription holds for the
|
|
232
|
+
* period plus the add-on subscriptions' while a base Full License exists. */
|
|
230
233
|
storage: number;
|
|
231
234
|
bandwidth: number;
|
|
232
|
-
/** Blocks THIS subscription
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
/** Blocks THIS subscription renews with, as the subscription renews them. */
|
|
236
|
+
storage_base: number;
|
|
237
|
+
bandwidth_base: number;
|
|
238
|
+
/** Bandwidth blocks this subscription's current period paid for: above
|
|
239
|
+
* `bandwidth_base` while a dropped block waits for the renewal, the pool
|
|
240
|
+
* holding them until then. */
|
|
241
|
+
bandwidth_paid: number;
|
|
242
|
+
/** Blocks the account's capacity add-on subscriptions hold (bought on any
|
|
243
|
+
* rail, the App Store and Google Play among them): the tier a store's
|
|
244
|
+
* add-on sheet owns. */
|
|
245
|
+
storage_addon: number;
|
|
246
|
+
bandwidth_addon: number;
|
|
236
247
|
};
|
|
237
248
|
pools: SubscriptionPools;
|
|
238
249
|
identity: SubscriptionIdentityStatus;
|
|
@@ -999,10 +1010,12 @@ export interface IngotUploadSession extends TusSessionInfo {
|
|
|
999
1010
|
* `background` asks for the transfer to survive the app being suspended, and
|
|
1000
1011
|
* resolves to the best engine the app provides, in order: the OS transfer
|
|
1001
1012
|
* engine (`backgroundTransfer`: any file size, any offset, progress and
|
|
1002
|
-
* abort, chunks chained natively), else the
|
|
1003
|
-
* (`backgroundUploader`: only a file that fits one
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
1013
|
+
* abort, chunks chained natively while the app is suspended), else the
|
|
1014
|
+
* single-request uploader (`backgroundUploader`: only a file that fits one
|
|
1015
|
+
* chunk, sent as one PATCH with no progress and no abort; whether it
|
|
1016
|
+
* outlives a suspension is the uploader's, see MobileBackgroundUploader),
|
|
1017
|
+
* else plain XHR. The upload semantics are the same on every engine; only
|
|
1018
|
+
* what survives a suspension differs.
|
|
1006
1019
|
*/
|
|
1007
1020
|
export type UploadTransport = 'foreground' | 'background';
|
|
1008
1021
|
|
|
@@ -1057,7 +1070,7 @@ export interface MobileBackgroundTransfer {
|
|
|
1057
1070
|
cancel(uploadUrl: string): Promise<void>;
|
|
1058
1071
|
}
|
|
1059
1072
|
|
|
1060
|
-
/** Network policy an upload carries into the OS transfer; ignored by the XHR paths (JS gates those). Defaults: both true. */
|
|
1073
|
+
/** Network policy an upload carries into the OS transfer engine; ignored by the XHR and single-request paths (JS gates those). Defaults: both true. */
|
|
1061
1074
|
export interface UploadTransferPolicy {
|
|
1062
1075
|
allowsCellularAccess?: boolean;
|
|
1063
1076
|
allowsConstrainedNetworkAccess?: boolean;
|