mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
docs: openapi schema fixes for auto-categorization commits
This commit is contained in:
21
public/openapi/components/schemas/admin/rulesObject.yaml
Normal file
21
public/openapi/components/schemas/admin/rulesObject.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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
|
||||||
@@ -48,6 +48,8 @@ get:
|
|||||||
type: string
|
type: string
|
||||||
order:
|
order:
|
||||||
type: number
|
type: number
|
||||||
|
isLocal:
|
||||||
|
type: boolean
|
||||||
subCategoriesPerPage:
|
subCategoriesPerPage:
|
||||||
type: number
|
type: number
|
||||||
children:
|
children:
|
||||||
|
|||||||
@@ -16,4 +16,25 @@ get:
|
|||||||
instanceCount:
|
instanceCount:
|
||||||
type: number
|
type: number
|
||||||
description: The number of ActivityPub-enabled instances that this forum knows about.
|
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/CommonProps.yaml#/CommonProps
|
- $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps
|
||||||
36
public/openapi/write/admin/activitypub/rules.yaml
Normal file
36
public/openapi/write/admin/activitypub/rules.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- admin
|
||||||
|
summary: create auto-categorization rule
|
||||||
|
description: This operation creates a new auto-categorization rule that is applied to new remote content received via ActivityPub.
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
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
|
||||||
|
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/rulesObject.yaml#/RulesObject
|
||||||
25
public/openapi/write/admin/activitypub/rules/rid.yaml
Normal file
25
public/openapi/write/admin/activitypub/rules/rid.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- admin
|
||||||
|
summary: delete auto-categorization rule
|
||||||
|
description: This operation deletes a previously set-up auto-categorization rule
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: rid
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: a valid rule ID
|
||||||
|
example: 4eb506f8-a173-4693-a41b-e23604bc973a
|
||||||
|
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/rulesObject.yaml#/RulesObject
|
||||||
@@ -72,7 +72,6 @@ categoriesController.getAll = async function (req, res) {
|
|||||||
let categoriesData = await categories.getCategoriesFields(cids, fields);
|
let categoriesData = await categories.getCategoriesFields(cids, fields);
|
||||||
({ categories: categoriesData } = await plugins.hooks.fire('filter:admin.categories.get', { categories: categoriesData, fields: fields }));
|
({ categories: categoriesData } = await plugins.hooks.fire('filter:admin.categories.get', { categories: categoriesData, fields: fields }));
|
||||||
|
|
||||||
// Append remote categories
|
|
||||||
categoriesData = categoriesData.map((category) => {
|
categoriesData = categoriesData.map((category) => {
|
||||||
category.isLocal = utils.isNumber(category.cid);
|
category.isLocal = utils.isNumber(category.cid);
|
||||||
return category;
|
return category;
|
||||||
|
|||||||
Reference in New Issue
Block a user