Git Product home page Git Product logo

cozy-dispers-doctypes's Introduction

Table of contents

Cozy doctypes

Technical doctypes

Remote doctypes

This repository is where the declaration of remote doctypes is done. Read more about remote doctypes in the cozy stack repository.

External doctypes

Generic model

Relationships

Relations between documents are under a relationships object at the root of the document. Relations are referenced by their names.

Each relation is an object with a data property containing either null, one reference or an array of references.

A reference is an object containing at least a _type with the name of the referenced doctype and an _id with the id of the referenced document inside its doctype.

{
  "_id": "mobydick",
  "relationships": {
    "authors": {
      "data": [{ "_id": "hermanmelville", "_type": "io.cozy.contacts" }]
    }
  }
}

Document metadata

We distinguish three levels : the data (a list of songs from a playlist), the metadata about the data (the creation date of the playlist itself), the metadata of the cozy document (the creation date of the cozy document describing the playlist).

The third level (metadata of the wrapping document) is described by an object named cozyMetadata at the root of the document.

The following keys are reserved and have special meanings:

  • doctypeVersion: Name or identifier for the version of the schema used by this document (ie: doctypeVersion: 2 for "This document conforms to io.cozy.contacts in its version 2")
  • metadataVersion: Version of the cozyMetadata
  • createdAt: Creation date of the cozy document
  • createdByApp: Slug of the app or connector which created the document
  • createdByAppVersion: Version identifier of the app
  • updatedAt: Last modification date of the cozy document
  • updatedByApps: List of objects representing the applications (slugs and versions) which modified the cozy document in its life and the last update date for each of those apps (one entry per slug, apps should just update the value)
  • sourceAccount: When the document was imported from a connector, identifier of the account in io.cozy.accounts

Note: All these attributes are optionnal and taken care by the apps modifying the document. Unless specified otherwise in the documentation of the doctype, all these attributes may not be present or may have a null value.

{
  "_id": "xxxx",
  "cozyMetadata": {
    "doctypeVersion": 4,
    "metadataVersion": 1,
    "createdAt": "xxxxx",
    "createdByApp": "xxxx",
    "createdByAppVersion": "xxxx",
    "updatedAt": "xxxxx",
    "updatedByApps": [
      {
        "slug": "xxxxx",
        "date": "xxxxx",
        "version": 3
      }
    ],
    "sourceAccount": "xxxxx"
  }
}

Date format

Date should be formatted in ISO8601 :

  • 2017-04-22T01:00:00-05:00
  • 2017-04-22T01:00:00Z
  • 2017-04-22
  • 2017-04-22 01:00

cozy-dispers-doctypes's People

Contributors

ptbrowne avatar nono avatar drazik avatar cedricmessiant avatar doubleface avatar gregorylegarec avatar y-lohse avatar moooss avatar jinroh avatar edas avatar jacquarg avatar cpatchane avatar kosssi avatar m4dz avatar lucst avatar crash-- avatar poupotte avatar tintinmar1995 avatar enguerran avatar benibur avatar carrieje avatar goldoraf avatar aenario avatar orandin avatar maximemenager avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.