Update plugins/federations.js
Browse files- plugins/federations.js +45 -0
plugins/federations.js
CHANGED
@@ -80,6 +80,51 @@ FedsRoutes.post("/api/v2/federation/newfed", authenticateApiKey, apiLimiter, asy
|
|
80 |
}
|
81 |
});
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
FedsRoutes.post("/api/v2/federation/subfed", authenticateApiKey, apiLimiter, async (req, res) => {
|
84 |
try {
|
85 |
const { parent_uuid, child_uuid } = req.body;
|
|
|
80 |
}
|
81 |
});
|
82 |
|
83 |
+
/**
|
84 |
+
* @swagger
|
85 |
+
* /api/v2/federation/subfed:
|
86 |
+
* post:
|
87 |
+
* summary: Add a sub-federation
|
88 |
+
* tags: [Federation]
|
89 |
+
* description: Adds a federation as a sub-federation under a parent federation.
|
90 |
+
* security:
|
91 |
+
* - apiKeyAuth: []
|
92 |
+
* requestBody:
|
93 |
+
* required: true
|
94 |
+
* content:
|
95 |
+
* application/json:
|
96 |
+
* schema:
|
97 |
+
* type: object
|
98 |
+
* properties:
|
99 |
+
* parent_uuid:
|
100 |
+
* type: string
|
101 |
+
* description: UUID of the parent federation.
|
102 |
+
* child_uuid:
|
103 |
+
* type: string
|
104 |
+
* description: UUID of the child federation to be added as a sub-federation.
|
105 |
+
* parameters:
|
106 |
+
* - in: header
|
107 |
+
* name: x-api-key
|
108 |
+
* required: true
|
109 |
+
* description: API key for authentication.
|
110 |
+
* schema:
|
111 |
+
* type: string
|
112 |
+
* responses:
|
113 |
+
* 200:
|
114 |
+
* description: Sub-federation added successfully.
|
115 |
+
* content:
|
116 |
+
* application/json:
|
117 |
+
* schema:
|
118 |
+
* type: object
|
119 |
+
* properties:
|
120 |
+
* message:
|
121 |
+
* type: string
|
122 |
+
* example: "Federation ChildName is now a sub-federation of ParentName"
|
123 |
+
* 404:
|
124 |
+
* description: Parent or child federation not found.
|
125 |
+
* 500:
|
126 |
+
* description: Internal server error.
|
127 |
+
*/
|
128 |
FedsRoutes.post("/api/v2/federation/subfed", authenticateApiKey, apiLimiter, async (req, res) => {
|
129 |
try {
|
130 |
const { parent_uuid, child_uuid } = req.body;
|