Skip to main content

Module draft_api

Module draft_api 

Source

Enums§

DeleteDraftForUserError
struct for typed errors of method delete_draft_for_user
GetDraftForUserError
struct for typed errors of method get_draft_for_user
GetOwnDraftError
struct for typed errors of method get_own_draft
ListDraftsError
struct for typed errors of method list_drafts
MigrateLegacyDraftError
struct for typed errors of method migrate_legacy_draft
MoveDraftError
struct for typed errors of method move_draft
TransferDraftsError
struct for typed errors of method transfer_drafts
UpdateDraftError
struct for typed errors of method update_draft

Functions§

delete_draft_for_user
Delete the draft a given user holds at a path, or, without username, every draft at that path (the legacy ownerless one and the caller’s own included). Workspace admins / superadmins only, and only for script, flow, app and raw_app drafts. Unlike a discard of one’s own draft through drafts/update, this returns 404 when nothing was deleted.
get_draft_for_user
get_own_draft
list_drafts
migrate_legacy_draft
Delete a legacy draft (email NULL) or assign it to the authed admin as a per-user draft. Workspace admins / superadmins only.
move_draft
Relocates the authed user’s own draft row, along with both path keys inside its value (the typed path and the mirror the editors keep beside it). Only for draft-only items — a deployed item must be moved through its own deploy endpoint, which carries every draft with it. Restricted to script, flow, app and raw_app; any other kind is rejected with 400, because only these keep their deploy target where this endpoint rewrites it.
transfer_drafts
In one transaction, copies the authed user’s own drafts of items into target_workspace (another workspace of this one’s family, with the same root through parent_workspace_id) and, with remove_from_source, deletes them here. Without target_workspace it only removes. If the user already has a draft of any item in the target, nothing is written and the items are returned in conflicts, unless replace_existing is set. A user who can only compose flows or apps in the target is held to the same rules as a direct draft save there.
update_draft