// IDL file for flatbufer repo data. Flatbuffers can be used for storage and as
// a wire protocol, so they're defined in the repo "interface package"
// currently only Refstore info is defined here. We may choose to add other
// repo data structures here in the future.
namespace repo_fbs;

// Datasetref is a reference to a dataset
table DatasetRef {
  // peer that owns a dataset
  peername: string;
  // immutable identifier for this user
  profileID: string;
  // name of the dataset
  name: string;
  // immutable dataset path. usually /ipfs/Qm...
  path: string;
  // path to linked dataset directory on the local filesystem
  fsiPath: string;
  // weather or not this dataset is publically listed
  published: bool;
}

// flatbuffers don't (currently) support using a vector as a root type
// in an ideal world we'd just `root_type [DatasetRef]`. On the upside if we
// ever needed to track state scoped to a list of references, we can add fields
// here to do so
// issue: https://github.com/google/flatbuffers/issues/4854
table Reflist {
	refs:[DatasetRef];
}

// setting file_identifier adds a "magic number" to bytes 4-7 to use as a
// sanity check for a "Qri FlatBuffer File". As our use of flatbuffers grows
// this file identifier should remain as the top level identifier for all
// qri flatbuffer schemas
file_identifier "QFBF";

// for our use this is mainly an annotation. this file extension for a 
// "qri flatbuffer" file should be .qfb
file_extension "qfb";

root_type Reflist;