-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from liblaber/snippets
Adding docs and a snippets example
- Loading branch information
Showing
51 changed files
with
19,110 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,3 +184,4 @@ sdk-examples/python/pics | |
sdk-examples/rest/pics | ||
llama-store.sln | ||
.mono/ | ||
docs/static/snippets/ |
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,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
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,60 @@ | ||
--- | ||
id: create-api-token | ||
title: "Create Api Token" | ||
description: "Create an API token for a user. These tokens expire after 30 minutes." | ||
sidebar_label: "Create Api Token" | ||
hide_title: true | ||
hide_table_of_contents: true | ||
api: eJzVV21vGzcM/ius8rFXx0nTNTOGounWbRk61GjdDUPOaOg72qdWJ10lnR3P8H8fKN3Z55ek2PZhWD+kZ4qiyIePSGolPM6cGNyIkflMWowTkZPLrKy8NFoMxPeW0BOghqvhNXhWgqmxgFA7sj0YFeQoyh3QXSUtAU49WXjah1Lq2pPrpTrVb3VGsDQ1FDgn8IV0cVcShJooB2+gQudAev40viALpPPKSO0dSA2+ILiqfWGs/BPZQSgIc7KADhBeEVqy0WpPJMJUZIPWdb4J5Gp4HQNNhKUvNTn/yuRLMViJzGhP2vMnVpWSWdh6+skxDCvhsoJK5K/KsmEvyfEvKlEq/vDLisRAOG+lnolElHj3hvTMF2Jw/uwiEaXU7e9ni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ykGoAgFTf3t5yHlO9aiQxeakYQCq+C74HwYtUJK1Gm82uUit7kYpUr4PdVI8amKEIXarEO1nWJXeHs36/D1ltLWnfTHcQ5uzY73ggz4hyyhMwittc0IlZmhDkpMhT3oPracSXl3lbsxBH83tyOkPJqTo5CeTpJrDBeH+weQDksP4fo9zgHKK15GurAVuyFeg3lA3EN90mtztxDNjUrqdp0/M+Rng6nvBoFYSty2nsfh+5mETFWDZ2PY3Mbk/cQb3elyf8VGieVLxwuzPJ3LYDkGko0OSljSLVxwef6H7jeutWqpvGiVlonBpDBYxvC5F0aq7jort5cpxyHePKHCtUv3fWe84iLuMl6o6p5jV6VcnjM2HnGfd/frk2rcTTnT+tFMrQ1gN6q6ap3USecJflvsWC1WqCjj5YtV6z+EtNdikGN+NEzNFKnHB3uOERIp4cuuBnWjJSEbMnzTQ6R1WH5rw/9/BMEnfwXF75B3XHnX7MN547YPPULk3OeywueIjAhRiIVKQiPNnZQmisQb4SCvWs5nFlIKJd/vcXe7m9tA== | ||
sidebar_class_name: "post api-method" | ||
info_path: API/llama-store-api | ||
custom_edit_url: null | ||
--- | ||
|
||
import ApiTabs from "@theme/ApiTabs"; | ||
import DiscriminatorTabs from "@theme/DiscriminatorTabs"; | ||
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; | ||
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; | ||
import MimeTabs from "@theme/MimeTabs"; | ||
import ParamsItem from "@theme/ParamsItem"; | ||
import ResponseSamples from "@theme/ResponseSamples"; | ||
import SchemaItem from "@theme/SchemaItem"; | ||
import SchemaTabs from "@theme/SchemaTabs"; | ||
import Markdown from "@theme/Markdown"; | ||
import OperationTabs from "@theme/OperationTabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
<h1 className={"openapi__heading"}>Create Api Token</h1> | ||
|
||
<MethodEndpoint method={"post"} path={"/token"}></MethodEndpoint> | ||
|
||
|
||
|
||
Create an API token for a user. These tokens expire after 30 minutes. | ||
|
||
Once you have this token, you need to pass it to other endpoints in the Authorization header as a Bearer token. | ||
|
||
## Request | ||
|
||
<MimeTabs className={"openapi-tabs__mime"}><TabItem label={"application/json"} value={"application/json-schema"}><details style={{}} className={"openapi-markdown__details mime"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-mime"}><h3 className={"openapi-markdown__details-summary-header-body"}>Body</h3><strong className={"openapi-schema__required"}>required</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"email"} required={true} schemaName={"Email (string)"} qualifierMessage={"**Possible values:** `>= 5 characters` and `<= 254 characters`, Value must match regular expression `.+\\@.+\\..+`"} schema={{"type":"string","maxLength":254,"minLength":5,"pattern":".+\\@.+\\..+","title":"Email","description":"The email address of the user. This must be unique across all users.","examples":["[email protected]"]}}></SchemaItem><SchemaItem collapsible={false} name={"password"} required={true} schemaName={"Password (string)"} qualifierMessage={"**Possible values:** `>= 8 characters` and `<= 254 characters`"} schema={{"type":"string","maxLength":254,"minLength":8,"title":"Password","description":"The password of the user. This must be at least 8 characters long, and contain at least one letter, one number, and one special character.","examples":["Password123!"]}}></SchemaItem></ul></details></TabItem></MimeTabs><div><div><ApiTabs label={undefined} id={undefined}><TabItem label={"201"} value={"201"}><div> | ||
|
||
A new API token for the user | ||
|
||
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"accessToken"} required={true} schemaName={"Access Token (string)"} qualifierMessage={undefined} schema={{"type":"string","title":"Access Token","description":"The bearer token to use with the API. Pass this in the Authorization header as a bearer token.","examples":["Authorization: Bearer 1234567890abcdef"]}}></SchemaItem><SchemaItem collapsible={false} name={"tokenType"} required={false} schemaName={"Token Type (string)"} qualifierMessage={undefined} schema={{"type":"string","title":"Token Type","description":"The type of token. This will always be bearer.","default":"bearer","examples":["bearer"]}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"accessToken\": \"string\",\n \"tokenType\": \"bearer\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"404"} value={"404"}><div> | ||
|
||
User not found or the password is invalid | ||
|
||
</div><div></div></TabItem><TabItem label={"422"} value={"422"}><div> | ||
|
||
Validation Error | ||
|
||
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>detail</strong><span className={"openapi-schema__name"}> object[]</span></span></summary><div style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>loc</strong><span className={"openapi-schema__name"}> object[]</span><span className={"openapi-schema__divider"}></span><span className={"openapi-schema__required"}>required</span></span></summary><div style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><div><span className={"badge badge--info"}>anyOf</span><SchemaTabs><TabItem label={"MOD1"} value={"0-item-properties"}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}> | ||
|
||
string | ||
|
||
</div></TabItem><TabItem label={"MOD2"} value={"1-item-properties"}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}> | ||
|
||
integer | ||
|
||
</div></TabItem></SchemaTabs></div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem><SchemaItem collapsible={false} name={"msg"} required={true} schemaName={"Message (string)"} qualifierMessage={undefined} schema={{"type":"string","title":"Message"}}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={true} schemaName={"Error Type (string)"} qualifierMessage={undefined} schema={{"type":"string","title":"Error Type"}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"detail\": [\n {\n \"loc\": [\n \"string\",\n 0\n ],\n \"msg\": \"string\",\n \"type\": \"string\"\n }\n ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div></div> | ||
|
Oops, something went wrong.