Highlight sb-only routes
This commit is contained in:
parent
0d6cb63096
commit
d1fe291418
@ -10576,6 +10576,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"updates"
|
"updates"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10588,6 +10594,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"track"
|
"track"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10850,6 +10862,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"scheduled-maintenances"
|
"scheduled-maintenances"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10921,6 +10939,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"policies"
|
"policies"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10940,6 +10964,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"policies"
|
"policies"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10959,6 +10989,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"policies"
|
"policies"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10978,6 +11014,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"policies"
|
"policies"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10997,6 +11039,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"ping"
|
"ping"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -17243,6 +17291,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"auth"
|
"auth"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -17282,6 +17336,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"auth"
|
"auth"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -17400,6 +17460,12 @@
|
|||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"auth"
|
"auth"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -17883,6 +17949,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"-"
|
"-"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -17895,6 +17967,12 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"-"
|
"-"
|
||||||
|
],
|
||||||
|
"x-badges": [
|
||||||
|
{
|
||||||
|
"label": "Spacebar-only",
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ function getTag(key) {
|
|||||||
return key.match(/\/([\w-]+)/)[1];
|
return key.match(/\/([\w-]+)/)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiRoutes() {
|
function apiRoutes(missingRoutes) {
|
||||||
const routes = getRouteDescriptions();
|
const routes = getRouteDescriptions();
|
||||||
|
|
||||||
// populate tags
|
// populate tags
|
||||||
@ -214,6 +214,15 @@ function apiRoutes() {
|
|||||||
|
|
||||||
obj.tags = [...(obj.tags || []), getTag(p)].unique();
|
obj.tags = [...(obj.tags || []), getTag(p)].unique();
|
||||||
|
|
||||||
|
if (missingRoutes.additional.includes(path.replace(/\/$/, ""))) {
|
||||||
|
obj["x-badges"] = [
|
||||||
|
{
|
||||||
|
label: "Spacebar-only",
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
specification.paths[path] = Object.assign(
|
specification.paths[path] = Object.assign(
|
||||||
specification.paths[path] || {},
|
specification.paths[path] || {},
|
||||||
{
|
{
|
||||||
@ -223,10 +232,21 @@ function apiRoutes() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
async function main() {
|
||||||
console.log("Generating OpenAPI Specification...");
|
console.log("Generating OpenAPI Specification...");
|
||||||
|
|
||||||
|
const routesRes = await fetch(
|
||||||
|
"https://github.com/spacebarchat/missing-routes/raw/main/missing.json",
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Accept: "application/json",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
const missingRoutes = await routesRes.json();
|
||||||
|
|
||||||
combineSchemas(schemas);
|
combineSchemas(schemas);
|
||||||
apiRoutes();
|
apiRoutes(missingRoutes);
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
openapiPath,
|
openapiPath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user