Skip to content

Latest commit

 

History

History
300 lines (274 loc) · 6.45 KB

File metadata and controls

300 lines (274 loc) · 6.45 KB
title trackChanges.decide
sidebarTitle trackChanges.decide
description Accept or reject tracked changes by ID, range, or scope: all (optionally filtered by story).

{/* GENERATED FILE: DO NOT EDIT. Regenerate via pnpm run docapi:sync. */}

Summary

Accept or reject tracked changes by ID, range, or scope: all (optionally filtered by story).

  • Operation ID: trackChanges.decide
  • API member path: editor.doc.trackChanges.decide(...)
  • Mutates document: yes
  • Idempotency: conditional
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a Receipt confirming the decision was applied; reports NO_OP if the change was already resolved and typed failures for unsupported or denied tracked-change decisions.

Input fields

Field Type Required Description
decision enum yes "accept", "reject"
target object | object(kind="range") | object yes One of: object, object(kind="range"), object

Example request

{
  "decision": "accept",
  "target": {
    "id": "id-001",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  }
}

Output fields

Variant 1 (success=true)

Field Type Required Description
inserted EntityAddress[] no
removed EntityAddress[] no
success true yes Constant: true
updated EntityAddress[] no

Variant 2 (success=false)

Field Type Required Description
failure object yes
failure.code enum yes "NO_OP", "INVALID_TARGET", "TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE", "PERMISSION_DENIED", "PRECONDITION_FAILED", "COMMENT_CASCADE_PARTIAL"
failure.details any no
failure.message string yes
success false yes Constant: false

Example response

{
  "inserted": [
    {
      "entityId": "entity-789",
      "entityType": "comment",
      "kind": "entity"
    }
  ],
  "success": true,
  "updated": [
    {
      "entityId": "entity-789",
      "entityType": "comment",
      "kind": "entity"
    }
  ]
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_INPUT
  • INVALID_TARGET

Non-applied failure codes

  • NO_OP
  • INVALID_TARGET
  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • PERMISSION_DENIED
  • PRECONDITION_FAILED
  • COMMENT_CASCADE_PARTIAL

Raw schemas

```json { "additionalProperties": false, "properties": { "decision": { "enum": [ "accept", "reject" ] }, "target": { "oneOf": [ { "additionalProperties": false, "properties": { "id": { "type": "string" }, "range": { "description": "Partial-range qualifier on an id target. Rejected with INVALID_INPUT for indivisible (e.g. structural) revisions.", "type": "object" }, "story": { "$ref": "#/$defs/StoryLocator" } }, "required": [ "id" ], "type": "object" }, { "additionalProperties": false, "properties": { "kind": { "const": "range" }, "part": { "description": "Optional part discriminator for the range target.", "type": "string" }, "range": { "$ref": "#/$defs/TextTarget" }, "story": { "$ref": "#/$defs/StoryLocator" } }, "required": [ "kind", "range" ], "type": "object" }, { "additionalProperties": false, "properties": { "scope": { "enum": [ "all" ] }, "story": { "description": "Optional explicit bulk filter. Omit or pass 'all' to target every revision-capable story, or pass a StoryLocator to scope the decision to one story.", "oneOf": [ { "$ref": "#/$defs/StoryLocator" }, { "const": "all" } ] } }, "required": [ "scope" ], "type": "object" } ] } }, "required": [ "decision", "target" ], "type": "object" } ``` ```json { "oneOf": [ { "$ref": "#/$defs/ReceiptSuccess" }, { "additionalProperties": false, "properties": { "failure": { "additionalProperties": false, "properties": { "code": { "enum": [ "NO_OP", "INVALID_TARGET", "TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE", "PERMISSION_DENIED", "PRECONDITION_FAILED", "COMMENT_CASCADE_PARTIAL" ] }, "details": {}, "message": { "type": "string" } }, "required": [ "code", "message" ], "type": "object" }, "success": { "const": false } }, "required": [ "success", "failure" ], "type": "object" } ] } ``` ```json { "$ref": "#/$defs/ReceiptSuccess" } ``` ```json { "additionalProperties": false, "properties": { "failure": { "additionalProperties": false, "properties": { "code": { "enum": [ "NO_OP", "INVALID_TARGET", "TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE", "PERMISSION_DENIED", "PRECONDITION_FAILED", "COMMENT_CASCADE_PARTIAL" ] }, "details": {}, "message": { "type": "string" } }, "required": [ "code", "message" ], "type": "object" }, "success": { "const": false } }, "required": [ "success", "failure" ], "type": "object" } ```