Skip to content

Node.js based forum software built for the modern web

feat: add missing schemas for various ACP settings routes

Julian Lam9de35ec5a39f
diff --git a/public/openapi/read.yaml b/public/openapi/read.yaml
index f60727f0e9..a449b0e9c8 100644
--- a/public/openapi/read.yaml
+++ b/public/openapi/read.yaml
@@ -57,8 +57,12 @@ tags:
paths:
/api/:
$ref: 'read/index.yaml'
+ /api/admin:
+ $ref: 'read/admin.yaml'
/api/admin/dashboard:
$ref: 'read/admin/dashboard.yaml'
+ "/api/admin/settings/{term}":
+ $ref: 'read/admin/settings/term.yaml'
/api/admin/settings/languages:
$ref: 'read/admin/settings/languages.yaml'
/api/admin/settings/navigation:
@@ -67,6 +71,12 @@ paths:
$ref: 'read/admin/settings/homepage.yaml'
/api/admin/settings/social:
$ref: 'read/admin/settings/social.yaml'
+ /api/admin/settings/email:
+ $ref: 'read/admin/settings/email.yaml'
+ /api/admin/settings/user:
+ $ref: 'read/admin/settings/user.yaml'
+ /api/admin/settings/post:
+ $ref: 'read/admin/settings/post.yaml'
/api/admin/manage/categories:
$ref: 'read/admin/manage/categories.yaml'
"/api/admin/manage/categories/{category_id}":
@@ -91,8 +101,6 @@ paths:
$ref: 'read/admin/manage/uploads.yaml'
/api/admin/manage/digest:
$ref: 'read/admin/manage/digest.yaml'
- "/api/admin/settings/{term}":
- $ref: 'read/admin/settings/term.yaml'
"/api/admin/appearance/{term}":
$ref: 'read/admin/appearance/term.yaml'
/api/admin/extend/plugins:
diff --git a/public/openapi/read/admin.yaml b/public/openapi/read/admin.yaml
new file mode 100644
index 0000000000..27ec1b9d93
--- /dev/null
+++ b/public/openapi/read/admin.yaml
@@ -0,0 +1,19 @@
+get:
+ tags:
+ - admin
+ summary: Get administrative index
+ description: |
+ Internally, NodeBB will redirect you to a different page based on your privilege levels.
+
+ The default is "dashboard" for superadmins and those with the "dashboard" privilege. If the requesting user is neither, then they will be redirected to a page that they have privileges to view (e.g. `/categories`, `/privileges`, `/users`, or `/settings/general`).
+
+ Failing that, the request will be denied.
+ responses:
+ "200":
+ description: |
+ A JSON object containing data for the default admin index.
+ content:
+ application/json:
+ schema:
+ properties: {}
+ additionalProperties: {}
\ No newline at end of file
diff --git a/public/openapi/read/admin/settings/email.yaml b/public/openapi/read/admin/settings/email.yaml
new file mode 100644
index 0000000000..e2d9b76257
--- /dev/null
+++ b/public/openapi/read/admin/settings/email.yaml
@@ -0,0 +1,43 @@
+get:
+ tags:
+ - admin
+ summary: Get emailer settings
+ responses:
+ "200":
+ description: ""
+ content:
+ application/json:
+ schema:
+ allOf:
+ - type: object
+ properties:
+ emails:
+ type: array
+ items:
+ type: object
+ properties:
+ path:
+ type: string
+ description: The name of the email template
+ fullpath:
+ type: string
+ description: Full system path to the email template
+ text:
+ type: string
+ description: Customized email template text, if applicable, otherwise identical to `original`
+ original:
+ type: string
+ description: The email template text as provided by NodeBB core
+ isCustom:
+ type: boolean
+ sendable:
+ type: array
+ items:
+ type: string
+ description: The name of the email template
+ services:
+ type: array
+ items:
+ type: string
+ description: A list of email services which can be used to send emails on behalf of NodeBB
+ - $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps
\ No newline at end of file
diff --git a/public/openapi/read/admin/settings/post.yaml b/public/openapi/read/admin/settings/post.yaml
new file mode 100644
index 0000000000..f8273c8b8c
--- /dev/null
+++ b/public/openapi/read/admin/settings/post.yaml
@@ -0,0 +1,18 @@
+get:
+ tags:
+ - admin
+ summary: Get post settings
+ responses:
+ "200":
+ description: ""
+ content:
+ application/json:
+ schema:
+ allOf:
+ - type: object
+ properties:
+ groupsExemptFromPostQueue:
+ type: array
+ items:
+ $ref: ../../../components/schemas/GroupObject.yaml#/GroupDataObject
+ - $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps
\ No newline at end of file
diff --git a/public/openapi/read/admin/settings/user.yaml b/public/openapi/read/admin/settings/user.yaml
new file mode 100644
index 0000000000..6dccccedee
--- /dev/null
+++ b/public/openapi/read/admin/settings/user.yaml
@@ -0,0 +1,25 @@
+get:
+ tags:
+ - admin
+ summary: Get user settings
+ responses:
+ "200":
+ description: ""
+ content:
+ application/json:
+ schema:
+ allOf:
+ - type: object
+ properties:
+ notificationSettings:
+ type: array
+ items:
+ type: object
+ properties:
+ name:
+ type: string
+ description: The notification type
+ label:
+ type: string
+ description: The language key for the notification type (for localisation client-side)
+ - $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps
\ No newline at end of file