proposal.applycommandsince 0.1
Applies the accepted operations of a proposal as one commit.
Request
umwelt call story.umw proposal.apply '{
"proposalId": "01a1cbd8-63fc-7ec1-aac1-c0b733797443",
"attemptId": "confession"
}'Request
const result = await client.proposalApply({
proposalId: '01a1cbd8-63fc-7ec1-aac1-c0b733797443',
attemptId: 'confession',
});Request
var result = engine.ProposalApply(new ApplyPayload
{
ProposalId = "01a1cbd8-63fc-7ec1-aac1-c0b733797443",
AttemptId = "confession",
});Response
{
"eventId": "confession",
"recordIds": ["duchess-knows"],
"transitionIds": ["01a1cbd8-6404-7983-82be-7e964ca830d4"],
"version": 14,
"warnings": []
}Payload
| Field | Type | Description |
|---|---|---|
proposalIdrequired | string | The proposal, by the id propose returned. |
attemptIdrequired | string | Makes a retry safe: the same request with the same attempt id is applied once. |
Result
| Field | Type | Description |
|---|---|---|
eventIdalways | string | The event written, with the id given or generated. |
recordIdsalways | string[] | The records written, in order. |
transitionIdsalways | string[] | The transitions written, in order. |
versionalways | integer | The version this commit received. Reads at an earlier asOfVersion do not see it. |
warnings | Warning[] | UNKNOWN_PREDICATE (open vocabulary) or SECRET_BREACH. Warnings never block a write. |
Rules
Only what was accepted. Operations without an accepted review are left out. The proposal becomes applied, or partially-applied when some were left out.
Validated like any commit. The commit is checked against the timeline as it is now, and applied atomically.
Errors
VALIDATION_FAILEDNo operation was accepted, or the commit is no longer valid.NOT_FOUNDThe proposal does not exist.INVALID_STATEThe proposal is no longer pending.VERSION_CONFLICTexpectedVersion is no longer the head of the timeline.CONFLICTThe attemptId was already used with a different request.HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.Every code is listed in Errors.
See also
Was this page helpful?