2.7.3 • Published 11 months ago

inkdrop-model v2.7.3

Weekly downloads
6
License
MIT
Repository
github
Last release
11 months ago

Inkdrop Model

Inkdrop data model definitions in json-schema and TypeScript

Documentations

Human readable definitions are here.

Install

npm install inkdrop-model

Usage

TypeScript

import type { Note, Book, Tag, File } from 'inkdrop-model'

Json Schema

import { NoteSchema, BookSchema, TagSchema, FileSchema } from 'inkdrop-model'

You can validate data with json schemas. Below example uses ajv as a validator:

import { NoteSchema } from 'inkdrop-model'
import Ajv from 'ajv'
const ajv = new Ajv()
const validate = ajv.compile(NoteSchema)

const data = {
  _id: 'note:BkgOZZUJzf',
  title: 'link',
  doctype: 'markdown',
  updatedAt: 1513330812556,
  createdAt: 1513214207639,
  tags: [],
  status: 'none',
  share: 'private',
  body: 'markdown note body',
  bookId: 'book:first',
  _rev: '38-636e505958d24f9c21614d95ea03b5a1'
}
const valid = validate(data)
console.log(valid) // => true
2.7.2

12 months ago

2.7.3

11 months ago

2.7.0

2 years ago

2.7.1

2 years ago

2.6.2

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.0

4 years ago

2.4.2

4 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago