Add swagger user docs and tools page

This commit is contained in:
David Erwin
2017-05-26 11:27:10 -04:00
parent deea24d0c5
commit 1dbecab13e
3 changed files with 39 additions and 496 deletions
+3
View File
@@ -14,6 +14,9 @@ entries:
- title: FAQ
url: /faq.html
output: web
- title: Tools
url: /tools.html
output: web
- title: Installation
output: web
-496
View File
@@ -13,502 +13,6 @@ produces:
- application/json
paths:
/comments:
get:
tags:
- Comments
parameters:
- name: action_type
in: query
description: Performs a search based on the actions that have been added to it.
type: string
enum:
- rejected
- accepted
- new
responses:
200:
description: Comments matching the query.
schema:
type: array
items:
$ref: '#/definitions/Comment'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
post:
tags:
- Comments
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
body:
type: string
description: The text of the comment to create.
asset_id:
type: string
description: The parent asset of this comment.
parent_id:
type: string
description: The parent comment of this comment (null if the comment is not a reply.)
responses:
201:
description: The comment that was created.
schema:
$ref: '#/definitions/Comment'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/comments/{comment_id}:
get:
tags:
- Comments
parameters:
- name: comment_id
in: path
description: The id of the comment to retrieve.
type: string
required: true
responses:
200:
description: The comment was found.
schema:
$ref: '#/definitions/Comment'
404:
description: The comment was not found.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
delete:
tags:
- Comments
parameters:
- name: comment_id
in: path
description: The id of the comment to delete.
type: string
required: true
responses:
204:
description: The comment was deleted.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/comments/{comment_id}/status:
put:
tags:
- Comments
- Moderation
parameters:
- name: comment_id
in: path
description: The id of the comment to retrieve.
type: string
format: uuid
required: true
- name: body
in: body
description: The status to update to.
required: true
schema:
type: object
properties:
status:
type: string
description: The status to update to.
enum:
- new
- flagged
- accepted
- rejected
responses:
204:
description: The comment status was updated.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/comments/{item_id}/actions:
post:
tags:
- Comments
- Actions
parameters:
- name: item_id
in: path
description: The id of the item which is the target of the action.
type: string
required: true
- name: body
in: body
description: The action to add.
required: true
schema:
type: object
properties:
action_type:
type: string
description: The type of action to add
enum:
- like
- flag
metadata:
type: object
description: An arbitrary object describing the action, should be consistent per action type.
responses:
201:
description: The action created.
schema:
$ref: '#/definitions/Action'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/actions/{action_id}:
delete:
tags:
- Actions
parameters:
- name: action_id
in: path
description: The id of the action to delete.
type: string
required: true
responses:
204:
description: The action was deleted.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/auth:
get:
tags:
- Auth
description: Retrieves the current authentication credentials.
responses:
200:
description: The current user.
schema:
$ref: '#/definitions/User'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
delete:
tags:
- Auth
description: Logs out the current authenticated user.
responses:
204:
description: The current user has been logged out.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/auth/local:
post:
tags:
- Auth
parameters:
- name: body
in: body
required: true
description: The login credentials.
schema:
type: object
properties:
email:
type: string
description: The email address of the current user.
password:
type: string
description: The password of the current user.
responses:
200:
description: The user has authenticated sucesfully.
schema:
$ref: '#/definitions/User'
401:
description: The authentication error.
schema:
$ref: '#/definitions/Error'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/auth/facebook:
get:
tags:
- Auth
responses:
302:
description: Redirects the user to perform external facebook authentication.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/auth/facebook/callback:
get:
tags:
- Auth
responses:
200:
description: Logs in the user after FB Auth.
schema:
$ref: '#/definitions/User'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/queue/comments/pending:
get:
tags:
- Comments
- Moderation
responses:
200:
description: The comments that are not moderated.
schema:
type: object
properties:
comments:
type: array
description: The comments that have yet to be moderated.
items:
$ref: '#/definitions/Comment'
users:
type: array
description: The users authoring these comments.
items:
$ref: '#/definitions/User'
actions:
type: array
description: The actions which have taken place on these comments.
items:
$ref: '#/definitions/Actions'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/assets:
get:
parameters:
- name: limit
in: query
type: number
format: int32
description: Limit the listing results
- name: skip
in: query
type: number
format: int32
description: Skip the listing results
- name: sort
in: query
enum:
- asc
- desc
type: string
description: Sorting method
- name: field
in: query
type: string
description: Field to sort by.
- name: filter
in: query
type: string
enum:
- open
- closed
description: Comment status to filter by.
- name: search
in: query
type: string
description: String to search by.
responses:
200:
description: Assets listed.
schema:
type: object
properties:
count:
type: number
description: Total number of assets found.
result:
type: array
items:
$ref: '#/definitions/Asset'
/assets/{asset_id}:
get:
parameters:
- name: asset_id
in: path
required: true
type: string
format: uuid
responses:
200:
description: The requested asset.
schema:
$ref: '#/definitions/Asset'
404:
description: The asset was not found.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/assets/{asset_id}/scrape:
post:
parameters:
- name: asset_id
in: path
required: true
type: string
format: uuid
responses:
201:
description: The job that was created.
schema:
$ref: '#/definitions/Job'
404:
description: The asset was not found.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/assets/{asset_id}/settings:
put:
parameters:
- name: asset_id
in: path
required: true
type: string
format: uuid
- name: body
in: body
required: true
schema:
$ref: '#/definitions/Settings'
responses:
204:
description: The asset settings were updated.
404:
description: The asset was not found.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/assets/{asset_id}/status:
put:
parameters:
- name: asset_id
required: true
in: path
type: string
format: uuid
description: The id of the asset to be updated
- name: body
in: body
required: true
schema:
type: object
properties:
closedAt:
type: number
description: The Unix timestamp when the stream will be or was previously closed.
closedMessage:
type: string
description: The message to display to users when the stream is closed.
responses:
204:
description: Status update successful.
500:
description: An error has occurred.
schema:
$ref: '#/definitions/Error'
/stream:
get:
tags:
- Actions
- Assets
- Comments
- Users
parameters:
- name: asset_url
in: query
description: The url of the asset for which to get the comment stream.
type: string
format: url
responses:
200:
description: The comment stream.
schema:
type: object
properties:
asset:
$ref: '#/definitions/Asset'
comments:
type: array
description: All comments for this asset.
items:
$ref: '#/definitions/Comment'
users:
type: array
description: All authors of comments on this asset.
items:
$ref: '#/definitions/User'
actions:
type: array
description: All actions on comments on this asset and their authors.
items:
$ref: '#/definitions/Actions'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/settings:
get:
responses:
200:
description: All global settings.
schema:
$ref: '#/definitions/Settings'
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
put:
parameters:
- name: body
in: body
required: true
description: Settings to be updated.
schema:
type: object
description: Any allowed setting and value.
responses:
204:
description: The settings were updated.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/users:
get:
parameters:
+36
View File
@@ -0,0 +1,36 @@
---
title: Tooling
keywords: homepage
sidebar: talk_sidebar
permalink: plugins-client.html
summary:
---
## Debugging
How we debug errors at Coral
### React Debugging
For debugging React
#### React Developer Tools
Another amazing tool for debugging React Applications. You can see where the props are, and much more.
[React Developer Tools Extension](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
### Redux Debugging
For debugging Redux
#### Redux Devtool Extension
Redux Devtool is an amazing debug tool. You can easily see what' happening with the state, the payloads, and more.
[Redux Devtool Chrome Extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en)
[Redux Devtool Github Repo](https://github.com/zalmoxisus/redux-devtools-extension)
### GraphQL
Talk ships with GraphiQL, a live data layer IDE. We strongly recommend using GraphiQL early and often as you work with all things queries, mutations and subscriptions!
* [Install Talk](install-source.html).
* Open http://localhost:3000/api/v1/graph/iql in your browser. (Note, your server an port may differ.)