Let a connector sync your own items

Let a two-way connector read, change and delete the items you made yourself on the type its records land as.

When you map a connector's records onto a type you already use, such as core.task, the connector reaches only the items it brought there. owner_items lets it reach your own items of that type too, existing ones included, as it reaches its own. It reads, writes, deletes and purges them, so edits and deletions made at the service reach them. It's off until you turn it on. The command needs connectors.manage.

Your own items are those no connector brought: what you, an app, a key or an import wrote. An item another connector brought stays closed to this one, even after that connector's plugin is removed.

Turn it on

The choice is offered only on a kind whose direction is both, one that carries changes back to the service. marfa plugins mapping show prints it on such a kind. Set it in the mapping file, with the target_type it applies to:

mapping.yaml
version: 1
kinds:
  task:
    target_type: core.task
    owner_items: true
marfa plugins mapping set todoist mapping.yaml

What the connector then does with your items, sending them to the service included, is on its page, under "What goes back".

What stays the same

  • New items stay the connector's. It creates items only under its own source. It can't move one of your items to a type where the choice doesn't open it.
  • Each connector decides by its own mapping. Where several share a type, each reaches your items only if you turned the choice on for it.
  • A rewrite moves only what the connector brought, never your own items (Move a connector's records).
  • An archive carries the choice, and a restore leaves it out of a kind that is no longer two-way.

Turn it off

Save the mapping with owner_items: false, or without owner_items: a save that leaves it out turns it off. Turning the kind off, or moving it to another type, also ends the reach. The connector can't reach your items from then on. The items stay as they are.

When a save is refused

Marfa refuses owner_items with 400 validation_error, naming kinds.<kind>.owner_items, on a kind that isn't two-way, and on a kind whose target_type is one of the connector's own types, such as todoist.task. The connector's own types are its to write already.

The rules are in the plugins chapter of the contract.

On this page