Skip to content

Commit

Permalink
add parameter table to API calls
Browse files Browse the repository at this point in the history
Signed-off-by: Gerard Hickey <[email protected]>
  • Loading branch information
hickey committed Dec 9, 2023
1 parent db6e843 commit c431689
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
83 changes: 83 additions & 0 deletions meshchat
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ end

--- Returns a JSON document with basic node configuration.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `config` |
--
-- ## API Response
--
-- @example
-- {
-- "version": "meshchat_version",
Expand All @@ -107,6 +114,28 @@ end

--- Send a message to the MeshChat instance.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `send_message` |
-- | message | yes | Message body |
-- | call_sign | yes | Call sign of the sender |
-- | channel | no | Channel name to post message |
-- | epoch | no | Timestamp specified as unixtime |
--
-- @note message
-- Needs to have newslines and double quotes escaped.
--
-- @note channel
-- If not specified or set to empty string will post message to
-- `Everything` channel
--
-- @note epoch
-- If not specified, the current time on the MeshChat server will
-- be used.
--
-- ## API Response
--
-- On a successful entry of the message into the database a success JSON
-- document will be returned.
--
Expand Down Expand Up @@ -148,6 +177,16 @@ end

--- Return a list of message stored on the MeshChat instance.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `messages` |
-- | call_sign | no | Call sign of the requester |
-- | epoch | no | Timestamp specified as unixtime |
-- | id | no | Generated MeshChat ID |
--
-- ## API Response
--
-- @example
-- {
-- "id": "id_str",
Expand Down Expand Up @@ -239,6 +278,13 @@ end

--- Return a JSON document describing the sync status.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `sync_status` |
--
-- ## API Response
--
-- @example
-- {
-- "node": "node_name",
Expand Down Expand Up @@ -355,6 +401,13 @@ end

--- Return a JSON document describing the logged in users.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `users` |
--
-- ## API Response
--
-- @example
-- {
-- "id": "id_str",
Expand Down Expand Up @@ -440,6 +493,14 @@ end

--- Return a specified file as a download.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `file_download` |
-- | file | yes | Name of file to downlaod |
--
-- ## API Response
--
-- Returns a page as an octet-stream that is tagged as an attachment
-- to cause the browser to receive the file as a download.
--
Expand Down Expand Up @@ -472,6 +533,13 @@ end

--- Return a JSON document describing the list of files.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `files` |
--
-- ## API Response
--
-- @example
-- {
-- "file": "filename",
Expand Down Expand Up @@ -595,6 +663,13 @@ end

--- Return a JSON document describing all the hosts.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `hosts` |
--
-- ## API Response
--
-- @example
-- {
-- "ip": "ip_address",
Expand Down Expand Up @@ -713,6 +788,14 @@ end

--- Return a list of nodes running MeshChat as text.
--
-- ## API Parameters
-- | Parameter | Required | Description |
-- |-----------|----------|------------------------------------------|
-- | action | yes | Must be set to `meshchat_nodes` |
-- | zone_name | yes | MeshChat zone name |
--
-- ## API Response
--
-- The list of nodes and ports seperated by a tab.

-- @example
Expand Down
2 changes: 1 addition & 1 deletion meshchatconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
--]]

--- @module meshchatconfig
-- @section Configuration
-- @section MeshChat Configuration

--- Base directory to store all MeshChat generated files
-- @type string
Expand Down

0 comments on commit c431689

Please sign in to comment.