package hockmd

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The first version of the protocol is described here. However, it is not exactly clear in the document which field are optional and which are not optional. So, until a solid testing has been done, the API will be subject to changes.

The module Types contains all types, bith for requests and responses.

Other values of this module straightforwardly corresponds to a method of the protocol.

type user_id

Type for the users id

type team_id

Type for the teams id

type user_path

Another way to reference users, used by some functions

type team_path

Another way to reference teams, used by some functions

type team = {
  1. id : team_id;
  2. ownerId : user_id;
  3. path : team_path;
  4. name : string;
  5. description : string;
  6. visibility : string;
  7. createdAt : int;
}

The type for teams

type user = {
  1. id : user_id;
  2. name : string;
  3. email : string option;
  4. userPath : string;
  5. photo : string;
  6. teams : team list;
}

The type for users

type note_id
type publish_type = string

How the published document open, for instance "view". Will change shortly to a variant type.

type rw_permission =
  1. | Owner
  2. | Signed_in
  3. | Guest

Used to designate who can read, or who can write.

type comment_permission =
  1. | Disabled
  2. | Forbidden
  3. | Owners
  4. | Signed_in_users
  5. | Everyone

Used to specify comment permission.

type change_user = {
  1. name : string;
  2. photo : string;
  3. biography : string option;
  4. userPath : user_path;
}

Fewer information on a user, used on some fields such as note and note_summary .

type note_summary = {
  1. id : note_id;
  2. title : string;
  3. tags : string list;
  4. createdAt : int;
  5. publishType : publish_type;
  6. publishedAt : int option;
  7. shortId : string;
  8. lastChangedAt : int;
  9. lastChangeUser : change_user option;
  10. userPath : user_path;
  11. teamPath : team_path option;
  12. readPermission : rw_permission;
  13. writePermission : rw_permission;
}

Information on a note, without including the content. Used when querying the list of notes.

type note = {
  1. id : note_id;
  2. title : string;
  3. tags : string list;
  4. createdAt : int;
  5. publishType : publish_type;
  6. publishedAt : int option;
  7. shortId : string;
  8. content : string;
  9. lastChangedAt : int;
  10. lastChangeUser : change_user option;
  11. userPath : user_path;
  12. teamPath : team_path option;
  13. readPermission : rw_permission;
  14. writePermission : rw_permission;
}

All information on a note, including its content.

type new_note = {
  1. title : string;
  2. content : string;
  3. readPermission : rw_permission;
  4. writePermission : rw_permission;
  5. commentPermission : comment_permission;
}

Type used to create a new note, see create_note.

type update_note = {
  1. content : string;
  2. readPermission : rw_permission;
}

Type used to update a note, see update_note.