Skip to content

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

optional operation?: "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.)


optional kind?: "shape" | "thing" | "assertion" | "collection"

Optional kind safety hint: shape, thing, assertion, or collection.


optional name?: string

Target name to revise. Equivalent to wref for local paths.


optional wref?: string

Target wref to revise. Cross-repo references use wh:org/repo/Shape/name.


optional data?: unknown

New shape-validated data payload.


optional expectedVersion?: 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).


optional active?: 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.


optional leaseId?: 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.