77 lines
2.0 KiB
Plaintext
Raw Normal View History

2018-07-15 19:05:19 +09:00
extends ../../base
2017-12-15 00:23:45 +09:00
include ../mixins
block meta
2018-04-18 18:39:04 +09:00
link(rel="stylesheet" href="/docs/assets/api/endpoints/style.css")
2017-12-15 00:23:45 +09:00
block main
2018-07-16 06:19:19 +09:00
h1= title
2017-12-15 00:23:45 +09:00
2017-12-17 04:02:30 +09:00
p#url
span.method POST
span.host
2018-07-30 16:24:46 +09:00
= endpointUrl.host
2017-12-17 04:02:30 +09:00
| /
2018-07-30 16:24:46 +09:00
span.path= endpointUrl.path
2017-12-15 00:23:45 +09:00
2018-07-16 06:19:19 +09:00
if endpoint.desc
2018-08-29 06:59:43 +09:00
p#desc= endpoint.desc[lang] || endpoint.desc['ja-JP']
2017-12-15 00:23:45 +09:00
2018-07-16 06:19:19 +09:00
if endpoint.requireCredential
2018-07-18 00:47:09 +09:00
div.ui.info: p
i.fas.fa-id-card-alt(style="margin-right: 4px")
= i18n('docs.api.endpoints.require-credential')
if endpoint.kind
div.ui.info: p
i.fas.fa-unlock-alt(style="margin-right: 4px")
!= i18n('docs.api.endpoints.require-permission').replace('{permission}', `<code>${endpoint.kind}</code>`)
2018-07-16 06:19:19 +09:00
2018-07-16 07:54:08 +09:00
if endpoint.limit
2018-07-18 00:47:09 +09:00
div.ui.info.warn: p
i.far.fa-clock(style="margin-right: 4px")
b!= i18n('docs.api.endpoints.has-limit')
if endpoint.limit.duration
!= i18n('docs.api.endpoints.duration-limit').replace('{duration}', endpoint.limit.duration).replace('{max}', endpoint.limit.max)
if endpoint.limit.minInterval
!= i18n('docs.api.endpoints.min-interval-limit').replace('{interval}', endpoint.limit.minInterval)
2018-07-16 07:54:08 +09:00
2018-07-16 06:19:19 +09:00
if params && Object.keys(params).length > 0
2018-07-16 03:53:03 +09:00
section
h2= i18n('docs.api.endpoints.params')
+propTable(params)
if paramDefs
each paramDef in paramDefs
section(id= paramDef.name)
h3= paramDef.name
+propTable(paramDef.params)
2018-07-16 06:19:19 +09:00
if params && Object.keys(params).length == 0
section
h2= i18n('docs.api.endpoints.params')
p= i18n('docs.api.endpoints.no-params')
2017-12-15 00:23:45 +09:00
2017-12-16 05:04:02 +09:00
if res
section
2018-07-06 12:17:38 +09:00
h2= i18n('docs.api.endpoints.res')
2018-07-07 13:34:42 +09:00
2018-07-17 03:57:34 +09:00
if resProps
+propTable(resProps)
if resDefs
each resDef in resDefs
section(id= resDef.name)
h3= resDef.name
+propTable(resDef.props)
else
if res.type.startsWith('entity')
a(href=`/docs/${lang}/api/entities/${kebab(res.entity)}`)= res.entity
block footer
div.ui.info: p
i.fas.fa-info-circle(style="margin-right: 4px")
= i18n('docs.api.endpoints.generated')
p
= i18n('docs.api.endpoints.show-src')
a(href=src target="_blank")= i18n('docs.api.endpoints.show-src-link')