⬆️ update dependencies
This commit is contained in:
parent
a374b0b11a
commit
c7ed245433
@ -25,47 +25,27 @@
|
||||
"operationId": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "user found",
|
||||
"description": "User found",
|
||||
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPublic" } } }
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
|
||||
},
|
||||
"429": {
|
||||
"description": "Rate limit exceeded",
|
||||
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } },
|
||||
"headers": {
|
||||
"X-RateLimit-Bucket": {
|
||||
"description": "A unique string denoting the rate limit being encountered (non-inclusive of major parameters in the route path)",
|
||||
"schema": { "type": "string" }
|
||||
},
|
||||
"X-Rate-Limit-Limit": {
|
||||
"description": "The number of allowed requests in the current period",
|
||||
"schema": { "type": "integer" }
|
||||
},
|
||||
"X-Rate-Limit-Remaining": {
|
||||
"description": "The number of remaining requests in the current period",
|
||||
"schema": { "type": "integer" }
|
||||
},
|
||||
"X-Rate-Limit-Reset": {
|
||||
"description": "Date when current period is over in seconds since the Unix epoch",
|
||||
"schema": { "type": "integer" }
|
||||
},
|
||||
"X-Rate-Limit-Reset-After": {
|
||||
"description": "Number of seconds when current period will reset (can have decimal)",
|
||||
"schema": { "type": "number" }
|
||||
},
|
||||
"Retry-After": {
|
||||
"description": "Same as X-Rate-Limit-Reset-After but an integer",
|
||||
"schema": { "type": "integer" }
|
||||
},
|
||||
"X-RateLimit-Global": {
|
||||
"description": "Indicates whether or not all requests from your ip are rate limited",
|
||||
"schema": { "type": "boolean" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users/@me": {
|
||||
"get": {
|
||||
"summary": "",
|
||||
"description": "",
|
||||
"parameters": [],
|
||||
"operationId": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Authenticated user",
|
||||
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPublic" } } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -542,6 +522,7 @@
|
||||
"Member": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user_id": { "type": "string" },
|
||||
"user": { "$ref": "#/components/schemas/User" },
|
||||
"guild_id": { "type": "string" },
|
||||
"guild": { "$ref": "#/components/schemas/Guild" },
|
||||
@ -555,7 +536,7 @@
|
||||
"settings": { "$ref": "#/components/schemas/UserGuildSettings" },
|
||||
"id": { "type": "string" }
|
||||
},
|
||||
"required": ["deaf", "guild", "guild_id", "id", "joined_at", "mute", "pending", "roles", "settings", "user"]
|
||||
"required": ["deaf", "guild", "guild_id", "id", "joined_at", "mute", "pending", "roles", "settings", "user", "user_id"]
|
||||
},
|
||||
"Role": {
|
||||
"type": "object",
|
||||
@ -1078,39 +1059,57 @@
|
||||
"bot": { "type": "boolean" }
|
||||
},
|
||||
"required": ["bio", "bot", "discriminator", "id", "public_flags", "username"]
|
||||
}
|
||||
},
|
||||
"requestBodies": {
|
||||
"BanCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": { "delete_message_days": { "type": "string" }, "reason": { "type": "string" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"DmChannelCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"UserPrivate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"recipients": { "type": "array", "items": { "type": "string" } }
|
||||
"locale": { "type": "string" },
|
||||
"disabled": { "type": "boolean" },
|
||||
"username": { "type": "string" },
|
||||
"discriminator": { "type": "string" },
|
||||
"id": { "type": "string" },
|
||||
"public_flags": { "type": "string" },
|
||||
"avatar": { "type": "string" },
|
||||
"accent_color": { "type": "integer" },
|
||||
"banner": { "type": "string" },
|
||||
"bio": { "type": "string" },
|
||||
"bot": { "type": "boolean" },
|
||||
"flags": { "type": "string" },
|
||||
"mfa_enabled": { "type": "boolean" },
|
||||
"email": { "type": "string" },
|
||||
"phone": { "type": "string" },
|
||||
"verified": { "type": "boolean" },
|
||||
"nsfw_allowed": { "type": "boolean" },
|
||||
"premium": { "type": "boolean" },
|
||||
"premium_type": { "type": "integer" }
|
||||
},
|
||||
"required": [
|
||||
"bio",
|
||||
"bot",
|
||||
"disabled",
|
||||
"discriminator",
|
||||
"flags",
|
||||
"id",
|
||||
"locale",
|
||||
"mfa_enabled",
|
||||
"nsfw_allowed",
|
||||
"premium",
|
||||
"premium_type",
|
||||
"public_flags",
|
||||
"username",
|
||||
"verified"
|
||||
]
|
||||
},
|
||||
"BanCreateSchema": {
|
||||
"type": "object",
|
||||
"properties": { "delete_message_days": { "type": "string" }, "reason": { "type": "string" } }
|
||||
},
|
||||
"DmChannelCreateSchema": {
|
||||
"type": "object",
|
||||
"properties": { "name": { "type": "string" }, "recipients": { "type": "array", "items": { "type": "string" } } },
|
||||
"required": ["recipients"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"ChannelModifySchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
@ -1141,15 +1140,8 @@
|
||||
"default_auto_archive_duration": { "type": "integer" }
|
||||
},
|
||||
"required": ["name", "type"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"ChannelGuildPositionUpdateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
@ -1157,15 +1149,8 @@
|
||||
"additionalProperties": false,
|
||||
"required": ["id"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"EmojiCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
@ -1173,15 +1158,8 @@
|
||||
"roles": { "type": "array", "items": { "type": "string" } }
|
||||
},
|
||||
"required": ["image", "name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"GuildCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
@ -1193,15 +1171,8 @@
|
||||
"rules_channel_id": { "type": "string" }
|
||||
},
|
||||
"required": ["name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"GuildUpdateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"banner": { "type": "string" },
|
||||
@ -1224,27 +1195,13 @@
|
||||
"rules_channel_id": { "type": "string" }
|
||||
},
|
||||
"required": ["name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"GuildTemplateCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": { "name": { "type": "string" }, "avatar": { "type": "string" } },
|
||||
"required": ["name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"GuildUpdateWelcomeScreenSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"welcome_channels": {
|
||||
@ -1264,17 +1221,8 @@
|
||||
"enabled": { "type": "boolean" },
|
||||
"description": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"Number": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "" },
|
||||
"Boolean": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "" },
|
||||
"InviteCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"target_user_id": { "type": "string" },
|
||||
@ -1287,15 +1235,8 @@
|
||||
"target_user": { "type": "string" },
|
||||
"target_user_type": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"MemberCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": { "type": "string" },
|
||||
@ -1304,53 +1245,10 @@
|
||||
"joined_at": { "type": "string", "format": "date-time" }
|
||||
},
|
||||
"required": ["guild_id", "id", "joined_at", "nick"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"MemberNickChangeSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "type": "object", "properties": { "nick": { "type": "string" } }, "required": ["nick"] }
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"MemberChangeSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "type": "object", "properties": { "roles": { "type": "array", "items": { "type": "string" } } } }
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"EmbedType": {
|
||||
"content": {
|
||||
"application/json": { "schema": { "enum": ["article", "gifv", "image", "link", "rich", "video"], "type": "string" } }
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"EmbedImage": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": { "type": "string" },
|
||||
"proxy_url": { "type": "string" },
|
||||
"height": { "type": "integer" },
|
||||
"width": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"MemberNickChangeSchema": { "type": "object", "properties": { "nick": { "type": "string" } }, "required": ["nick"] },
|
||||
"MemberChangeSchema": { "type": "object", "properties": { "roles": { "type": "array", "items": { "type": "string" } } } },
|
||||
"MessageCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"content": { "type": "string" },
|
||||
@ -1434,15 +1332,8 @@
|
||||
"payload_json": { "type": "string" },
|
||||
"file": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"RoleModifySchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
@ -1452,39 +1343,18 @@
|
||||
"mentionable": { "type": "boolean" },
|
||||
"position": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"TemplateCreateSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": { "name": { "type": "string" }, "description": { "type": "string" } },
|
||||
"required": ["name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"TemplateModifySchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": { "name": { "type": "string" }, "description": { "type": "string" } },
|
||||
"required": ["name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"UserModifySchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"username": { "type": "string" },
|
||||
@ -1496,15 +1366,8 @@
|
||||
"new_password": { "type": "string" },
|
||||
"code": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"UserSettingsSchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"afk_timeout": { "type": "integer" },
|
||||
@ -1599,24 +1462,14 @@
|
||||
"theme",
|
||||
"timezone_offset"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"WidgetModifySchema": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": { "enabled": { "type": "boolean" }, "channel_id": { "type": "string" } },
|
||||
"required": ["channel_id", "enabled"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"requestBodies": {},
|
||||
"securitySchemes": {},
|
||||
"links": {},
|
||||
"callbacks": {}
|
||||
|
19
api/package-lock.json
generated
19
api/package-lock.json
generated
@ -7,6 +7,7 @@
|
||||
"": {
|
||||
"name": "@fosscord/api",
|
||||
"version": "1.0.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@fosscord/util": "file:../util",
|
||||
@ -29,7 +30,7 @@
|
||||
"i18next-node-fs-backend": "^2.1.3",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"mongoose": "^5.12.3",
|
||||
"mongoose-autopopulate": "^0.12.3",
|
||||
"mongoose-long": "^0.3.2",
|
||||
@ -78,7 +79,7 @@
|
||||
"env-paths": "^2.2.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.13",
|
||||
"missing-native-js-functions": "^1.2.14",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -7421,9 +7422,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/missing-native-js-functions": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.11.tgz",
|
||||
"integrity": "sha512-U97IscNBL4Wg9adYjEBT46Hb0Ld5dPT8vbdwFX+TNzGrFQCc4WqoGAZouaLNFwUqxzzHZ9DVg59unwnQyeIIQg=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"node_modules/mixin-deep": {
|
||||
"version": "1.3.2",
|
||||
@ -12976,7 +12977,7 @@
|
||||
"jest": "^27.0.6",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.13",
|
||||
"missing-native-js-functions": "^1.2.14",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -18555,9 +18556,9 @@
|
||||
}
|
||||
},
|
||||
"missing-native-js-functions": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.11.tgz",
|
||||
"integrity": "sha512-U97IscNBL4Wg9adYjEBT46Hb0Ld5dPT8vbdwFX+TNzGrFQCc4WqoGAZouaLNFwUqxzzHZ9DVg59unwnQyeIIQg=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"mixin-deep": {
|
||||
"version": "1.3.2",
|
||||
|
@ -78,7 +78,7 @@
|
||||
"i18next-node-fs-backend": "^2.1.3",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"mongoose": "^5.12.3",
|
||||
"mongoose-autopopulate": "^0.12.3",
|
||||
"mongoose-long": "^0.3.2",
|
||||
|
@ -19,41 +19,14 @@ const compilerOptions: TJS.CompilerOptions = {
|
||||
const openapiPath = path.join(__dirname, "..", "assets", "openapi.json");
|
||||
var specification = JSON.parse(fs.readFileSync(openapiPath, { encoding: "utf8" }));
|
||||
|
||||
async function generateSchemas() {
|
||||
async function utilSchemas() {
|
||||
const program = TJS.getProgramFromFiles([path.join(__dirname, "..", "..", "util", "src", "index.ts")], compilerOptions);
|
||||
const generator = TJS.buildGenerator(program, settings);
|
||||
|
||||
const schemas = [
|
||||
"Application",
|
||||
"Attachment",
|
||||
"Message",
|
||||
"AuditLog",
|
||||
"Ban",
|
||||
"Channel",
|
||||
"Emoji",
|
||||
"Guild",
|
||||
"Invite",
|
||||
"ReadState",
|
||||
"Recipient",
|
||||
"Relationship",
|
||||
"Role",
|
||||
"Sticker",
|
||||
"Team",
|
||||
"TeamMember",
|
||||
"Template",
|
||||
"VoiceState",
|
||||
"Webhook",
|
||||
"User",
|
||||
"UserPublic"
|
||||
];
|
||||
const schemas = ["UserPublic", "UserPrivate", "PublicConnectedAccount"];
|
||||
|
||||
// @ts-ignore
|
||||
const definitions = combineSchemas({ schemas, generator, program });
|
||||
|
||||
for (const key in definitions) {
|
||||
specification.components.schemas[key] = definitions[key];
|
||||
delete definitions[key].additionalProperties;
|
||||
}
|
||||
combineSchemas({ schemas, generator, program });
|
||||
}
|
||||
|
||||
function combineSchemas(opts: { program: TJS.Program; generator: TJS.JsonSchemaGenerator; schemas: string[] }) {
|
||||
@ -63,13 +36,19 @@ function combineSchemas(opts: { program: TJS.Program; generator: TJS.JsonSchemaG
|
||||
const part = TJS.generateSchema(opts.program, name, settings, [], opts.generator as TJS.JsonSchemaGenerator);
|
||||
if (!part) continue;
|
||||
|
||||
definitions = { ...definitions, ...part.definitions, [name]: { ...part, definitions: undefined, $schema: undefined } };
|
||||
definitions = { ...definitions, [name]: { ...part, definitions: undefined, $schema: undefined } };
|
||||
}
|
||||
|
||||
for (const key in definitions) {
|
||||
specification.components.schemas[key] = definitions[key];
|
||||
delete definitions[key].additionalProperties;
|
||||
delete definitions[key].$schema;
|
||||
}
|
||||
|
||||
return definitions;
|
||||
}
|
||||
|
||||
function generateBodies() {
|
||||
function apiSchemas() {
|
||||
const program = TJS.getProgramFromFiles([path.join(__dirname, "..", "src", "schema", "index.ts")], compilerOptions);
|
||||
const generator = TJS.buildGenerator(program, settings);
|
||||
|
||||
@ -94,97 +73,26 @@ function generateBodies() {
|
||||
"TemplateModifySchema",
|
||||
"UserModifySchema",
|
||||
"UserSettingsSchema",
|
||||
"WidgetModifySchema"
|
||||
"WidgetModifySchema",
|
||||
""
|
||||
];
|
||||
|
||||
// @ts-ignore
|
||||
const definitions = combineSchemas({ schemas, generator, program });
|
||||
|
||||
for (const key in definitions) {
|
||||
specification.components.requestBodies[key] = {
|
||||
content: {
|
||||
"application/json": { schema: definitions[key] }
|
||||
},
|
||||
description: ""
|
||||
};
|
||||
|
||||
delete definitions[key].additionalProperties;
|
||||
delete definitions[key].$schema;
|
||||
}
|
||||
combineSchemas({ schemas, generator, program });
|
||||
}
|
||||
|
||||
function addDefaultResponses() {
|
||||
Object.values(specification.paths).forEach((path: any) =>
|
||||
Object.values(path).forEach((request: any) => {
|
||||
if (!request.responses?.["401"]) {
|
||||
request.responses["401"] = {
|
||||
description: "Unauthorized",
|
||||
content: { "application/json": { schema: { $ref: "#/components/schemas/Error" } } }
|
||||
};
|
||||
}
|
||||
if (!request.responses?.["429"]) {
|
||||
request.responses["429"] = {
|
||||
description: "Rate limit exceeded",
|
||||
content: { "application/json": { schema: { $ref: "#/components/schemas/Error" } } },
|
||||
headers: {
|
||||
"X-RateLimit-Bucket": {
|
||||
description:
|
||||
"A unique string denoting the rate limit being encountered (non-inclusive of major parameters in the route path)",
|
||||
schema: { type: "string" }
|
||||
},
|
||||
"X-Rate-Limit-Limit": {
|
||||
description: "The number of allowed requests in the current period",
|
||||
schema: {
|
||||
type: "integer"
|
||||
}
|
||||
},
|
||||
"X-Rate-Limit-Remaining": {
|
||||
description: "The number of remaining requests in the current period",
|
||||
schema: {
|
||||
type: "integer"
|
||||
}
|
||||
},
|
||||
"X-Rate-Limit-Reset": {
|
||||
description: "Date when current period is over in seconds since the Unix epoch",
|
||||
schema: {
|
||||
type: "integer"
|
||||
}
|
||||
},
|
||||
"X-Rate-Limit-Reset-After": {
|
||||
description: "Number of seconds when current period will reset (can have decimal)",
|
||||
schema: {
|
||||
type: "number"
|
||||
}
|
||||
},
|
||||
"Retry-After": {
|
||||
description: "Same as X-Rate-Limit-Reset-After but an integer",
|
||||
schema: {
|
||||
type: "integer"
|
||||
}
|
||||
},
|
||||
"X-RateLimit-Global": {
|
||||
description: "Indicates whether or not all requests from your ip are rate limited",
|
||||
schema: {
|
||||
type: "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
);
|
||||
Object.values(specification.paths).forEach((path: any) => Object.values(path).forEach((request: any) => {}));
|
||||
}
|
||||
|
||||
function main() {
|
||||
addDefaultResponses();
|
||||
generateSchemas();
|
||||
specification = JSON.parse(JSON.stringify(specification).replaceAll("#/definitions", "#/components/schemas"));
|
||||
|
||||
generateBodies();
|
||||
utilSchemas();
|
||||
apiSchemas();
|
||||
|
||||
fs.writeFileSync(
|
||||
openapiPath,
|
||||
JSON.stringify(specification, null, 4).replaceAll("#/definitions", "#/components/requestBodies").replaceAll("bigint", "number")
|
||||
JSON.stringify(specification, null, 4).replaceAll("#/definitions", "#/components/schemas").replaceAll("bigint", "number")
|
||||
);
|
||||
}
|
||||
|
||||
|
1389
bundle/package-lock.json
generated
1389
bundle/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -51,7 +51,7 @@
|
||||
"@fosscord/util": "file:../util",
|
||||
"async-exit-hook": "^2.0.1",
|
||||
"express": "^4.17.1",
|
||||
"missing-native-js-functions": "^1.2.13",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"node-os-utils": "^1.3.5"
|
||||
}
|
||||
}
|
||||
|
18
cdn/package-lock.json
generated
18
cdn/package-lock.json
generated
@ -23,7 +23,7 @@
|
||||
"jest": "^27.0.6",
|
||||
"lambert-db": "^1.2.3",
|
||||
"lambert-server": "^1.2.8",
|
||||
"missing-native-js-functions": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"multer": "^1.4.2",
|
||||
"node-fetch": "^2.6.1",
|
||||
"supertest": "^6.1.6",
|
||||
@ -60,7 +60,7 @@
|
||||
"env-paths": "^2.2.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -3977,9 +3977,9 @@
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
},
|
||||
"node_modules/missing-native-js-functions": {
|
||||
"version": "1.2.10",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.10.tgz",
|
||||
"integrity": "sha512-sq+oAw/C3OtUyKopLNOf/+U85YNx7db6fy5nVfGVKlGdcV8tX24GjOSkcZeCAnAIjMEnlQBWTr17JXa3OJj22g=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "0.5.5",
|
||||
@ -5980,7 +5980,7 @@
|
||||
"jest": "^27.0.6",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -8561,9 +8561,9 @@
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
},
|
||||
"missing-native-js-functions": {
|
||||
"version": "1.2.10",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.10.tgz",
|
||||
"integrity": "sha512-sq+oAw/C3OtUyKopLNOf/+U85YNx7db6fy5nVfGVKlGdcV8tX24GjOSkcZeCAnAIjMEnlQBWTr17JXa3OJj22g=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.5",
|
||||
|
@ -51,7 +51,7 @@
|
||||
"jest": "^27.0.6",
|
||||
"lambert-db": "^1.2.3",
|
||||
"lambert-server": "^1.2.8",
|
||||
"missing-native-js-functions": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"multer": "^1.4.2",
|
||||
"node-fetch": "^2.6.1",
|
||||
"supertest": "^6.1.6",
|
||||
|
18
gateway/package-lock.json
generated
18
gateway/package-lock.json
generated
@ -15,7 +15,7 @@
|
||||
"dotenv": "^8.2.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.8",
|
||||
"missing-native-js-functions": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"mongoose-autopopulate": "^0.12.3",
|
||||
"node-fetch": "^2.6.1",
|
||||
"uuid": "^8.3.2",
|
||||
@ -48,7 +48,7 @@
|
||||
"env-paths": "^2.2.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.14",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -1144,9 +1144,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/missing-native-js-functions": {
|
||||
"version": "1.2.10",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.10.tgz",
|
||||
"integrity": "sha512-sq+oAw/C3OtUyKopLNOf/+U85YNx7db6fy5nVfGVKlGdcV8tX24GjOSkcZeCAnAIjMEnlQBWTr17JXa3OJj22g=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
@ -1942,7 +1942,7 @@
|
||||
"jest": "^27.0.6",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.14",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -2858,9 +2858,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"missing-native-js-functions": {
|
||||
"version": "1.2.10",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.10.tgz",
|
||||
"integrity": "sha512-sq+oAw/C3OtUyKopLNOf/+U85YNx7db6fy5nVfGVKlGdcV8tX24GjOSkcZeCAnAIjMEnlQBWTr17JXa3OJj22g=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
|
@ -32,7 +32,7 @@
|
||||
"dotenv": "^8.2.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.8",
|
||||
"missing-native-js-functions": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"mongoose-autopopulate": "^0.12.3",
|
||||
"node-fetch": "^2.6.1",
|
||||
"uuid": "^8.3.2",
|
||||
|
14
util/package-lock.json
generated
14
util/package-lock.json
generated
@ -17,7 +17,7 @@
|
||||
"env-paths": "^2.2.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.13",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
@ -6338,9 +6338,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/missing-native-js-functions": {
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.13.tgz",
|
||||
"integrity": "sha512-1RAArfUkrGkj5N3xJVW251F2PvfP2ozAcxsLLDR6uiiAixTP5Abh8zzGMadepbqgiHC0FGlTSAUNbh9abN4Osg=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
@ -13735,9 +13735,9 @@
|
||||
}
|
||||
},
|
||||
"missing-native-js-functions": {
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.13.tgz",
|
||||
"integrity": "sha512-1RAArfUkrGkj5N3xJVW251F2PvfP2ozAcxsLLDR6uiiAixTP5Abh8zzGMadepbqgiHC0FGlTSAUNbh9abN4Osg=="
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
|
||||
"integrity": "sha512-NNsxPSHnG22xellXsdGkzmF/SSzYNRgZcWQt2OKG+I3Wv8p37kTax13trTMthVkEOhvNv8M2l4A4JwK1p42ZHg=="
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
|
@ -44,7 +44,7 @@
|
||||
"env-paths": "^2.2.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.10",
|
||||
"missing-native-js-functions": "^1.2.13",
|
||||
"missing-native-js-functions": "^1.2.15",
|
||||
"node-fetch": "^2.6.1",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user