digraph konnectors {
	graph [rankdir="LR", splines=true];
	node [fontname="lato", color="#2E3440", fontcolor="#2E3440", fillcolor="#E5E9F0:#ECEFF4", style="filled", gradientangle=90];
	edge [color="#2E3440"];

	trigger [label="Trigger |<id> _id: [id] | worker: konnector | type: @cron | arguments: 0 31 0 * * 1 | { message | {<f_id> folder_to_save: [id] |<a_id> account: [id] |<k_slug> konnector: [slug] }}", shape="record"];
	permissions [label="Permission |<id> id: [id] |<source_id> source_id: [id] |{ permissions | {<f_id> saveFolder: [id] | ... }}", shape="record"];
	konnector [label="Konnector |<id> _id: io.cozy.konnectors/[slug] |<slug> slug: [slug] | ...", shape="record"];
	account [label="Account |<id> _id: [id] | { auth | { login: [string] | password: [string ]}} |<f_path> defaultFolderPath: [string] |<k_slug> account_type: [slug]", shape="record"];
	folder [label="Folder |<id> _id: [id] | type: directory |<path> path: [string] | {referenced_by: |<ref> [type] [id]}", shape="record"];

	trigger:k_slug -> konnector:slug;
	trigger:a_id -> account:id;
	trigger:f_id -> folder:id;
	konnector:id -> permissions:source_id;
	permissions:f_id -> folder:id;
	account:k_slug -> konnector:slug;
	account:f_path -> folder:path [style="dashed"];
	folder:ref -> konnector:id;
}
