mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
docs: update openapi schema for relays and rules
This commit is contained in:
18
public/openapi/components/schemas/admin/relays.yaml
Normal file
18
public/openapi/components/schemas/admin/relays.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
RelayObject:
|
||||
type: object
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: The relay actor endpoint
|
||||
example: https://example.org/actor
|
||||
state:
|
||||
type: number
|
||||
description: "The established state of the relay(0: pending; 1: one way receive; 2: bidirectional)"
|
||||
enum: [0, 1, 2]
|
||||
label:
|
||||
type: string
|
||||
description: A language key pertaining to the `state` value
|
||||
RelaysArray:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/RelayObject'
|
||||
23
public/openapi/components/schemas/admin/rules.yaml
Normal file
23
public/openapi/components/schemas/admin/rules.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
RuleObject:
|
||||
type: object
|
||||
properties:
|
||||
rid:
|
||||
type: string
|
||||
description: a valid rule ID
|
||||
example: 4eb506f8-a173-4693-a41b-e23604bc973a
|
||||
type:
|
||||
type: string
|
||||
description: The auto-categorization rule type
|
||||
example: hashtag
|
||||
value:
|
||||
type: string
|
||||
description: The value that incoming content will be matched against (used alongside `type`)
|
||||
example: 'example'
|
||||
cid:
|
||||
type: number
|
||||
description: The category ID of a local category
|
||||
example: 1
|
||||
RulesArray:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/RuleObject'
|
||||
@@ -1,21 +0,0 @@
|
||||
RulesObject:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
rid:
|
||||
type: string
|
||||
description: a valid rule ID
|
||||
example: 4eb506f8-a173-4693-a41b-e23604bc973a
|
||||
type:
|
||||
type: string
|
||||
description: The auto-categorization rule type
|
||||
example: hashtag
|
||||
value:
|
||||
type: string
|
||||
description: The value that incoming content will be matched against (used alongside `type`)
|
||||
example: 'example'
|
||||
cid:
|
||||
type: number
|
||||
description: The category ID of a local category
|
||||
example: 1
|
||||
@@ -17,24 +17,7 @@ get:
|
||||
type: number
|
||||
description: The number of ActivityPub-enabled instances that this forum knows about.
|
||||
rules:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
rid:
|
||||
type: string
|
||||
description: a valid rule ID
|
||||
example: 4eb506f8-a173-4693-a41b-e23604bc973a
|
||||
type:
|
||||
type: string
|
||||
description: The auto-categorization rule type
|
||||
example: hashtag
|
||||
value:
|
||||
type: string
|
||||
description: The value that incoming content will be matched against (used alongside `type`)
|
||||
example: 'example'
|
||||
cid:
|
||||
type: number
|
||||
description: The category ID of a local category
|
||||
example: 1
|
||||
$ref: ../../../components/schemas/admin/rules.yaml#/RulesArray
|
||||
relays:
|
||||
$ref: ../../../components/schemas/admin/relays.yaml#/RelayArray
|
||||
- $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps
|
||||
28
public/openapi/write/admin/activitypub/relays.yaml
Normal file
28
public/openapi/write/admin/activitypub/relays.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
post:
|
||||
tags:
|
||||
- admin
|
||||
summary: add relay
|
||||
description: This operation establishes a connection to a remote relay for content discovery purposes
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: The relay actor endpoint
|
||||
example: https://example.org/actor
|
||||
responses:
|
||||
'200':
|
||||
description: rule successfully created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../../../components/schemas/admin/relays.yaml#/RelaysArray
|
||||
25
public/openapi/write/admin/activitypub/relays/url.yaml
Normal file
25
public/openapi/write/admin/activitypub/relays/url.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
delete:
|
||||
tags:
|
||||
- admin
|
||||
summary: remove relay
|
||||
description: This operation removes a pre-established relay connection
|
||||
parameters:
|
||||
- in: path
|
||||
name: url
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
description: The relay actor endpoint
|
||||
example: https://example.org/actor
|
||||
responses:
|
||||
'200':
|
||||
description: rule successfully deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../../../../components/schemas/admin/relays.yaml#/RelayArray
|
||||
@@ -33,4 +33,4 @@ post:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../../../components/schemas/admin/rulesObject.yaml#/RulesObject
|
||||
$ref: ../../../components/schemas/admin/rules.yaml#/RulesArray
|
||||
|
||||
@@ -22,4 +22,4 @@ delete:
|
||||
status:
|
||||
$ref: ../../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../../../../components/schemas/admin/rulesObject.yaml#/RulesObject
|
||||
$ref: ../../../../components/schemas/admin/rules.yaml#/RulesArray
|
||||
|
||||
Reference in New Issue
Block a user