-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added updated http api, some refactoring and other updates
- Loading branch information
Showing
64 changed files
with
2,062 additions
and
992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-favicon | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /favicon.ico /:wikiName/favicon.ico | ||
response: The contents of the tiddler `$:/favicon.ico` as a base64 encoded string | ||
parameters: | ||
description: load a wikis favicon | ||
|
||
Sends the favicon for the wiki `:wikiName`, the rouse `/favicon.ico` returns | ||
the favicon for the root wiki. If `:wikiName` has any `/` characters they are | ||
preserved in the path. | ||
|
||
Example Routes: | ||
|
||
* `/favicon.ico` | ||
* `/Wiki/Name/favicon.ico` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/fetch-list | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/fetch/list | ||
response: A JSON object containing a list of tiddler titles and optionally additional fields from the tiddlers | ||
parameters: `wiki` `filter` `fields` | ||
description: fetch a list of tiddler titles from a wiki using a filter | ||
|
||
Requests a list of tiddler titles selected using a filter evaluated in a named | ||
wiki. | ||
|
||
The url parameters are: | ||
|
||
* `wiki` is the name of the wiki to fetch titles from, it must be url encoded if it has spaces or `/` characters | ||
* `filter` is the filter to run in the target wiki | ||
* `fields` is a comma separated list of fields that are returned in the `info` part of the returned object. Defaults to `modified` | ||
|
||
The returned JSON object has the form: | ||
|
||
``` | ||
{ | ||
list: [tiddler1, tiddler2], | ||
info: { | ||
tiddler1: { | ||
field1: "field value", | ||
field2: "field2 value" | ||
}, | ||
tiddler2: { | ||
field1: "other field value", | ||
field2: "other field2 value" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Examples: | ||
|
||
* `/api/fetch/list?wiki=SomeWiki&filter=[tag[foo]]` | ||
* `/api/fetch/list?wiki=SomeOtherWiki&filter=[tag[bar]]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/fetch-plugin | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/fetch/plugins/:plugin | ||
response: The plugin tiddler as JSON | ||
parameters: | ||
description: fetch a plugin from the server | ||
|
||
The requested plugin is returned as JSON. | ||
To use this route the `pluginLibrary` key in the `API` section of the settings | ||
must be set to `yes`. | ||
|
||
The `:plugin` part of the path should be in the from `Author/PluginName`. | ||
|
||
Example: | ||
|
||
* `/api/fetch/plugins/OokTech/Bob` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-fetch-tiddler-html | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/fetch/tiddler/html | ||
response: The rendered html of the requested tiddler | ||
parameters: `wiki` `tiddler` | ||
description: get the rendered html of a tiddler | ||
|
||
Get the rendered html version of a tiddler. | ||
|
||
Example: | ||
|
||
* `/api/fetch/tiddler/html?wiki=SomeWiki&tiddler=tiddlerTitle` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-fetch-tiddlers | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/fetch | ||
response: Tiddlers in JSON format | ||
parameters: `wiki` `filter` `tiddler` | ||
description: fetch tiddlers from the server | ||
|
||
Return a tiddler by title, or a set of tiddlers using a filter, from the named | ||
wiki. | ||
|
||
If both `filter` and `tiddler` are present the filter is used and the tiddler | ||
title is ignored. | ||
|
||
Parameters: | ||
|
||
* `wiki` the wiki to fetch the tiddlers from | ||
* `filter` the filter to evaluate in the wiki to select tiddlers to fetch | ||
* `tiddler` the title of a single tiddler to return | ||
|
||
Examples: | ||
|
||
* `/api/fetch?wiki=someWiki&filter=[tag[foo]]` | ||
* `/api/fetch?wiki=someOtherWiki&tiddler=tiddlerTitle` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-files | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /files/:filename /:wikiName/files/:filename | ||
response: The named file in binary format | ||
parameters: | ||
description: load a media file from the server | ||
|
||
If the `/files/:filename` path is used the files are taken from the globally | ||
available files in the folder given by the file path root. | ||
If the `/:wikiName/files/:filename` path is used the files are taken from the | ||
`files` folder specific to the wiki `:wikiName`. | ||
|
||
If the `perWikiFiles` setting is set to `yes` wiki specific files are only | ||
available in the wiki associated with them. | ||
|
||
Examples: | ||
|
||
* `/files/foo.jpg` | ||
* `/someWiki/files/bar.png` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-list-files | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/list/files /api/list/files/path/:prefix /api/list/files/wiki/:wikiname | ||
response: JSON object with a list of globally available files | ||
parameters: | ||
description: get a list of available files on the server | ||
|
||
Using the `/api/list/files/` path the list of files returned is from the folder | ||
listed as the `filePathRoot`. | ||
|
||
Using the `/api/list/files/path/:prefix` path returns the list of files served | ||
using the prefix `:prefix`. | ||
|
||
Using the `/api/list/files/wiki/:wikiname` path returns the files specific to | ||
the wiki `:wikiname`. These files are in the `files` folder next to the | ||
`tiddlers` folder for the wiki. | ||
|
||
This does not list files in sub-folders. | ||
|
||
The response object is in the form: | ||
|
||
``` | ||
{ | ||
prefix: "/files/", | ||
files: ["file1.png", "file2.jpg"] | ||
} | ||
``` | ||
|
||
The value to put in the `_canonical_uri` field to access the file is the prefix | ||
appended to the front of the file name, like `/files/file1.png`. | ||
|
||
Example: | ||
|
||
* `/api/list/files` | ||
* `/api/list/files/path/foo` | ||
* `/api/list/files/wiki/someWiki` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-list-plugins | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/list/plugins | ||
response: An array of JSON objects that contain information about the available plugins | ||
parameters: | ||
description: get a list of available plugins | ||
|
||
Return a list of JSON objects that each contain metadata for an available | ||
plugin. | ||
|
||
The retuned object is in the form: | ||
|
||
``` | ||
[ | ||
{ | ||
name: "OokTec/Bob", | ||
description: "plugin description", | ||
version: "0.0.0", | ||
tiddlerName: "$:/plugins/OokTech/Bob", | ||
readme: "Readme text" | ||
}, | ||
{ | ||
name: "OokTec/Login", | ||
description: "plugin description", | ||
version: "0.0.0", | ||
tiddlerName: "$:/plugins/OokTech/Login", | ||
readme: "Readme text" | ||
} | ||
] | ||
``` | ||
|
||
Example: | ||
|
||
* `/api/list/plugins` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-list-wikis | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/list/wikis | ||
response: A JSON object containing a list of available wikis | ||
parameters: | ||
description: get a list of available wikis | ||
|
||
The returned object is in the form: | ||
|
||
``` | ||
{ | ||
wikis: ["Wiki1", "Wiki2"] | ||
} | ||
``` | ||
|
||
Example: | ||
|
||
* `/api/list/wikis` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
title: $:/plugins/OokTech/Bob/Documentation/HTTPAPI/get-status | ||
tags: [[HTTP API]] | ||
verb: GET | ||
route: /api/status | ||
response: A JSON object containing status information about the server | ||
parameters: | ||
description: get server status information | ||
|
||
The returned status is used to get sever settings in opened wikis. | ||
|
||
The fields `logged_in`, `username`, `authentication_level` and `read_only` | ||
currently have no meaning. | ||
|
||
The returned JSON object is in the form: | ||
|
||
``` | ||
{ | ||
logged_in: false, | ||
username: "", | ||
authentication_level: "Guest", | ||
tiddlywiki_version: 5.1.22, | ||
bob_version: 1.6.2, | ||
read_only: false, | ||
available_wikis: ["wiki1", "wiki2"], | ||
available_themes: ["theme1", "theme2"], | ||
available_plugins: ["OokTech/Bob", "OokTech/Login"], | ||
available_editions: ["edition1", "edition2"], | ||
available_languages: ["language1", "language2"], | ||
settings: {/* The full server settings */} | ||
} | ||
``` | ||
|
||
Example: | ||
|
||
* `/api/status` |
Oops, something went wrong.