misskey/src/docs/api/endpoints/view.pug

77 lines
2.0 KiB
Plaintext
Raw Normal View History

2018-07-15 12:05:19 +02:00
extends ../../base
2017-12-14 16:23:45 +01:00
include ../mixins
block meta
2018-04-18 11:39:04 +02:00
link(rel="stylesheet" href="/docs/assets/api/endpoints/style.css")
2017-12-14 16:23:45 +01:00
block main
2018-07-15 23:19:19 +02:00
h1= title
2017-12-14 16:23:45 +01:00
2017-12-16 20:02:30 +01:00
p#url
span.method POST
span.host
= url.host
| /
span.path= url.path
2017-12-14 16:23:45 +01:00
2018-07-15 23:19:19 +02:00
if endpoint.desc
p#desc= endpoint.desc[lang] || endpoint.desc['ja']
2017-12-14 16:23:45 +01:00
2018-07-15 23:19:19 +02:00
if endpoint.requireCredential
2018-07-17 17:47:09 +02: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-15 23:19:19 +02:00
2018-07-16 00:54:08 +02:00
if endpoint.limit
2018-07-17 17:47:09 +02: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 00:54:08 +02:00
2018-07-15 23:19:19 +02:00
if params && Object.keys(params).length > 0
2018-07-15 20:53:03 +02: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-15 23:19:19 +02:00
if params && Object.keys(params).length == 0
section
h2= i18n('docs.api.endpoints.params')
p= i18n('docs.api.endpoints.no-params')
2017-12-14 16:23:45 +01:00
2017-12-15 21:04:02 +01:00
if res
section
2018-07-06 05:17:38 +02:00
h2= i18n('docs.api.endpoints.res')
2018-07-07 06:34:42 +02:00
2018-07-16 20:57:34 +02: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')