DraftChanged

  • The draft, as answered by an operation that can drop wiring the caller did not name. Only those operations answer this shape; the ones that add or edit a block answer a plain Draft, having nothing to remove.

    • Your diagram, kept as you sent it: keys we do not model — notes, embedded bricks — come back untouched. The one thing we add is isTarget: true, on any node that does not already say whether a connection may end at it.

      We read nodes and connections to check it. A diagram missing either is stored anyway and reported as breaking rules.

      Properties: 3
    • When the draft was last written. null on a bot whose draft has never been written, under the convention above for a representation that carries a stored diagram.

    • Whether this diagram differs from the one the channels run, so that reading the draft answers both what is being edited and whether it is still to be published. Same field and same answer as the bot's.

    • The wiring that was in the draft and is no longer there. Always sent, and empty when nothing was removed. Reported so that no wiring disappears without the caller being told. What removes it depends on the operation: DELETE /bots/{bot_id}/draft/blocks/{block_id} reports what went with the block, and PATCH /bots/{bot_id}/draft reports that and the connections the change set deleted by name, each one listed once.

      Properties: 2
    • A subscription tier, ordered from lowest to highest.

      values
      sandboxstarterprofessionalbusiness
    • The outcome of the last write to the draft. IS_PRESAVED is a stored diagram with no violations, HAS_ERRORS a stored diagram that broke at least one rule, IS_VALIDATED a draft deployed for testing and IS_PUBLISHED one that has been published.

      HAS_ERRORS is the one that matters: while the draft is in it, the bot cannot be published.

      values
      IS_PRESAVEDHAS_ERRORSIS_VALIDATEDIS_PUBLISHED
    • The business rules the diagram broke on the last write. Empty on a bot that has just been created, because creating a bot does not validate.

      Properties: 5