ReviseOperation
Revise operation accepted by client.commit.apply. Replaces the shape-validated
data on an existing shape, thing, or assertion and creates a new version.
data is a full replacement, not a patch — include every shape field, not
just the ones that changed. Revise cannot deactivate a target: the active
field is declared never at the type level, so passing active: false is
a compile error. Use a RetractOperation to mark an entity inactive.
https://docs.warmhub.ai/writes/operations/#revise-operations
Properties
Section titled “Properties”operation?
Section titled “operation?”
optionaloperation?:"revise"
Operation discriminator. Set revise explicitly — an omitted discriminator
normalizes as add, not revise. (Supplying expectedVersion without
operation: 'revise' throws rather than silently dropping the precondition.)
optionalkind?:"shape"|"thing"|"assertion"|"collection"
Optional kind safety hint: shape, thing, assertion, or collection.
optionalname?:string
Target name to revise. Equivalent to wref for local paths.
optionalwref?:string
Target wref to revise. Cross-repo references use wh:org/repo/Shape/name.
optionaldata?:unknown
New shape-validated data payload.
expectedVersion?
Section titled “expectedVersion?”
optionalexpectedVersion?:number
Optional optimistic-concurrency precondition. When supplied, the revise is
applied only if the target is still at this version number. A stale value
produces a CONFLICT error with details.reason = 'expected_version_mismatch'.
Absent field preserves today’s behavior exactly (opt-in).
active?
Section titled “active?”
optionalactive?:undefined
Type-level guard: revise cannot toggle activity. The field is declared
never so passing active: true or active: false is a TypeScript error.
To mark an entity inactive, use a RetractOperation instead.
leaseId?
Section titled “leaseId?”
optionalleaseId?:string
Optional read-lease token (#3625) returned by thing.getWithLease. A
matching token auto-releases the lease on commit; a mismatch (or absence
against a live lease) is rejected with LEASE_UNAVAILABLE.
Hit a problem or have a question? Get in touch.