diff --git a/README.md b/README.md index 68eb009..5d2a517 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,7 @@ Communication package for javascript. $ npm i @eryxcoop/appyx-comm ``` -# Contribute +## Contribute In order to update npm package a new release must be created. Any new release must be named -@eryxcoop/appyx-comm-{version} - -# Work to be done - -- [x] Deploy library as a package in npm -- [ ] Complete documentation -- [x] Add ApiClient -- [x] Add tests +@eryxcoop/appyx-comm-{version} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 95473a9..a890447 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,9 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ -"sphinx_rtd_theme", + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx_mdinclude", ] @@ -26,7 +28,23 @@ # html_theme = "sphinx_rtd_theme" # -- Options for HTML output ------------------------------------------------- + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "alabaster" +html_theme_options = { + "description": "...", + "fixed_sidebar": True, + "badge_branch": "main", + "github_button": False, + "github_user": "eryxcoop", + "github_repo": "appyx-comm", + "show_powered_by": False, + "sidebar_collapse": False, +} # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'alabaster' html_static_path = ['_static'] diff --git a/docs/api.rst b/docs/guide.rst similarity index 77% rename from docs/api.rst rename to docs/guide.rst index db5677b..12d10ab 100644 --- a/docs/api.rst +++ b/docs/guide.rst @@ -1,14 +1,46 @@ +``ApiClient`` +------------- + +wip + ``Requesters`` ------------- -Information about the requesters. +wip ``Endpoints`` ------------- -Information about endpoints. +When you create and ``Endpoint`` you are defining where the request should be made, what type of request is it and what kind of responses should you expect. +Your ApiClient will be able to execute the endpoint you created. +For example, you can create an endpoint like this: + +.. code-block:: javascript + :linenos: + + class ExampleEndpoint extends Endpoint{ + url() { + return "example_url"; + } + + ownResponses() { + return [GetExampleResponse]; + } + + method() { + return this.constructor.getMethod(); + } + + needsAuthorization() { + return true; + } + } + + // Now you can use it like this + const endpointToExample = new ExampleEndpoint(); + const response = await client._callEndpoint(endpointToExample); ``Responses`` ------------- diff --git a/docs/index.rst b/docs/index.rst index a77049c..9ed3a3c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,24 +1,16 @@ -appyx-comm -========= - -.. image:: https://github.com/github/docs/actions/workflows/test.yml/badge.svg - :alt: GitHub Actions - CI - - -.. image:: https://badge.fury.io/js/@eryxcoop%2Fappyx-comm.svg - :target: https://badge.fury.io/js/@eryxcoop%2Fappyx-comm +.. mdinclude:: ../README.md Appy-Comm ----- -Appy-Comm is a library to help you to communicate with Appyx, but also if your are not using it! Now you request are simpler and responses can be handled easily. +Appy-Comm is a library to help you to communicate with Appyx, but also if your are not using it! Now your requests are simpler and responses can be handled easily. .. toctree:: - :maxdepth: 2 - :caption: Usage + :hidden: + :maxdepth: 2 - api + guide .. toctree::