new UploadResult(actions, optionsopt)
Create state for one upload attempt.
Parameters:
| Name |
Type |
Attributes |
Description |
actions |
Array.<object>
|
|
Actions prepared for the upload |
options |
object
|
<optional>
|
Result context
Properties
| Name |
Type |
Attributes |
Description |
draftRevision |
number
|
<optional>
|
Prepared package revision |
dataPackage |
object
|
<optional>
|
Owning package instance |
|
- Source:
Members
preparationErrors :Map.<string, Error>
Errors for members whose upload actions could not be prepared.
Type:
- Since:
- Source:
Methods
Derive the upload outcome from action statuses.
- Source:
Returns:
This result
-
Type
-
UploadResult
getError(actionId) → {Error|null}
Return an action's error.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
- Source:
Returns:
Action error, or null
-
Type
-
Error
|
null
getErrorMessages() → {Array.<string>}
Collect per action and member level errors so callers can show the actual
failure instead of a generic "save failed" message.
- Source:
Returns:
Unique, non empty error messages
-
Type
-
Array.<string>
getStatus(actionId) → {string|null}
Return an action's status.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
- Source:
Returns:
Action status, or null
-
Type
-
string
|
null
markAmbiguous(actionId, error) → {UploadResult}
Mark an action as an ambiguous write.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
error |
Error
|
Action error |
- Source:
Returns:
This result
-
Type
-
UploadResult
markCancelled(actionId) → {UploadResult}
Mark an action as cancelled.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
- Source:
Returns:
This result
-
Type
-
UploadResult
markFailed(actionId, error) → {UploadResult}
Mark an action as failed.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
error |
Error
|
Action error |
- Source:
Returns:
This result
-
Type
-
UploadResult
markRunning(actionId) → {UploadResult}
Mark an action as running.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
- Source:
Returns:
This result
-
Type
-
UploadResult
markSkipped(actionId) → {UploadResult}
Mark an action as skipped.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
- Source:
Returns:
This result
-
Type
-
UploadResult
markStaleRemote(actionId, error) → {UploadResult}
Mark the package as stale against remote state.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
null
|
Related upload action identifier |
error |
Error
|
Stale remote error |
- Source:
Returns:
This result
-
Type
-
UploadResult
markSucceeded(actionId) → {UploadResult}
Mark an action as succeeded.
Parameters:
| Name |
Type |
Description |
actionId |
string
|
Upload action identifier |
- Source:
Returns:
This result
-
Type
-
UploadResult
setStatus(actionId, status, erroropt) → {UploadResult}
Set an action's status and optional error.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
actionId |
string
|
|
|
Upload action identifier |
status |
string
|
|
|
Action status |
error |
Error
|
null
|
<optional>
|
null
|
Action error |
- Source:
Returns:
This result
-
Type
-
UploadResult