all repos — litestore @ a218928a04d832bf5aa8542cffaaf328ef56dfbc

A minimalist nosql document store.

Started documenting custom resources.
h3rald h3rald@h3rald.com
Sat, 08 Feb 2020 13:07:33 +0100
commit

a218928a04d832bf5aa8542cffaaf328ef56dfbc

parent

bfc957ccaacd39c17cf973e6308aab93559caf01

M src/admin/js/components/navbar.jssrc/admin/js/components/navbar.js

@@ -18,16 +18,14 @@ {path: "/guide/data_model", title: caret+"Data Model"},

{path: "/guide/getting-started", title: "Getting Started"}, {path: "/guide/usage", title: "Usage"}, {path: "/guide/auth", title: "Authorization"}, + {path: "/guide/custom_resources", title: "Custom Resources"}, {path: "/guide/admin_app", title: "Administration App"}, {path: "/guide/api", title: "HTTP API Reference"}, {path: "/guide/api_info", title: caret+"info (LiteStore Information)"}, {path: "/guide/api_dir", title: caret+"dir (LiteStore Directory)"}, {path: "/guide/api_docs", title: caret+"docs (LiteStore Documents)"}, {path: "/guide/api_tags", title: caret+"tags (LiteStore Tags)"}, - {path: "/guide/api_indexes", title: caret+"indexes (LiteStore Indexes)"}, - {path: "/guide/nim-api", title: "Nim API Reference"}, - {path: "/guide/nim-api_high", title: caret+"High Level"}, - {path: "/guide/nim-api_low", title: caret+"Low Level"}, + {path: "/guide/api_custom", title: caret+"custom (LiteStore Custom Resources)"}, {path: "/guide/credits", title: "Credits"} ]; vm.taglinks = function(info){
A src/admin/md/api_custom.md

@@ -0,0 +1,3 @@

+### custom (LiteStore Custom Resources) + +TBD
M src/admin/md/architecture.mdsrc/admin/md/architecture.md

@@ -35,17 +35,35 @@

The [documents](class:kwd) table is the most important table of the data store, as it contains all the documents stored in it. The following information is stored for each document: * **docid** – The internal unique document identifier. -* **id** – The public unique document identifier, used to access the document via the HTTP API. +* **id** – The public unique document identifier, used to access the document via the HTTP API or Nim API. * **data** – The contents of the document (or their base64-encoded representation in case of binary documents). * **binary** – Whether the document is binary (1) or textual (0). * **searchable** – Whether the document is searchable (1) or not (0). Currently, textual documents are searchable and binary documents are not. * **created** – When the document was created. * **modified** – When the document was last modified. +##### system_documents Table + +The [system_documents](class:kwd) table has a structure similar to the [documents](class:kwd) table, but it is used for well-known system documents that are used to provide additional functionalities, such as authorization or custom resources. + +Unlike ordinary documents, system documents: +* cannot be accessed via the HTTP or Nim API, they can only be imported, exported, or deleted with the corresponding commands. +* are not searchable. +* cannot be tagged. + +The following information is stored for each system document: + +* **docid** – The internal unique document identifier. +* **id** – The public unique document identifier. +* **data** – The contents of the document (or their base64-encoded representation in case of binary documents). +* **binary** – Whether the document is binary (1) or textual (0). +* **created** – When the document was created. +* **modified** – When the document was last modified. + ##### tags Table The [tags](class:kwd) table is used to store the associations between tags and documents. Tags can be added by users or add automatically by the system when a document is imported into the data store. ##### searchdata Table -This table is used as full-text index for searchable documents. +This table is used as full-text index for searchable documents.
A src/admin/md/custom_resources.md

@@ -0,0 +1,7 @@

+## Custom Resources + +TBD + +### LiteStore Global Object + +TBD
M src/admin/md/overview.mdsrc/admin/md/overview.md

@@ -27,7 +27,7 @@ #### Document Tagging

You can add custom tags to documents to easily categorize them and retrieve them. Some system tags are also added automatically to identify the document content type, format and collection. -#### Enhanced Querying and Indexing of JSON documents +#### Enhanced Querying of JSON documents By leveraging the [SQLite JSON1 extension](https://www.sqlite.org/json1.html) and implementing custom query string parsing, LiteStore provides enhanced filtering, ordering, and custom field selection of JSON documents.

@@ -39,9 +39,13 @@ #### RESTful HTTP API

Every operation can be performed on the data store using a simple but powerful RESTful HTTP API, perfect for client-side, single-page applications. -#### Authorization +#### JWT-based Authorization -Optionally, you can configure per-resource authorization by validating [JWT](https://jwt.io/) tokens and checking [Oauth2 Scopes](https://oauth.net/2/scope/) +LiteStore can be configure validate [JWT](https://jwt.io/) tokens and configure access to specific resources based on specific [OAuth2 scopes](https://oauth.net/2/scope/). + +#### Custom Resources + +By leveraging the [duktape](https://duktape.org/) library, LiteStore lets you create your own custom resources coding HTTP handlers in JavaScript. #### Nim API