Generate API library
parent
f57cbf5f60
commit
c12c83ee90
|
@ -2,6 +2,7 @@
|
|||
"recommendations": [
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"EthanSK.restore-terminals"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,5 +3,48 @@
|
|||
"editor.formatOnSave": true,
|
||||
"json.validate.enable": true,
|
||||
"javascript.preferences.importModuleSpecifierEnding": "js",
|
||||
"typescript.preferences.importModuleSpecifierEnding": "js"
|
||||
"typescript.preferences.importModuleSpecifierEnding": "js",
|
||||
"restoreTerminals.keepExistingTerminalsOpen": false,
|
||||
"restoreTerminals.runOnStartup": false,
|
||||
"restoreTerminals.terminals": [
|
||||
{
|
||||
"splitTerminals": [
|
||||
{
|
||||
"name": "bot",
|
||||
"commands": ["cd bot", "pnpm run dev"]
|
||||
},
|
||||
{
|
||||
"name": "api",
|
||||
"commands": ["cd api", "pnpm run start:dev"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"splitTerminals": [
|
||||
{
|
||||
"name": "lib",
|
||||
"commands": ["cd lib", "pnpm run dev"]
|
||||
},
|
||||
{
|
||||
"name": "oapilib",
|
||||
"commands": ["cd oapilib", "pnpm run build:watch"]
|
||||
},
|
||||
{
|
||||
"name": "revolt.js",
|
||||
"commands": [
|
||||
"cd external/revolt.js",
|
||||
"pnpm run build:watch"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"splitTerminals": [
|
||||
{
|
||||
"name": "database",
|
||||
"commands": ["./scripts/dev_db.sh"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -9,10 +9,11 @@ import { MongodbModule } from './database/database.module';
|
|||
import { ServersController } from './servers/servers.controller';
|
||||
import { ServersService } from './servers/servers.service';
|
||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||
import { TestModule } from './test/test.module';
|
||||
|
||||
@Module({
|
||||
controllers: [AppController, InfractionsController, ServersController],
|
||||
providers: [AppService, InfractionsService, DatabaseService, ServersService],
|
||||
imports: [AuthModule, MongodbModule, EventEmitterModule.forRoot()],
|
||||
imports: [AuthModule, MongodbModule, EventEmitterModule.forRoot(), TestModule],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
|
|
@ -11,6 +11,8 @@ import { config } from 'dotenv';
|
|||
import { Logger, ValidationPipe } from '@nestjs/common';
|
||||
import { maxmindUpdater } from './util';
|
||||
import { WsAdapter } from '@nestjs/platform-ws';
|
||||
import { writeFile } from 'fs/promises';
|
||||
import { join as joinPath } from 'path';
|
||||
|
||||
config();
|
||||
if (process.env.NODE_ENV != 'production') {
|
||||
|
@ -48,6 +50,14 @@ async function bootstrap() {
|
|||
app.useWebSocketAdapter(wsAdapter);
|
||||
app.useGlobalPipes(new ValidationPipe({ skipMissingProperties: false }));
|
||||
|
||||
if (process.env.NODE_ENV == 'development') {
|
||||
Logger.log('Updating OpenAPI library');
|
||||
await writeFile(
|
||||
joinPath(__dirname, '..', '..', 'oapilib', 'OpenAPI.json'),
|
||||
JSON.stringify(spec, null, 4),
|
||||
);
|
||||
}
|
||||
|
||||
await app.listen(3000);
|
||||
|
||||
maxmindUpdater();
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
import { Controller, Delete, Get, Patch, Post, Put } from '@nestjs/common';
|
||||
import { ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
/**
|
||||
* This is required because https://github.com/insertish/oapi doesn't build
|
||||
* if there's not at least one of every request method present.
|
||||
*/
|
||||
|
||||
@Controller('test')
|
||||
@ApiTags('test')
|
||||
@ApiResponse({
|
||||
description:
|
||||
'These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi.',
|
||||
})
|
||||
export class TestController {
|
||||
@Get()
|
||||
get() {
|
||||
return 'get';
|
||||
}
|
||||
|
||||
@Post()
|
||||
post() {
|
||||
return 'post';
|
||||
}
|
||||
|
||||
@Patch()
|
||||
patch() {
|
||||
return 'patch';
|
||||
}
|
||||
|
||||
@Put()
|
||||
put() {
|
||||
return 'put';
|
||||
}
|
||||
|
||||
@Delete()
|
||||
delete() {
|
||||
return 'delete';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { TestController } from './test.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [TestController],
|
||||
})
|
||||
export class TestModule {}
|
|
@ -0,0 +1,586 @@
|
|||
{
|
||||
"openapi": "3.0.0",
|
||||
"paths": {
|
||||
"/": {
|
||||
"get": {
|
||||
"operationId": "getHello",
|
||||
"summary": "Fetch API configuration",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth": {
|
||||
"get": {
|
||||
"operationId": "getAuth",
|
||||
"summary": "Check authentication status",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/AuthInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "No valid authentication presented"
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the resource"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/servers/{server}/infractions": {
|
||||
"get": {
|
||||
"operationId": "listInfractions",
|
||||
"summary": "Fetch a list of infractions",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "server",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mod",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "before",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"description": "Unix millis. Returns values before this timestamp.",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "after",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"description": "Unix millis. Returns values after this timestamp.",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
},
|
||||
"401": {
|
||||
"description": "No valid authentication presented"
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the resource"
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"infractions"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"operationId": "createInfraction",
|
||||
"summary": "Create an infraction",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "server",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/CreateInfractionData"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": ""
|
||||
},
|
||||
"401": {
|
||||
"description": "No valid authentication presented"
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the resource"
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"infractions"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/servers/{server}/infractions/{id}": {
|
||||
"get": {
|
||||
"operationId": "getInfraction",
|
||||
"summary": "Fetch a single infraction",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "server",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
},
|
||||
"401": {
|
||||
"description": "No valid authentication presented"
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the resource"
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"infractions"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/servers": {
|
||||
"get": {
|
||||
"operationId": "listServers",
|
||||
"summary": "List all servers both AutoMod and the user are in",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"401": {
|
||||
"description": "No valid authentication presented"
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the resource"
|
||||
},
|
||||
"default": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/GetServersResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"servers"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/servers/{server}": {
|
||||
"get": {
|
||||
"operationId": "getServer",
|
||||
"summary": "Fetch details about a specific server",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "server",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"401": {
|
||||
"description": "No valid authentication presented"
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the resource"
|
||||
},
|
||||
"default": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ServerDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"servers"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/auth/login": {
|
||||
"post": {
|
||||
"operationId": "login",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LoginData"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"403": {
|
||||
"description": "Access to the resource is forbidden"
|
||||
},
|
||||
"default": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LoginResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"authentication"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/test": {
|
||||
"get": {
|
||||
"operationId": "get",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
},
|
||||
"default": {
|
||||
"description": "These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi."
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"operationId": "post",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": ""
|
||||
},
|
||||
"default": {
|
||||
"description": "These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi."
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"operationId": "patch",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
},
|
||||
"default": {
|
||||
"description": "These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi."
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"operationId": "put",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
},
|
||||
"default": {
|
||||
"description": "These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi."
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"operationId": "delete",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
},
|
||||
"default": {
|
||||
"description": "These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi."
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"test"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"info": {
|
||||
"title": "AutoMod API",
|
||||
"description": "API to interact with AutoMod",
|
||||
"version": "1.0",
|
||||
"contact": {}
|
||||
},
|
||||
"tags": [],
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://localhost:3000",
|
||||
"description": "Development"
|
||||
}
|
||||
],
|
||||
"components": {
|
||||
"securitySchemes": {
|
||||
"bearer": {
|
||||
"scheme": "bearer",
|
||||
"bearerFormat": "JWT",
|
||||
"type": "http",
|
||||
"name": "API Authentication"
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"AuthInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"authenticated": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"god": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"authenticated",
|
||||
"user",
|
||||
"god"
|
||||
]
|
||||
},
|
||||
"CreateInfractionData": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"user",
|
||||
"reason"
|
||||
]
|
||||
},
|
||||
"ServerInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"moderator": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"discoverable": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"icon",
|
||||
"moderator",
|
||||
"discoverable"
|
||||
]
|
||||
},
|
||||
"GetServersResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ServerInfo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"servers"
|
||||
]
|
||||
},
|
||||
"ServerLogsConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"moderation": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"default": "00000000000000000000000000"
|
||||
},
|
||||
"messages": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"default": "00000000000000000000000000"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"moderation",
|
||||
"messages"
|
||||
]
|
||||
},
|
||||
"ServerConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"language": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"infraction_visibility": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"default": "own"
|
||||
},
|
||||
"logs": {
|
||||
"$ref": "#/components/schemas/ServerLogsConfig"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"language",
|
||||
"prefix",
|
||||
"infraction_visibility",
|
||||
"logs"
|
||||
]
|
||||
},
|
||||
"ServerDetails": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"info": {
|
||||
"$ref": "#/components/schemas/ServerInfo"
|
||||
},
|
||||
"config": {
|
||||
"$ref": "#/components/schemas/ServerConfig"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"info",
|
||||
"config"
|
||||
]
|
||||
},
|
||||
"LoginData": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "string",
|
||||
"description": "The user ID you are trying to log in as"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"user"
|
||||
]
|
||||
},
|
||||
"LoginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"otp": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"token",
|
||||
"otp"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "oapilib",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "oapilib && tsc",
|
||||
"build:watch": "nodemon -w ./OpenAPI.json --exec pnpm run build"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@insertish/oapi": "^0.1.18",
|
||||
"axios": "^1.4.0",
|
||||
"lodash.defaultsdeep": "^4.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash.defaultsdeep": "^4.6.7",
|
||||
"nodemon": "^3.0.1",
|
||||
"openapi-typescript": "^6.3.4",
|
||||
"typescript": "^5.1.6"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
// This file was auto-generated by @insertish/oapi!
|
||||
export const defaultBaseURL = "http://localhost:3000";
|
|
@ -0,0 +1,271 @@
|
|||
// This file was auto-generated by @insertish/oapi!
|
||||
import Axios from 'axios';
|
||||
import type { AxiosRequestConfig } from 'axios';
|
||||
|
||||
import defaultsDeep from 'lodash.defaultsdeep';
|
||||
|
||||
export * from './types';
|
||||
import type { APIRoutes } from './routes';
|
||||
|
||||
import { defaultBaseURL } from './baseURL';
|
||||
import { pathResolve, queryParams } from './params';
|
||||
|
||||
type Methods = APIRoutes['method'];
|
||||
type PickRoutes<Method extends Methods> = APIRoutes & { method: Method };
|
||||
|
||||
type GetRoutes = PickRoutes<'get'>;
|
||||
type PatchRoutes = PickRoutes<'patch'>;
|
||||
type PutRoutes = PickRoutes<'put'>;
|
||||
type DeleteRoutes = PickRoutes<'delete'>;
|
||||
type PostRoutes = PickRoutes<'post'>;
|
||||
|
||||
type Count<Str extends string, SubStr extends string, Matches extends null[] = []> =
|
||||
Str extends `${infer _}${SubStr}${infer After}` ? Count<After, SubStr, [...Matches, null]> : Matches['length'];
|
||||
|
||||
/**
|
||||
* Get the specific path name of any given path.
|
||||
* @param anyPath Any path
|
||||
* @returns Specific path
|
||||
*/
|
||||
export function getPathName(anyPath: string) {
|
||||
const segments = anyPath.split('/');
|
||||
|
||||
const list = (pathResolve as unknown as Record<string, (string | [string])[]>)[(segments.length - 1).toString()] || [];
|
||||
for (const entry of list) {
|
||||
let i = 1;
|
||||
let copy = [...segments];
|
||||
for (i;i<segments.length;i++) {
|
||||
if (Array.isArray(entry[i - 1])) {
|
||||
copy[i] = entry[i - 1];
|
||||
continue;
|
||||
}
|
||||
else if (entry[i - 1] !== segments[i]) break;
|
||||
}
|
||||
|
||||
if (i === segments.length) return copy.join('/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Client configuration options
|
||||
*/
|
||||
export interface Options {
|
||||
/**
|
||||
* Base URL of the Revolt node
|
||||
*/
|
||||
baseURL: string;
|
||||
/**
|
||||
* Authentication used for requests
|
||||
*/
|
||||
authentication: {
|
||||
rauth?: string | undefined;
|
||||
revolt?: { token: string } | string | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* API Client
|
||||
*/
|
||||
export class API {
|
||||
private baseURL: Options['baseURL'];
|
||||
private authentication: Options['authentication'];
|
||||
|
||||
constructor({ baseURL, authentication }: Partial<Options> = { }) {
|
||||
this.baseURL = baseURL || defaultBaseURL;
|
||||
this.authentication = authentication || { };
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate authentication options.
|
||||
*/
|
||||
get auth(): AxiosRequestConfig {
|
||||
if (this.authentication.rauth) {
|
||||
if (typeof this.authentication.rauth === 'string') {
|
||||
return {
|
||||
headers: {
|
||||
'X-Session-Token': this.authentication.rauth
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.authentication.revolt) {
|
||||
switch (typeof this.authentication.revolt) {
|
||||
case 'string': {
|
||||
return {
|
||||
headers: {
|
||||
'X-Bot-Token': this.authentication.revolt
|
||||
}
|
||||
}
|
||||
}
|
||||
case 'object': {
|
||||
return {
|
||||
headers: {
|
||||
'X-Session-Token': this.authentication.revolt.token
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { };
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate config to pass through to API.
|
||||
*/
|
||||
get config(): AxiosRequestConfig {
|
||||
return {
|
||||
baseURL: this.baseURL,
|
||||
...this.auth,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Send any arbitrary request.
|
||||
* @param method HTTP Method
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @param config Axios configuration
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
req<Method extends Methods, Routes extends PickRoutes<Method>, Path extends Routes['path'], Route extends Routes & { path: Path, parts: Count<Path, '/'> }>(method: Method, path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']> {
|
||||
let query, body;
|
||||
let named = getPathName(path);
|
||||
|
||||
// If we are aware of this route, then match the parameters given.
|
||||
if (named && typeof params === 'object') {
|
||||
const route = queryParams[named as keyof typeof queryParams];
|
||||
const allowed_query = (route as unknown as Record<Method, string[]>)[method];
|
||||
|
||||
// Map each parameter to the correct object.
|
||||
for (const parameter of Object.keys(params)) {
|
||||
if (allowed_query?.includes(parameter)) {
|
||||
query = {
|
||||
...(query || {}),
|
||||
[parameter]: (params as Record<any, any>)[parameter]
|
||||
};
|
||||
} else {
|
||||
body = {
|
||||
...(body || {}),
|
||||
[parameter]: (params as Record<any, any>)[parameter]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Axios(path, defaultsDeep({
|
||||
method,
|
||||
params: query,
|
||||
data: body
|
||||
}, defaultsDeep(
|
||||
config,
|
||||
this.config
|
||||
)))
|
||||
.then(res => res.data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send HTTP GET request.
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @param config Axios configuration
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
get<Path extends GetRoutes['path'], Route extends GetRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
|
||||
|
||||
/**
|
||||
* Send HTTP GET request.
|
||||
* @param path Path
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
get<Path extends (GetRoutes & { params: undefined })['path'], Route extends GetRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path): Promise<Route['response']>;
|
||||
|
||||
get(path: any, params?: any, config?: AxiosRequestConfig): Promise<any> {
|
||||
// @ts-ignore-next-line
|
||||
return this.req('get', path, params, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send HTTP PATCH request.
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @param config Axios configuration
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
patch<Path extends PatchRoutes['path'], Route extends PatchRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
|
||||
|
||||
/**
|
||||
* Send HTTP PATCH request.
|
||||
* @param path Path
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
patch<Path extends (PatchRoutes & { params: undefined })['path'], Route extends PatchRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path): Promise<Route['response']>;
|
||||
|
||||
patch(path: any, params?: any, config?: AxiosRequestConfig): Promise<any> {
|
||||
// @ts-ignore-next-line
|
||||
return this.req('patch', path, params, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send HTTP PUT request.
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @param config Axios configuration
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
put<Path extends PutRoutes['path'], Route extends PutRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
|
||||
|
||||
/**
|
||||
* Send HTTP PUT request.
|
||||
* @param path Path
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
put<Path extends (PutRoutes & { params: undefined })['path'], Route extends PutRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path): Promise<Route['response']>;
|
||||
|
||||
put(path: any, params?: any, config?: AxiosRequestConfig): Promise<any> {
|
||||
// @ts-ignore-next-line
|
||||
return this.req('put', path, params, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send HTTP DELETE request.
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @param config Axios configuration
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
delete<Path extends DeleteRoutes['path'], Route extends DeleteRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path, params?: any, config?: AxiosRequestConfig): Promise<Route['response']>;
|
||||
|
||||
/**
|
||||
* Send HTTP DELETE request.
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
delete<Path extends (DeleteRoutes & { params: undefined })['path'], Route extends DeleteRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path, params?: any): Promise<Route['response']>;
|
||||
|
||||
delete(path: any, params?: any, config?: AxiosRequestConfig): Promise<any> {
|
||||
// @ts-ignore-next-line
|
||||
return this.req('delete', path, params, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send HTTP POST request.
|
||||
* @param path Path
|
||||
* @param params Body or Query Parameters
|
||||
* @param config Axios configuration
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
post<Path extends PostRoutes['path'], Route extends PostRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
|
||||
|
||||
/**
|
||||
* Send HTTP POST request.
|
||||
* @param path Path
|
||||
* @returns Typed Response Data
|
||||
*/
|
||||
post<Path extends (PostRoutes & { params: undefined })['path'], Route extends PostRoutes & { path: Path, parts: Count<Path, '/'> }>(path: Path): Promise<Route['response']>;
|
||||
|
||||
post(path: any, params?: any, config?: AxiosRequestConfig): Promise<any> {
|
||||
// @ts-ignore-next-line
|
||||
return this.req('post', path, params, config);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
// This file was auto-generated by @insertish/oapi!
|
||||
export const pathResolve = {"1":[[""],["auth"],["servers"],["test"]],"2":[["servers",["{server}"]],["auth","login"]],"3":[["servers",["{server}"],"infractions"]],"4":[["servers",["{server}"],"infractions",["{id}"]]]};
|
||||
export const queryParams = {"/":{"get":[]},"/auth":{"get":[]},"/servers/{server}/infractions":{"get":["user","mod","limit","before","after"],"post":[]},"/servers/{server}/infractions/{id}":{"get":[]},"/servers":{"get":[]},"/servers/{server}":{"get":[]},"/auth/login":{"post":[]},"/test":{"get":[],"post":[],"patch":[],"put":[],"delete":[]}};
|
|
@ -0,0 +1,20 @@
|
|||
// This file was auto-generated by @insertish/oapi!
|
||||
import { paths } from './schema';
|
||||
export type APIRoutes =
|
||||
| { method: 'get', path: `/`, parts: 1, params: undefined, response: undefined }
|
||||
| { method: 'get', path: `/auth`, parts: 1, params: undefined, response: paths['/auth']['get']['responses']['200']['content']['application/json'] }
|
||||
| { method: 'get', path: `/servers/${string}/infractions`, parts: 3, params: paths['/servers/{server}/infractions']['get']['parameters']['query'], response: undefined }
|
||||
| { method: 'get', path: '-/servers/{server}/infractions', parts: 3, params: paths['/servers/{server}/infractions']['get']['parameters']['query'], response: undefined }
|
||||
| { method: 'post', path: `/servers/${string}/infractions`, parts: 3, params: paths['/servers/{server}/infractions']['post']['requestBody']['content']['application/json'], response: undefined }
|
||||
| { method: 'post', path: '-/servers/{server}/infractions', parts: 3, params: paths['/servers/{server}/infractions']['post']['requestBody']['content']['application/json'], response: undefined }
|
||||
| { method: 'get', path: `/servers/${string}/infractions/${string}`, parts: 4, params: undefined, response: undefined }
|
||||
| { method: 'get', path: '-/servers/{server}/infractions/{id}', parts: 4, params: undefined, response: undefined }
|
||||
| { method: 'get', path: `/servers`, parts: 1, params: undefined, response: undefined }
|
||||
| { method: 'get', path: `/servers/${string}`, parts: 2, params: undefined, response: undefined }
|
||||
| { method: 'get', path: '-/servers/{server}', parts: 2, params: undefined, response: undefined }
|
||||
| { method: 'post', path: `/auth/login`, parts: 2, params: paths['/auth/login']['post']['requestBody']['content']['application/json'], response: undefined }
|
||||
| { method: 'get', path: `/test`, parts: 1, params: undefined, response: undefined }
|
||||
| { method: 'post', path: `/test`, parts: 1, params: undefined, response: undefined }
|
||||
| { method: 'patch', path: `/test`, parts: 1, params: undefined, response: undefined }
|
||||
| { method: 'put', path: `/test`, parts: 1, params: undefined, response: undefined }
|
||||
| { method: 'delete', path: `/test`, parts: 1, params: undefined, response: undefined };
|
|
@ -0,0 +1,271 @@
|
|||
/**
|
||||
* This file was auto-generated by openapi-typescript.
|
||||
* Do not make direct changes to the file.
|
||||
*/
|
||||
|
||||
|
||||
export interface paths {
|
||||
"/": {
|
||||
/** Fetch API configuration */
|
||||
get: operations["getHello"];
|
||||
};
|
||||
"/auth": {
|
||||
/** Check authentication status */
|
||||
get: operations["getAuth"];
|
||||
};
|
||||
"/servers/{server}/infractions": {
|
||||
/** Fetch a list of infractions */
|
||||
get: operations["listInfractions"];
|
||||
/** Create an infraction */
|
||||
post: operations["createInfraction"];
|
||||
};
|
||||
"/servers/{server}/infractions/{id}": {
|
||||
/** Fetch a single infraction */
|
||||
get: operations["getInfraction"];
|
||||
};
|
||||
"/servers": {
|
||||
/** List all servers both AutoMod and the user are in */
|
||||
get: operations["listServers"];
|
||||
};
|
||||
"/servers/{server}": {
|
||||
/** Fetch details about a specific server */
|
||||
get: operations["getServer"];
|
||||
};
|
||||
"/auth/login": {
|
||||
post: operations["login"];
|
||||
};
|
||||
"/test": {
|
||||
get: operations["get"];
|
||||
put: operations["put"];
|
||||
post: operations["post"];
|
||||
delete: operations["delete"];
|
||||
patch: operations["patch"];
|
||||
};
|
||||
}
|
||||
|
||||
export type webhooks = Record<string, never>;
|
||||
|
||||
export interface components {
|
||||
schemas: {
|
||||
AuthInfo: {
|
||||
authenticated: boolean;
|
||||
user: string;
|
||||
/** @default false */
|
||||
god: boolean;
|
||||
};
|
||||
CreateInfractionData: {
|
||||
user: string;
|
||||
reason: string;
|
||||
};
|
||||
ServerInfo: {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
moderator: boolean;
|
||||
discoverable: boolean;
|
||||
};
|
||||
GetServersResponse: {
|
||||
servers: (components["schemas"]["ServerInfo"])[];
|
||||
};
|
||||
ServerLogsConfig: {
|
||||
/** @default 00000000000000000000000000 */
|
||||
moderation: string | null;
|
||||
/** @default 00000000000000000000000000 */
|
||||
messages: string | null;
|
||||
};
|
||||
ServerConfig: {
|
||||
language: string | null;
|
||||
prefix: string | null;
|
||||
/** @default own */
|
||||
infraction_visibility: string | null;
|
||||
logs: components["schemas"]["ServerLogsConfig"];
|
||||
};
|
||||
ServerDetails: {
|
||||
info: components["schemas"]["ServerInfo"];
|
||||
config: components["schemas"]["ServerConfig"];
|
||||
};
|
||||
LoginData: {
|
||||
/** @description The user ID you are trying to log in as */
|
||||
user: string;
|
||||
};
|
||||
LoginResponse: {
|
||||
token: string;
|
||||
otp: string;
|
||||
};
|
||||
};
|
||||
responses: never;
|
||||
parameters: never;
|
||||
requestBodies: never;
|
||||
headers: never;
|
||||
pathItems: never;
|
||||
}
|
||||
|
||||
export type external = Record<string, never>;
|
||||
|
||||
export interface operations {
|
||||
|
||||
/** Fetch API configuration */
|
||||
getHello: {
|
||||
responses: {
|
||||
200: never;
|
||||
};
|
||||
};
|
||||
/** Check authentication status */
|
||||
getAuth: {
|
||||
responses: {
|
||||
200: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["AuthInfo"];
|
||||
};
|
||||
};
|
||||
/** @description No valid authentication presented */
|
||||
401: never;
|
||||
/** @description The user does not have access to the resource */
|
||||
403: never;
|
||||
};
|
||||
};
|
||||
/** Fetch a list of infractions */
|
||||
listInfractions: {
|
||||
parameters: {
|
||||
query?: {
|
||||
user?: string;
|
||||
mod?: string;
|
||||
limit?: string;
|
||||
/** @description Unix millis. Returns values before this timestamp. */
|
||||
before?: number;
|
||||
/** @description Unix millis. Returns values after this timestamp. */
|
||||
after?: number;
|
||||
};
|
||||
path: {
|
||||
server: string;
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
200: never;
|
||||
/** @description No valid authentication presented */
|
||||
401: never;
|
||||
/** @description The user does not have access to the resource */
|
||||
403: never;
|
||||
};
|
||||
};
|
||||
/** Create an infraction */
|
||||
createInfraction: {
|
||||
parameters: {
|
||||
path: {
|
||||
server: string;
|
||||
};
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["CreateInfractionData"];
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
201: never;
|
||||
/** @description No valid authentication presented */
|
||||
401: never;
|
||||
/** @description The user does not have access to the resource */
|
||||
403: never;
|
||||
};
|
||||
};
|
||||
/** Fetch a single infraction */
|
||||
getInfraction: {
|
||||
parameters: {
|
||||
path: {
|
||||
server: string;
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
200: never;
|
||||
/** @description No valid authentication presented */
|
||||
401: never;
|
||||
/** @description The user does not have access to the resource */
|
||||
403: never;
|
||||
};
|
||||
};
|
||||
/** List all servers both AutoMod and the user are in */
|
||||
listServers: {
|
||||
responses: {
|
||||
/** @description No valid authentication presented */
|
||||
401: never;
|
||||
/** @description The user does not have access to the resource */
|
||||
403: never;
|
||||
default: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["GetServersResponse"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
/** Fetch details about a specific server */
|
||||
getServer: {
|
||||
parameters: {
|
||||
path: {
|
||||
server: string;
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description No valid authentication presented */
|
||||
401: never;
|
||||
/** @description The user does not have access to the resource */
|
||||
403: never;
|
||||
default: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["ServerDetails"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
login: {
|
||||
requestBody: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["LoginData"];
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description Access to the resource is forbidden */
|
||||
403: never;
|
||||
default: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["LoginResponse"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
get: {
|
||||
responses: {
|
||||
200: never;
|
||||
/** @description These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi. */
|
||||
default: never;
|
||||
};
|
||||
};
|
||||
put: {
|
||||
responses: {
|
||||
200: never;
|
||||
/** @description These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi. */
|
||||
default: never;
|
||||
};
|
||||
};
|
||||
post: {
|
||||
responses: {
|
||||
201: never;
|
||||
/** @description These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi. */
|
||||
default: never;
|
||||
};
|
||||
};
|
||||
delete: {
|
||||
responses: {
|
||||
200: never;
|
||||
/** @description These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi. */
|
||||
default: never;
|
||||
};
|
||||
};
|
||||
patch: {
|
||||
responses: {
|
||||
200: never;
|
||||
/** @description These routes exist as a temporary workaround because the OpenAPI spec is expected to have at least one route for every request method by @insertish/oapi. */
|
||||
default: never;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// This file was auto-generated by @insertish/oapi!
|
||||
import { components } from './schema';
|
||||
export type AuthInfo = components['schemas']['AuthInfo'];
|
||||
export type CreateInfractionData = components['schemas']['CreateInfractionData'];
|
||||
export type ServerInfo = components['schemas']['ServerInfo'];
|
||||
export type GetServersResponse = components['schemas']['GetServersResponse'];
|
||||
export type ServerLogsConfig = components['schemas']['ServerLogsConfig'];
|
||||
export type ServerConfig = components['schemas']['ServerConfig'];
|
||||
export type ServerDetails = components['schemas']['ServerDetails'];
|
||||
export type LoginData = components['schemas']['LoginData'];
|
||||
export type LoginResponse = components['schemas']['LoginResponse'];;
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2016",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": true
|
||||
}
|
||||
}
|
153
pnpm-lock.yaml
153
pnpm-lock.yaml
|
@ -301,6 +301,31 @@ importers:
|
|||
specifier: ^5.0.3
|
||||
version: 5.1.3
|
||||
|
||||
oapilib:
|
||||
dependencies:
|
||||
'@insertish/oapi':
|
||||
specifier: ^0.1.18
|
||||
version: 0.1.18
|
||||
axios:
|
||||
specifier: ^1.4.0
|
||||
version: 1.4.0
|
||||
lodash.defaultsdeep:
|
||||
specifier: ^4.6.1
|
||||
version: 4.6.1
|
||||
devDependencies:
|
||||
'@types/lodash.defaultsdeep':
|
||||
specifier: ^4.6.7
|
||||
version: 4.6.7
|
||||
nodemon:
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
openapi-typescript:
|
||||
specifier: ^6.3.4
|
||||
version: 6.3.4
|
||||
typescript:
|
||||
specifier: ^5.1.6
|
||||
version: 5.1.6
|
||||
|
||||
web:
|
||||
dependencies:
|
||||
'@types/node':
|
||||
|
@ -1907,6 +1932,16 @@ packages:
|
|||
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
|
||||
dev: false
|
||||
|
||||
/@types/lodash.defaultsdeep@4.6.7:
|
||||
resolution: {integrity: sha512-D+AUxs64qehDMkbfFoskG0XsIOh2CHBGqYfcQcubLbZSFCGKJKS885su3a97huqBNHj+p9of9UZ/uUIP46wUGQ==}
|
||||
dependencies:
|
||||
'@types/lodash': 4.14.195
|
||||
dev: true
|
||||
|
||||
/@types/lodash@4.14.195:
|
||||
resolution: {integrity: sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==}
|
||||
dev: true
|
||||
|
||||
/@types/mime@1.3.2:
|
||||
resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==}
|
||||
dev: true
|
||||
|
@ -2440,6 +2475,10 @@ packages:
|
|||
resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==}
|
||||
dev: true
|
||||
|
||||
/abbrev@1.1.1:
|
||||
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
||||
dev: true
|
||||
|
||||
/accepts@1.3.8:
|
||||
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
@ -2447,6 +2486,14 @@ packages:
|
|||
mime-types: 2.1.35
|
||||
negotiator: 0.6.3
|
||||
|
||||
/acorn-import-assertions@1.9.0(acorn@8.10.0):
|
||||
resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==}
|
||||
peerDependencies:
|
||||
acorn: ^8
|
||||
dependencies:
|
||||
acorn: 8.10.0
|
||||
dev: true
|
||||
|
||||
/acorn-import-assertions@1.9.0(acorn@8.8.2):
|
||||
resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==}
|
||||
peerDependencies:
|
||||
|
@ -2480,7 +2527,6 @@ packages:
|
|||
resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/acorn@8.8.2:
|
||||
resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==}
|
||||
|
@ -2671,7 +2717,6 @@ packages:
|
|||
|
||||
/asynckit@0.4.0:
|
||||
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
||||
dev: true
|
||||
|
||||
/autoprefixer@10.4.14(postcss@8.4.26):
|
||||
resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
|
||||
|
@ -2700,6 +2745,7 @@ packages:
|
|||
|
||||
/axios@0.26.1:
|
||||
resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
follow-redirects: 1.15.2
|
||||
transitivePeerDependencies:
|
||||
|
@ -2714,7 +2760,6 @@ packages:
|
|||
proxy-from-env: 1.1.0
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
dev: true
|
||||
|
||||
/axobject-query@3.2.1:
|
||||
resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==}
|
||||
|
@ -3115,7 +3160,6 @@ packages:
|
|||
engines: {node: '>= 0.8'}
|
||||
dependencies:
|
||||
delayed-stream: 1.0.0
|
||||
dev: true
|
||||
|
||||
/commander@2.20.3:
|
||||
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
|
||||
|
@ -3241,7 +3285,7 @@ packages:
|
|||
dependencies:
|
||||
ms: 2.0.0
|
||||
|
||||
/debug@3.2.7:
|
||||
/debug@3.2.7(supports-color@5.5.0):
|
||||
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
|
||||
peerDependencies:
|
||||
supports-color: '*'
|
||||
|
@ -3250,7 +3294,7 @@ packages:
|
|||
optional: true
|
||||
dependencies:
|
||||
ms: 2.1.3
|
||||
dev: false
|
||||
supports-color: 5.5.0
|
||||
|
||||
/debug@4.3.4:
|
||||
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
||||
|
@ -3314,7 +3358,6 @@ packages:
|
|||
/delayed-stream@1.0.0:
|
||||
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
dev: true
|
||||
|
||||
/depd@2.0.0:
|
||||
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
|
||||
|
@ -3551,7 +3594,7 @@ packages:
|
|||
/eslint-import-resolver-node@0.3.7:
|
||||
resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==}
|
||||
dependencies:
|
||||
debug: 3.2.7
|
||||
debug: 3.2.7(supports-color@5.5.0)
|
||||
is-core-module: 2.12.1
|
||||
resolve: 1.22.2
|
||||
transitivePeerDependencies:
|
||||
|
@ -3604,7 +3647,7 @@ packages:
|
|||
optional: true
|
||||
dependencies:
|
||||
'@typescript-eslint/parser': 5.59.11(eslint@8.45.0)(typescript@5.1.6)
|
||||
debug: 3.2.7
|
||||
debug: 3.2.7(supports-color@5.5.0)
|
||||
eslint: 8.45.0
|
||||
eslint-import-resolver-node: 0.3.7
|
||||
eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-node@0.3.7)(eslint-plugin-import@2.27.5)(eslint@8.45.0)
|
||||
|
@ -3626,7 +3669,7 @@ packages:
|
|||
array-includes: 3.1.6
|
||||
array.prototype.flat: 1.3.1
|
||||
array.prototype.flatmap: 1.3.1
|
||||
debug: 3.2.7
|
||||
debug: 3.2.7(supports-color@5.5.0)
|
||||
doctrine: 2.1.0
|
||||
eslint: 8.45.0
|
||||
eslint-import-resolver-node: 0.3.7
|
||||
|
@ -4063,6 +4106,7 @@ packages:
|
|||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.5
|
||||
dev: false
|
||||
|
||||
/fast-glob@3.3.0:
|
||||
resolution: {integrity: sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==}
|
||||
|
@ -4073,7 +4117,6 @@ packages:
|
|||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.5
|
||||
dev: false
|
||||
|
||||
/fast-json-stable-stringify@2.1.0:
|
||||
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
|
||||
|
@ -4203,7 +4246,6 @@ packages:
|
|||
asynckit: 0.4.0
|
||||
combined-stream: 1.0.8
|
||||
mime-types: 2.1.35
|
||||
dev: true
|
||||
|
||||
/formidable@2.1.2:
|
||||
resolution: {integrity: sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==}
|
||||
|
@ -4418,7 +4460,7 @@ packages:
|
|||
dependencies:
|
||||
array-union: 2.1.0
|
||||
dir-glob: 3.0.1
|
||||
fast-glob: 3.2.12
|
||||
fast-glob: 3.3.0
|
||||
ignore: 5.2.4
|
||||
merge2: 1.4.1
|
||||
slash: 3.0.0
|
||||
|
@ -4460,7 +4502,6 @@ packages:
|
|||
/has-flag@3.0.0:
|
||||
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
|
||||
engines: {node: '>=4'}
|
||||
dev: true
|
||||
|
||||
/has-flag@4.0.0:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
|
@ -4561,6 +4602,10 @@ packages:
|
|||
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
|
||||
dev: true
|
||||
|
||||
/ignore-by-default@1.0.1:
|
||||
resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==}
|
||||
dev: true
|
||||
|
||||
/ignore@5.2.4:
|
||||
resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
|
||||
engines: {node: '>= 4'}
|
||||
|
@ -5882,6 +5927,30 @@ packages:
|
|||
/node-releases@2.0.12:
|
||||
resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==}
|
||||
|
||||
/nodemon@3.0.1:
|
||||
resolution: {integrity: sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
chokidar: 3.5.3
|
||||
debug: 3.2.7(supports-color@5.5.0)
|
||||
ignore-by-default: 1.0.1
|
||||
minimatch: 3.1.2
|
||||
pstree.remy: 1.1.8
|
||||
semver: 7.5.4
|
||||
simple-update-notifier: 2.0.0
|
||||
supports-color: 5.5.0
|
||||
touch: 3.1.0
|
||||
undefsafe: 2.0.5
|
||||
dev: true
|
||||
|
||||
/nopt@1.0.10:
|
||||
resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
abbrev: 1.1.1
|
||||
dev: true
|
||||
|
||||
/normalize-path@3.0.0:
|
||||
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
@ -6011,6 +6080,18 @@ packages:
|
|||
dev: false
|
||||
optional: true
|
||||
|
||||
/openapi-typescript@6.3.4:
|
||||
resolution: {integrity: sha512-icWb7WBBFr8+RxX7NZC5ez0WkTSQAScLnI33vHRLvWxkpOGKLlp94C0wcicZWzh85EoIoFjO+tujcQxo7zeZdA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
ansi-colors: 4.1.3
|
||||
fast-glob: 3.3.0
|
||||
js-yaml: 4.1.0
|
||||
supports-color: 9.4.0
|
||||
undici: 5.22.1
|
||||
yargs-parser: 21.1.1
|
||||
dev: true
|
||||
|
||||
/optionator@0.9.1:
|
||||
resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
@ -6322,7 +6403,6 @@ packages:
|
|||
|
||||
/proxy-from-env@1.1.0:
|
||||
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
||||
dev: true
|
||||
|
||||
/ps-tree@1.2.0:
|
||||
resolution: {integrity: sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==}
|
||||
|
@ -6332,6 +6412,10 @@ packages:
|
|||
event-stream: 3.3.4
|
||||
dev: true
|
||||
|
||||
/pstree.remy@1.1.8:
|
||||
resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==}
|
||||
dev: true
|
||||
|
||||
/pump@3.0.0:
|
||||
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
|
||||
dependencies:
|
||||
|
@ -6654,6 +6738,14 @@ packages:
|
|||
dependencies:
|
||||
lru-cache: 6.0.0
|
||||
|
||||
/semver@7.5.4:
|
||||
resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
lru-cache: 6.0.0
|
||||
dev: true
|
||||
|
||||
/send@0.18.0:
|
||||
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
@ -6738,6 +6830,13 @@ packages:
|
|||
/signal-exit@3.0.7:
|
||||
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
|
||||
|
||||
/simple-update-notifier@2.0.0:
|
||||
resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==}
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
semver: 7.5.4
|
||||
dev: true
|
||||
|
||||
/sisteransi@1.0.5:
|
||||
resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
|
||||
dev: true
|
||||
|
@ -7010,7 +7109,6 @@ packages:
|
|||
engines: {node: '>=4'}
|
||||
dependencies:
|
||||
has-flag: 3.0.0
|
||||
dev: true
|
||||
|
||||
/supports-color@7.2.0:
|
||||
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||
|
@ -7025,6 +7123,11 @@ packages:
|
|||
has-flag: 4.0.0
|
||||
dev: true
|
||||
|
||||
/supports-color@9.4.0:
|
||||
resolution: {integrity: sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/supports-preserve-symlinks-flag@1.0.0:
|
||||
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
@ -7208,6 +7311,13 @@ packages:
|
|||
resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
|
||||
engines: {node: '>=0.6'}
|
||||
|
||||
/touch@3.1.0:
|
||||
resolution: {integrity: sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
nopt: 1.0.10
|
||||
dev: true
|
||||
|
||||
/tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
|
||||
|
@ -7448,7 +7558,6 @@ packages:
|
|||
resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/uid@2.0.2:
|
||||
resolution: {integrity: sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==}
|
||||
|
@ -7469,13 +7578,15 @@ packages:
|
|||
has-symbols: 1.0.3
|
||||
which-boxed-primitive: 1.0.2
|
||||
|
||||
/undefsafe@2.0.5:
|
||||
resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==}
|
||||
dev: true
|
||||
|
||||
/undici@5.22.1:
|
||||
resolution: {integrity: sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==}
|
||||
engines: {node: '>=14.0'}
|
||||
dependencies:
|
||||
busboy: 1.6.0
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/universalify@2.0.0:
|
||||
resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
|
||||
|
@ -7633,8 +7744,8 @@ packages:
|
|||
'@webassemblyjs/ast': 1.11.6
|
||||
'@webassemblyjs/wasm-edit': 1.11.6
|
||||
'@webassemblyjs/wasm-parser': 1.11.6
|
||||
acorn: 8.8.2
|
||||
acorn-import-assertions: 1.9.0(acorn@8.8.2)
|
||||
acorn: 8.10.0
|
||||
acorn-import-assertions: 1.9.0(acorn@8.10.0)
|
||||
browserslist: 4.21.9
|
||||
chrome-trace-event: 1.0.3
|
||||
enhanced-resolve: 5.15.0
|
||||
|
|
|
@ -3,4 +3,5 @@ packages:
|
|||
- lib
|
||||
- api
|
||||
- web
|
||||
- oapilib
|
||||
- external/*
|
||||
|
|
Loading…
Reference in New Issue