capacitor-background-transfer 0.0.0-stage → 0.1.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/CapacitorBackgroundTransfer.podspec +19 -0
- package/LICENSE +21 -0
- package/Package.swift +31 -0
- package/README.md +542 -2
- package/android/build.gradle +71 -0
- package/android/src/main/AndroidManifest.xml +20 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/AzureBlockUploader.java +148 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/BackgroundTransferPlugin.java +279 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Downloader.java +244 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Http.java +238 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/JobRuns.java +40 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Notifications.java +54 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Parts.java +25 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/PartsXml.java +199 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Pause.java +28 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Progress.java +13 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/PutUploader.java +47 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Runner.java +369 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/S3MultipartUploader.java +143 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Scheduler.java +144 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/TransferException.java +65 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/TransferJobService.java +115 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/TransferPaths.java +129 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/TransferRecord.java +163 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/TransferStore.java +121 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/TransferWorker.java +85 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/UploadAdapter.java +11 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/UploadAdapters.java +89 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/UploadOptionsCheck.java +104 -0
- package/android/src/main/java/io/github/sandman92/backgroundtransfer/Uploader.java +225 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +527 -0
- package/dist/esm/definitions.d.ts +277 -0
- package/dist/esm/definitions.js +24 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/validate.d.ts +18 -0
- package/dist/esm/validate.js +113 -0
- package/dist/esm/validate.js.map +1 -0
- package/dist/esm/web.d.ts +17 -0
- package/dist/esm/web.js +27 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +200 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +203 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/BackgroundTransferCore/Files.swift +166 -0
- package/ios/Sources/BackgroundTransferCore/PartsUpload.swift +327 -0
- package/ios/Sources/BackgroundTransferCore/PartsXML.swift +137 -0
- package/ios/Sources/BackgroundTransferCore/TransferPaths.swift +103 -0
- package/ios/Sources/BackgroundTransferCore/TransferRecord.swift +141 -0
- package/ios/Sources/BackgroundTransferCore/TransferStore.swift +69 -0
- package/ios/Sources/BackgroundTransferCore/UploadOptionsCheck.swift +90 -0
- package/ios/Sources/BackgroundTransferCore/UploadOutcome.swift +96 -0
- package/ios/Sources/BackgroundTransferCore/UploadProtocol.swift +30 -0
- package/ios/Sources/BackgroundTransferPlugin/BackgroundTransferPlugin.swift +168 -0
- package/ios/Sources/BackgroundTransferPlugin/TransferManager.swift +1074 -0
- package/package.json +96 -4
package/dist/docs.json
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "BackgroundTransferPlugin",
|
|
4
|
+
"slug": "backgroundtransferplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "isAvailable",
|
|
10
|
+
"signature": "() => Promise<AvailableResult>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<AvailableResult>",
|
|
13
|
+
"tags": [],
|
|
14
|
+
"docs": "Whether native background transfers work here. The web says no.",
|
|
15
|
+
"complexTypes": [
|
|
16
|
+
"AvailableResult"
|
|
17
|
+
],
|
|
18
|
+
"slug": "isavailable"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "upload",
|
|
22
|
+
"signature": "(options: UploadOptions) => Promise<TransferEvent>",
|
|
23
|
+
"parameters": [
|
|
24
|
+
{
|
|
25
|
+
"name": "options",
|
|
26
|
+
"docs": "",
|
|
27
|
+
"type": "UploadOptions"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"returns": "Promise<TransferEvent>",
|
|
31
|
+
"tags": [],
|
|
32
|
+
"docs": "Queue an upload to an upload you have set up on the server (see\n`UploadProtocol`). Refused at once if its options are missing or don't\nfit together (on Android and iOS also when `partUrls` doesn't match the\nfile's size). Call it while the app\nis on screen: Android only lets a user-initiated job be scheduled then,\nand iPhone may defer tasks started from the background.",
|
|
33
|
+
"complexTypes": [
|
|
34
|
+
"TransferEvent",
|
|
35
|
+
"UploadOptions"
|
|
36
|
+
],
|
|
37
|
+
"slug": "upload"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "download",
|
|
41
|
+
"signature": "(options: DownloadOptions) => Promise<TransferEvent>",
|
|
42
|
+
"parameters": [
|
|
43
|
+
{
|
|
44
|
+
"name": "options",
|
|
45
|
+
"docs": "",
|
|
46
|
+
"type": "DownloadOptions"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"returns": "Promise<TransferEvent>",
|
|
50
|
+
"tags": [],
|
|
51
|
+
"docs": "Queue a download. Same rules as `upload`.",
|
|
52
|
+
"complexTypes": [
|
|
53
|
+
"TransferEvent",
|
|
54
|
+
"DownloadOptions"
|
|
55
|
+
],
|
|
56
|
+
"slug": "download"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "cancel",
|
|
60
|
+
"signature": "(options: { id: string; direction: TransferDirection; }) => Promise<void>",
|
|
61
|
+
"parameters": [
|
|
62
|
+
{
|
|
63
|
+
"name": "options",
|
|
64
|
+
"docs": "",
|
|
65
|
+
"type": "{ id: string; direction: TransferDirection; }"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"returns": "Promise<void>",
|
|
69
|
+
"tags": [],
|
|
70
|
+
"docs": "Cancel a transfer; its temporary files are removed. Unknown ids are ignored.",
|
|
71
|
+
"complexTypes": [
|
|
72
|
+
"TransferDirection"
|
|
73
|
+
],
|
|
74
|
+
"slug": "cancel"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "list",
|
|
78
|
+
"signature": "() => Promise<{ transfers: TransferRecord[]; }>",
|
|
79
|
+
"parameters": [],
|
|
80
|
+
"returns": "Promise<{ transfers: TransferRecord[]; }>",
|
|
81
|
+
"tags": [],
|
|
82
|
+
"docs": "Every transfer the plugin remembers, including ones that ran, finished\nor failed while the app was closed. Ask on launch.",
|
|
83
|
+
"complexTypes": [
|
|
84
|
+
"TransferRecord"
|
|
85
|
+
],
|
|
86
|
+
"slug": "list"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "forget",
|
|
90
|
+
"signature": "(options?: { ids?: { id: string; direction: TransferDirection; }[] | undefined; } | undefined) => Promise<void>",
|
|
91
|
+
"parameters": [
|
|
92
|
+
{
|
|
93
|
+
"name": "options",
|
|
94
|
+
"docs": "",
|
|
95
|
+
"type": "{ ids?: { id: string; direction: TransferDirection; }[] | undefined; } | undefined"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"returns": "Promise<void>",
|
|
99
|
+
"tags": [],
|
|
100
|
+
"docs": "Forget finished, failed and cancelled transfers (all of them, or the\ngiven ids). Queued, running and interrupted ones are kept.",
|
|
101
|
+
"complexTypes": [
|
|
102
|
+
"TransferDirection"
|
|
103
|
+
],
|
|
104
|
+
"slug": "forget"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "addListener",
|
|
108
|
+
"signature": "(eventName: 'progress', listener: (event: TransferEvent) => void) => Promise<PluginListenerHandle>",
|
|
109
|
+
"parameters": [
|
|
110
|
+
{
|
|
111
|
+
"name": "eventName",
|
|
112
|
+
"docs": "",
|
|
113
|
+
"type": "'progress'"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "listener",
|
|
117
|
+
"docs": "",
|
|
118
|
+
"type": "(event: TransferEvent) => void"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
122
|
+
"tags": [],
|
|
123
|
+
"docs": "Bytes moved. At most a few events a second per transfer.",
|
|
124
|
+
"complexTypes": [
|
|
125
|
+
"PluginListenerHandle",
|
|
126
|
+
"TransferEvent"
|
|
127
|
+
],
|
|
128
|
+
"slug": "addlistenerprogress-"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "addListener",
|
|
132
|
+
"signature": "(eventName: 'stateChange', listener: (event: TransferEvent) => void) => Promise<PluginListenerHandle>",
|
|
133
|
+
"parameters": [
|
|
134
|
+
{
|
|
135
|
+
"name": "eventName",
|
|
136
|
+
"docs": "",
|
|
137
|
+
"type": "'stateChange'"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "listener",
|
|
141
|
+
"docs": "",
|
|
142
|
+
"type": "(event: TransferEvent) => void"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
146
|
+
"tags": [],
|
|
147
|
+
"docs": "Any change of `state` (queued, running, interrupted, finished, failed,\ncancelled).",
|
|
148
|
+
"complexTypes": [
|
|
149
|
+
"PluginListenerHandle",
|
|
150
|
+
"TransferEvent"
|
|
151
|
+
],
|
|
152
|
+
"slug": "addlistenerstatechange-"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "removeAllListeners",
|
|
156
|
+
"signature": "() => Promise<void>",
|
|
157
|
+
"parameters": [],
|
|
158
|
+
"returns": "Promise<void>",
|
|
159
|
+
"tags": [],
|
|
160
|
+
"docs": "",
|
|
161
|
+
"complexTypes": [],
|
|
162
|
+
"slug": "removealllisteners"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"properties": []
|
|
166
|
+
},
|
|
167
|
+
"interfaces": [
|
|
168
|
+
{
|
|
169
|
+
"name": "AvailableResult",
|
|
170
|
+
"slug": "availableresult",
|
|
171
|
+
"docs": "",
|
|
172
|
+
"tags": [],
|
|
173
|
+
"methods": [],
|
|
174
|
+
"properties": [
|
|
175
|
+
{
|
|
176
|
+
"name": "available",
|
|
177
|
+
"tags": [],
|
|
178
|
+
"docs": "",
|
|
179
|
+
"complexTypes": [],
|
|
180
|
+
"type": "boolean"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "mechanism",
|
|
184
|
+
"tags": [],
|
|
185
|
+
"docs": "How transfers run here: `job` (Android 14+ user-initiated data transfer\njob), `worker` (WorkManager `dataSync` foreground service below Android\n14), `urlsession` (iPhone background `URLSession`) or `none` (web).",
|
|
186
|
+
"complexTypes": [],
|
|
187
|
+
"type": "'job' | 'worker' | 'urlsession' | 'none'"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "warning",
|
|
191
|
+
"tags": [],
|
|
192
|
+
"docs": "Set when the app is set up so that transfers can't run as they should, e.g. below Android 14\nwhen the manifest doesn't declare WorkManager's foreground service with the `dataSync` type\n(the worker then stops when the app leaves the screen). For logs, not for people.",
|
|
193
|
+
"complexTypes": [],
|
|
194
|
+
"type": "string | undefined"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "TransferEvent",
|
|
200
|
+
"slug": "transferevent",
|
|
201
|
+
"docs": "",
|
|
202
|
+
"tags": [],
|
|
203
|
+
"methods": [],
|
|
204
|
+
"properties": [
|
|
205
|
+
{
|
|
206
|
+
"name": "transfer",
|
|
207
|
+
"tags": [],
|
|
208
|
+
"docs": "",
|
|
209
|
+
"complexTypes": [
|
|
210
|
+
"TransferRecord"
|
|
211
|
+
],
|
|
212
|
+
"type": "TransferRecord"
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "TransferRecord",
|
|
218
|
+
"slug": "transferrecord",
|
|
219
|
+
"docs": "What the plugin knows about one transfer.",
|
|
220
|
+
"tags": [],
|
|
221
|
+
"methods": [],
|
|
222
|
+
"properties": [
|
|
223
|
+
{
|
|
224
|
+
"name": "id",
|
|
225
|
+
"tags": [],
|
|
226
|
+
"docs": "",
|
|
227
|
+
"complexTypes": [],
|
|
228
|
+
"type": "string"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "direction",
|
|
232
|
+
"tags": [],
|
|
233
|
+
"docs": "",
|
|
234
|
+
"complexTypes": [
|
|
235
|
+
"TransferDirection"
|
|
236
|
+
],
|
|
237
|
+
"type": "TransferDirection"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "state",
|
|
241
|
+
"tags": [],
|
|
242
|
+
"docs": "",
|
|
243
|
+
"complexTypes": [
|
|
244
|
+
"TransferState"
|
|
245
|
+
],
|
|
246
|
+
"type": "TransferState"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "url",
|
|
250
|
+
"tags": [],
|
|
251
|
+
"docs": "",
|
|
252
|
+
"complexTypes": [],
|
|
253
|
+
"type": "string"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "path",
|
|
257
|
+
"tags": [],
|
|
258
|
+
"docs": "",
|
|
259
|
+
"complexTypes": [],
|
|
260
|
+
"type": "string"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "protocol",
|
|
264
|
+
"tags": [],
|
|
265
|
+
"docs": "Uploads: the protocol the session speaks.",
|
|
266
|
+
"complexTypes": [
|
|
267
|
+
"UploadProtocol"
|
|
268
|
+
],
|
|
269
|
+
"type": "UploadProtocol"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "bytes",
|
|
273
|
+
"tags": [],
|
|
274
|
+
"docs": "Bytes the server holds (upload) or that have landed in `.part`\n(download). For `s3-multipart` and `azure-blocks`, the parts or blocks\nstored plus the bytes of the one being sent (so it goes back to the\nstored parts' end when a part cut off part-way is sent again); for `put`,\nthe bytes sent so far in this attempt. Below `total` until the server has\nconfirmed the whole object.",
|
|
275
|
+
"complexTypes": [],
|
|
276
|
+
"type": "number"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "total",
|
|
280
|
+
"tags": [],
|
|
281
|
+
"docs": "Total size, or -1 until it is known.",
|
|
282
|
+
"complexTypes": [],
|
|
283
|
+
"type": "number"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "reason",
|
|
287
|
+
"tags": [],
|
|
288
|
+
"docs": "Set when `state` is `failed`, `cancelled` or `interrupted`.",
|
|
289
|
+
"complexTypes": [
|
|
290
|
+
"TransferFailureReason"
|
|
291
|
+
],
|
|
292
|
+
"type": "TransferFailureReason"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "message",
|
|
296
|
+
"tags": [],
|
|
297
|
+
"docs": "Detail for logs; not for showing to people.",
|
|
298
|
+
"complexTypes": [],
|
|
299
|
+
"type": "string | undefined"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "httpStatus",
|
|
303
|
+
"tags": [],
|
|
304
|
+
"docs": "HTTP status of the response that stopped it, when there was one.",
|
|
305
|
+
"complexTypes": [],
|
|
306
|
+
"type": "number | undefined"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"name": "updatedAt",
|
|
310
|
+
"tags": [],
|
|
311
|
+
"docs": "Milliseconds since the epoch.",
|
|
312
|
+
"complexTypes": [],
|
|
313
|
+
"type": "number"
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "UploadOptions",
|
|
319
|
+
"slug": "uploadoptions",
|
|
320
|
+
"docs": "",
|
|
321
|
+
"tags": [],
|
|
322
|
+
"methods": [],
|
|
323
|
+
"properties": [
|
|
324
|
+
{
|
|
325
|
+
"name": "url",
|
|
326
|
+
"tags": [],
|
|
327
|
+
"docs": "Where the upload goes, which depends on `protocol`:\n\n- `firebase-resumable`: the session URL of an upload you have already\n started (the `X-Goog-Upload-URL` from its `start`). The plugin asks it\n how many bytes it holds, sends the rest and finalizes.\n- `put`: the URL to `PUT` the whole file to.\n- `s3-multipart`: the presigned `CompleteMultipartUpload` URL (`POST`,\n with the upload's `uploadId`).\n- `azure-blocks`: the blob's SAS URL (with its `sig` parameter). The\n blob's properties go in `headers` as `x-ms-blob-content-type` and the\n other `x-ms-blob-*` headers: they are sent with the commit only.",
|
|
328
|
+
"complexTypes": [],
|
|
329
|
+
"type": "string"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "protocol",
|
|
333
|
+
"tags": [],
|
|
334
|
+
"docs": "The protocol the upload speaks. Default `firebase-resumable`. An\nunknown value is refused.",
|
|
335
|
+
"complexTypes": [
|
|
336
|
+
"UploadProtocol"
|
|
337
|
+
],
|
|
338
|
+
"type": "UploadProtocol"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "partUrls",
|
|
342
|
+
"tags": [],
|
|
343
|
+
"docs": "`s3-multipart` only, and required there: the presigned `UploadPart` URL\nof every part, part 1 first. There must be exactly as many as the file\nneeds in `partSize` parts (at most 10,000). They must stay valid until\nthe last part is sent.",
|
|
344
|
+
"complexTypes": [],
|
|
345
|
+
"type": "string[] | undefined"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "partSize",
|
|
349
|
+
"tags": [],
|
|
350
|
+
"docs": "`s3-multipart` only: the size of every part but the last, in bytes.\nDefault 8 MiB. At least 5 MiB when there is more than one part, at most\n5 GiB.",
|
|
351
|
+
"complexTypes": [],
|
|
352
|
+
"type": "number | undefined"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "listPartsUrl",
|
|
356
|
+
"tags": [],
|
|
357
|
+
"docs": "`s3-multipart` only, optional: the presigned `ListParts` URL (`GET`, with\nthe `uploadId`). When it is given, a resumed upload asks the server which\nparts it holds instead of trusting the plugin's own record, so a part\nthe server lost is sent again and fresh URLs for the same upload carry on\nwhere the old ones stopped.",
|
|
358
|
+
"complexTypes": [],
|
|
359
|
+
"type": "string | undefined"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "blockSize",
|
|
363
|
+
"tags": [],
|
|
364
|
+
"docs": "`azure-blocks` only: the size of every block but the last, in bytes.\nDefault 8 MiB, at most 4000 MiB, and at most 50,000 blocks.",
|
|
365
|
+
"complexTypes": [],
|
|
366
|
+
"type": "number | undefined"
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "DownloadOptions",
|
|
372
|
+
"slug": "downloadoptions",
|
|
373
|
+
"docs": "",
|
|
374
|
+
"tags": [],
|
|
375
|
+
"methods": [],
|
|
376
|
+
"properties": [
|
|
377
|
+
{
|
|
378
|
+
"name": "url",
|
|
379
|
+
"tags": [],
|
|
380
|
+
"docs": "The URL to fetch, already resolved (a Storage download URL carries its\nown token). Bytes go to `<path>.part` and the file is renamed to `path`\nonly once every byte has landed.",
|
|
381
|
+
"complexTypes": [],
|
|
382
|
+
"type": "string"
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"name": "PluginListenerHandle",
|
|
388
|
+
"slug": "pluginlistenerhandle",
|
|
389
|
+
"docs": "",
|
|
390
|
+
"tags": [],
|
|
391
|
+
"methods": [],
|
|
392
|
+
"properties": [
|
|
393
|
+
{
|
|
394
|
+
"name": "remove",
|
|
395
|
+
"tags": [],
|
|
396
|
+
"docs": "",
|
|
397
|
+
"complexTypes": [],
|
|
398
|
+
"type": "() => Promise<void>"
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
],
|
|
403
|
+
"enums": [],
|
|
404
|
+
"typeAliases": [
|
|
405
|
+
{
|
|
406
|
+
"name": "TransferDirection",
|
|
407
|
+
"slug": "transferdirection",
|
|
408
|
+
"docs": "Which way a transfer moves bytes.",
|
|
409
|
+
"types": [
|
|
410
|
+
{
|
|
411
|
+
"text": "'upload'",
|
|
412
|
+
"complexTypes": []
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"text": "'download'",
|
|
416
|
+
"complexTypes": []
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"name": "TransferState",
|
|
422
|
+
"slug": "transferstate",
|
|
423
|
+
"docs": "Where a transfer is.\n\n- `queued`: waiting its turn (one transfer runs per direction), or waiting\n for the network on Android 14+, where the system restarts it.\n- `running`: bytes are moving.\n- `interrupted`: stopped by a network drop, the app being swiped away or\n the system, and won't restart by itself. Start it again with the same\n `id` and it carries on from where it stopped.\n- `finished`: every byte landed. For a download the file is at `path`.\n- `failed`: it can't finish as asked; `reason` says why. Its temporary\n files are gone.\n- `cancelled`: `cancel()` was called. Its temporary files are gone.",
|
|
424
|
+
"types": [
|
|
425
|
+
{
|
|
426
|
+
"text": "'queued'",
|
|
427
|
+
"complexTypes": []
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"text": "'running'",
|
|
431
|
+
"complexTypes": []
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"text": "'interrupted'",
|
|
435
|
+
"complexTypes": []
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"text": "'finished'",
|
|
439
|
+
"complexTypes": []
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"text": "'failed'",
|
|
443
|
+
"complexTypes": []
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"text": "'cancelled'",
|
|
447
|
+
"complexTypes": []
|
|
448
|
+
}
|
|
449
|
+
]
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "UploadProtocol",
|
|
453
|
+
"slug": "uploadprotocol",
|
|
454
|
+
"docs": "The upload protocol a transfer speaks. The plugin never signs anything: you\ncreate the upload on the server and hand the plugin URLs that carry their\nown authorisation (a session URL, presigned URLs, a SAS URL).\n\n- `firebase-resumable`: a Firebase Storage resumable upload (the\n `X-Goog-Upload-*` protocol: `POST` with `X-Goog-Upload-Command` `query`,\n `upload` and `upload, finalize`). `url` is the session URL.\n- `put`: the whole file in one `PUT` to `url`, e.g. an S3 presigned `PUT`\n URL or an Azure blob SAS URL (pass `x-ms-blob-type: BlockBlob` in\n `headers` for Azure). An interrupted upload starts again from the first\n byte. S3 takes at most 5 GB in one `PUT`.\n- `s3-multipart`: an S3 (or S3-compatible) multipart upload you have\n created. `partUrls` are the presigned `UploadPart` URLs, part 1 first;\n `url` is the presigned `CompleteMultipartUpload` URL. The plugin sends the\n parts one at a time, keeps each `ETag`, skips the parts already stored when\n it resumes, then completes the upload listing every part.\n- `azure-blocks`: an Azure block blob. `url` is the blob's SAS URL with\n write permission (`sp` including `w`, or `c` and `w`). The plugin sends\n blocks with stable ids (`Put Block`), skips the ones in the blob's\n uncommitted block list when it resumes, then commits them\n (`Put Block List`).",
|
|
455
|
+
"types": [
|
|
456
|
+
{
|
|
457
|
+
"text": "'firebase-resumable'",
|
|
458
|
+
"complexTypes": []
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"text": "'put'",
|
|
462
|
+
"complexTypes": []
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"text": "'s3-multipart'",
|
|
466
|
+
"complexTypes": []
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"text": "'azure-blocks'",
|
|
470
|
+
"complexTypes": []
|
|
471
|
+
}
|
|
472
|
+
]
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "TransferFailureReason",
|
|
476
|
+
"slug": "transferfailurereason",
|
|
477
|
+
"docs": "Why a transfer stopped without finishing.\n\n- `file-missing`: the upload's file isn't there (or is a directory).\n- `disk-full`: no space for a download, or for the remainder copy an\n iPhone upload needs to resume part-way.\n- `session-refused`: the server refused the request (HTTP 4xx other than\n the two below), e.g. Firebase Storage security rules refused the upload at finalize (403), or\n a presigned URL or SAS token expired or lacks a permission (403). `message` names the\n request that was refused (a part, a block, the `PUT`, or the commit).\n- `session-expired`: the upload session or download URL is gone (HTTP 404\n or 410), e.g. an S3 multipart upload that was aborted, found out while\n sending a part or asking ListParts. Start a new session. (An S3 upload\n found gone only at the completion reports `session-closed`: it may have\n been completed.)\n- `session-closed`: the upload can't be confirmed from here. For `firebase-resumable`, the\n session was already closed when the upload started; that isn't proof the object was accepted\n (the Firebase Storage emulator closes a session whose finalize its security rules refused).\n For `s3-multipart` and `azure-blocks`, the request that completes the object was sent in an\n earlier run (or earlier in this one) and its answer never came, so it may or may not have\n been applied. Either way, check the object on the server, and start a new upload if it\n isn't there or is the wrong size.\n- `size-mismatch`: the bytes that landed don't add up to the size the\n server or file said.\n- `network`: the connection dropped. Used with `interrupted`.\n- `stopped-by-system`: the system ended the work (the app was swiped away\n on iPhone, the work was stopped below Android 14). Used with\n `interrupted`.\n- `cancelled`: `cancel()` was called.\n- `server-error`: the server kept answering 5xx.\n- `unknown`: anything else; `message` has the detail.",
|
|
478
|
+
"types": [
|
|
479
|
+
{
|
|
480
|
+
"text": "'file-missing'",
|
|
481
|
+
"complexTypes": []
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"text": "'disk-full'",
|
|
485
|
+
"complexTypes": []
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"text": "'session-refused'",
|
|
489
|
+
"complexTypes": []
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"text": "'session-expired'",
|
|
493
|
+
"complexTypes": []
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"text": "'session-closed'",
|
|
497
|
+
"complexTypes": []
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"text": "'size-mismatch'",
|
|
501
|
+
"complexTypes": []
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"text": "'network'",
|
|
505
|
+
"complexTypes": []
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"text": "'stopped-by-system'",
|
|
509
|
+
"complexTypes": []
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"text": "'cancelled'",
|
|
513
|
+
"complexTypes": []
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"text": "'server-error'",
|
|
517
|
+
"complexTypes": []
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"text": "'unknown'",
|
|
521
|
+
"complexTypes": []
|
|
522
|
+
}
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
],
|
|
526
|
+
"pluginConfigs": []
|
|
527
|
+
}
|