new DataPackageUploader(options)
Create an uploader for one data package.
Parameters:
| Name |
Type |
Description |
options |
object
|
Uploader options
Properties
| Name |
Type |
Description |
dataPackage |
object
|
Owning DataPackage instance |
|
- Source:
Throws:
-
When no data package is supplied
-
-
Type
-
Error
Methods
_prepareEagerUploadActions(members, optionsopt) → {Promise.<Array.<object>>}
Build eager actions for newly added members. A later full save aggregates
successful eager uploads.
Parameters:
| Name |
Type |
Attributes |
Description |
members |
Array.<DataPackageMember>
|
|
Members to upload eagerly |
options |
object
|
<optional>
|
Build options
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
Abort signal for checksums |
maxConcurrent |
number
|
<optional>
|
Fetch concurrency |
|
- Source:
Throws:
-
When eager upload preparation fails
-
-
Type
-
Error
Returns:
Eager upload actions
-
Type
-
Promise.<Array.<object>>
cancelEagerUpload(pid) → {boolean}
Cancel one eager upload.
Parameters:
| Name |
Type |
Description |
pid |
string
|
Member PID |
- Source:
Returns:
Whether an eager upload was found
-
Type
-
boolean
cancelUpload() → {boolean}
Cancel the active upload and stop scheduling new work. In-flight writes
are verified before settling the result; unresolved remote state requires
reloading the package.
- Source:
Returns:
Whether an upload was cancelled
-
Type
-
boolean
getPendingEagerUploads() → {Array.<object>}
Return eager upload records that are still in flight.
- Source:
Returns:
Eager upload records in flight
-
Type
-
Array.<object>
retryUpload(previousResult, optionsopt) → {Promise.<UploadResult>}
Retry a failed upload without blindly repeating committed writes.
Parameters:
| Name |
Type |
Attributes |
Description |
previousResult |
UploadResult
|
|
Previous upload result |
options |
object
|
<optional>
|
Execution options
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
Caller abort signal |
maxConcurrent |
number
|
<optional>
|
Per phase concurrency |
|
- Source:
Throws:
-
When the result is unrelated, stale, active, or unverifiable
-
-
Type
-
Error
Returns:
Retry result
-
Type
-
Promise.<UploadResult>
upload(optionsopt) → {Promise.<UploadResult>}
Prepare and execute an upload.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Upload options
Properties
| Name |
Type |
Attributes |
Description |
resourceMapOnly |
boolean
|
<optional>
|
Upload only ResourceMap work |
signal |
AbortSignal
|
<optional>
|
Caller abort signal |
maxConcurrent |
number
|
<optional>
|
Per phase concurrency |
|
- Source:
Throws:
-
When another upload is active or upload preparation fails
-
-
Type
-
Error
Returns:
Upload result
-
Type
-
Promise.<UploadResult>
uploadAddedMembers(members, optionsopt) → {Promise.<Array.<UploadResult>>}
Start eager uploads for newly added members through the same executor as
full package uploads.
Parameters:
| Name |
Type |
Attributes |
Description |
members |
Array.<DataPackageMember>
|
|
Members to upload |
options |
object
|
<optional>
|
Execution options |
- Source:
Returns:
One result per eager upload
-
Type
-
Promise.<Array.<UploadResult>>
waitForEagerUploads() → {Promise.<Array.<object>>}
Wait for all current eager uploads to settle.
- Source:
Returns:
Settled eager upload results
-
Type
-
Promise.<Array.<object>>