Merge branch 'fix/channelPermissionOverwriteSchema' into slowcord
This commit is contained in:
commit
60ef362251
11681
api/assets/schemas.json
11681
api/assets/schemas.json
File diff suppressed because it is too large
Load Diff
@ -27,7 +27,16 @@ const Excluded = [
|
|||||||
"Response",
|
"Response",
|
||||||
"e.Response",
|
"e.Response",
|
||||||
"request.Response",
|
"request.Response",
|
||||||
"supertest.Response"
|
"supertest.Response",
|
||||||
|
|
||||||
|
// TODO: Figure out how to exclude schemas from node_modules?
|
||||||
|
"SomeJSONSchema",
|
||||||
|
"UncheckedPartialSchema",
|
||||||
|
"PartialSchema",
|
||||||
|
"UncheckedPropertiesSchema",
|
||||||
|
"PropertiesSchema",
|
||||||
|
"AsyncSchema",
|
||||||
|
"AnySchema",
|
||||||
];
|
];
|
||||||
|
|
||||||
function modify(obj) {
|
function modify(obj) {
|
||||||
@ -39,11 +48,18 @@ function modify(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
const program = TJS.getProgramFromFiles(walk(path.join(__dirname, "..", "src", "routes")), compilerOptions);
|
const files = [
|
||||||
|
...walk(path.join(__dirname, "..", "src", "routes")),
|
||||||
|
...walk(path.join(__dirname, "..", "..", "util", "src")),
|
||||||
|
];
|
||||||
|
const program = TJS.getProgramFromFiles(
|
||||||
|
files,
|
||||||
|
compilerOptions
|
||||||
|
);
|
||||||
const generator = TJS.buildGenerator(program, settings);
|
const generator = TJS.buildGenerator(program, settings);
|
||||||
if (!generator || !program) return;
|
if (!generator || !program) return;
|
||||||
|
|
||||||
const schemas = generator.getUserSymbols().filter((x) => (x.endsWith("Schema") || x.endsWith("Response")) && !Excluded.includes(x));
|
let schemas = generator.getUserSymbols().filter((x) => (x.endsWith("Schema") || x.endsWith("Response")) && !Excluded.includes(x));
|
||||||
console.log(schemas);
|
console.log(schemas);
|
||||||
|
|
||||||
var definitions = {};
|
var definitions = {};
|
||||||
|
@ -16,14 +16,7 @@ const router: Router = Router();
|
|||||||
|
|
||||||
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
|
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
|
||||||
|
|
||||||
// export interface ChannelPermissionOverwriteSchema extends ChannelPermissionOverwrite {}
|
export interface ChannelPermissionOverwriteSchema extends ChannelPermissionOverwrite {}
|
||||||
// TODO: typescript-json-schema does not like extending types
|
|
||||||
export interface ChannelPermissionOverwriteSchema {
|
|
||||||
allow: string;
|
|
||||||
deny: string;
|
|
||||||
id: string;
|
|
||||||
type: ChannelPermissionOverwriteType;
|
|
||||||
}
|
|
||||||
|
|
||||||
router.put(
|
router.put(
|
||||||
"/:overwrite_id",
|
"/:overwrite_id",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user