Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Latest commit

 

History

History
80 lines (54 loc) · 2.32 KB

index-json.md

File metadata and controls

80 lines (54 loc) · 2.32 KB

Index.json Spec

Last updated: Nov 2, 2018

Deprecated Not implemented


Deprecated, replaced by folder extensions. See #13 and #14 for discussion.


A metadata file used to describe a folder.

// /documents/index.json
{
  "title": "Documents",
  "description": "Documents, spreadsheets, presentations, etc"
}

To describe a folder, create an index.json file in the folder being described. The file's schema should match this specification.

This file differs from the dat.json file by describing the folder instead of the entire dat; therefore it may exist next to the /dat.json in the root in order to describe the root folder instead of the entire dat.

Fields

title

Optional String.

description

Optional String.

type

Optional String or Array of Strings. A list of the folder's types. Defaults to "none".

Value Description
none Has no meaning. This is the default type if nothing is specified.
protected The folder is protected from applications. Applications are not allowed to write to the folder.
objectstore The folder contains JSON object-files. Applications must request access to the files using the navigator.session API and are not allowed to create subfolders. The index.json must include a "schema" field. See Object-store Folders for more information.
keystore The folder contains public keys which are used for encryption. Applications must request access using cryptography APIs and are not allowed to write to the folder.

schema

Optional String. The URL of the schema used for the files contained in the folder.

Examples

/documents/index.json

{
  "title": "Documents",
  "description": "Documents, spreadsheets, presentations, etc"
}

/data/index.json

{
  "title": "User objects",
  "type": "protected"
}

/data/fritter-posts/index.json

{
  "title": "Fritter posts",
  "type": "objectstore",
  "schema": "dat://fritter.hashbase.io/post.schema.json"
}