2020-11-10 14:41:56 -08:00
< template >
2020-12-11 11:37:04 -08:00
< div >
2020-11-10 14:41:56 -08:00
< h2 >
< Icon v = "laptop-code" / >
< T > api . header < / T >
< / h2 >
< section v-for ="group in groups" v-if="group.enabled" class="py-2" >
< h3 >
< Icon :v ="group.icon" / >
< T > { { group . header } } < / T >
< / h3 >
< ul >
2022-03-05 02:57:46 -08:00
< li v-for ="([method, path, queryString, notes], endpoint) in group.endpoints" class="my-3" >
2020-11-10 14:41:56 -08:00
< p >
2021-04-01 09:24:47 -07:00
< span class = "badge bg-primary text-white" > { { method } } < / span >
2020-11-10 14:41:56 -08:00
< code > { { path } } < / code >
2021-01-22 14:54:24 -08:00
< a v-for ="example in config.api.examples[endpoint]" :href="$base + example" class="badge bg-light text-dark border mx-1" target="_blank" rel="noopener" >
2020-11-10 14:41:56 -08:00
< Icon v = "cog" / >
< T > api . example < / T >
< / a >
< / p >
2022-03-05 02:57:46 -08:00
< ul v-if ="notes" class="small" >
< li v-for ="note in notes" >
< span v-html ="note" > < / span >
< / li >
< / ul >
2020-11-10 14:41:56 -08:00
< p v-if ="queryString" class="mb-0 small" >
2021-12-02 08:18:25 -08:00
< T > api . query < / T > < T > quotation . colon < / T >
2020-11-10 14:41:56 -08:00
< / p >
< ul v-if ="queryString" class="small" >
< li v-for ="(description, param) in queryString" >
< code > { { param } } < / code > – < span v-html ="description" > < / span >
< / li >
< / ul >
< / li >
< / ul >
< / section >
< / div >
< / template >
< script >
import { head } from "../src/helpers" ;
export default {
data ( ) {
return {
groups : [ {
2020-11-10 15:47:44 -08:00
enabled : this . config . pronouns . enabled ,
2020-11-10 14:41:56 -08:00
header : 'home.header' ,
icon : 'tags' ,
endpoints : {
pronouns _all : [ 'GET' , '/api/pronouns' ] ,
pronouns _one : [ 'GET' , '/api/pronouns/{pronoun}' , {
'examples[]' : 'Overwrite the default example sentences with custom ones. For each of them use the following format: <code>{sentenceSingular}|{sentencePlural}|{isHonorific}</code>. If <code>sentencePlural</code> is missing, if defaults to being the same as <code>sentenceSingular</code>. <code>isHonorific</code> can be <code>0</code> (default) or <code>1</code>.' ,
} ] ,
2021-05-21 09:39:14 -07:00
pronouns _banner : [ 'GET' , '/api/banner/{pronoun}.png' ] ,
2020-11-10 14:41:56 -08:00
} ,
} , {
enabled : this . config . sources . enabled ,
header : 'sources.header' ,
icon : 'books' ,
endpoints : {
sources _all : [ 'GET' , '/api/sources' ] ,
2020-12-04 13:09:57 -08:00
sources _one : [ 'GET' , '/api/sources/{id}' ] ,
2020-11-10 14:41:56 -08:00
} ,
} , {
enabled : this . config . nouns . enabled ,
header : 'nouns.header' ,
icon : 'atom-alt' ,
endpoints : {
nouns _all : [ 'GET' , '/api/nouns' ] ,
nouns _search : [ 'GET' , '/api/nouns/search/{term}' ] ,
} ,
2021-05-21 09:39:14 -07:00
} , {
2021-08-28 14:44:30 -07:00
enabled : this . config . inclusive . enabled ,
header : 'inclusive.header' ,
2021-05-21 09:39:14 -07:00
icon : 'book-heart' ,
endpoints : {
inclusive _all : [ 'GET' , '/api/inclusive' ] ,
inclusive _search : [ 'GET' , '/api/inclusive/search/{term}' ] ,
} ,
} , {
2021-08-28 14:44:30 -07:00
enabled : this . config . terminology . enabled ,
header : 'terminology.header' ,
2021-05-21 09:39:14 -07:00
icon : 'flag' ,
endpoints : {
terms _all : [ 'GET' , '/api/terms' ] ,
terms _search : [ 'GET' , '/api/terms/search/{term}' ] ,
} ,
} , {
enabled : this . config . profile . enabled ,
header : 'profile.header' ,
icon : 'id-card' ,
endpoints : {
2022-03-05 02:57:46 -08:00
profile _get : [ 'GET' , '/api/profile/get/{username}' , undefined , [ 'Note that the <code>birthday</code> field will only be available when querying your own account; otherwise only the calucaled <code>age</code> might be available (if the person has filled out their birthday)' ] ] ,
2021-05-21 09:39:14 -07:00
} ,
2022-01-02 13:07:39 -08:00
} , {
enabled : this . config . calendar . enabled ,
header : 'calendar.header' ,
icon : 'calendar-star' ,
endpoints : {
calendar _today : [ 'GET' , '/api/calendar/today' ] ,
calendar _day : [ 'GET' , '/api/calendar/{day}' ] ,
} ,
2020-11-10 14:41:56 -08:00
} ] ,
2021-05-21 09:39:14 -07:00
}
2020-11-10 14:41:56 -08:00
} ,
head ( ) {
return head ( {
title : this . $t ( 'api.header' ) ,
} ) ;
} ,
}
< / script >