chore: update deps and api docs config
This commit is contained in:
parent
f914849431
commit
e34ba9a239
3 changed files with 27 additions and 23 deletions
|
|
@ -33,7 +33,7 @@
|
||||||
"@elastic/elasticsearch": "^8.17.0",
|
"@elastic/elasticsearch": "^8.17.0",
|
||||||
"@fast-csv/parse": "^5.0.2",
|
"@fast-csv/parse": "^5.0.2",
|
||||||
"@prisma/client": "^6.3.0",
|
"@prisma/client": "^6.3.0",
|
||||||
"@scalar/express-api-reference": "^0.4.173",
|
"@scalar/express-api-reference": "^0.4.182",
|
||||||
"@tsoa/runtime": "^6.6.0",
|
"@tsoa/runtime": "^6.6.0",
|
||||||
"@types/morgan": "^1.9.9",
|
"@types/morgan": "^1.9.9",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|
|
||||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
|
|
@ -18,8 +18,8 @@ importers:
|
||||||
specifier: ^6.3.0
|
specifier: ^6.3.0
|
||||||
version: 6.3.0(prisma@6.3.0(typescript@5.7.2))(typescript@5.7.2)
|
version: 6.3.0(prisma@6.3.0(typescript@5.7.2))(typescript@5.7.2)
|
||||||
'@scalar/express-api-reference':
|
'@scalar/express-api-reference':
|
||||||
specifier: ^0.4.173
|
specifier: ^0.4.182
|
||||||
version: 0.4.173
|
version: 0.4.182
|
||||||
'@tsoa/runtime':
|
'@tsoa/runtime':
|
||||||
specifier: ^6.6.0
|
specifier: ^6.6.0
|
||||||
version: 6.6.0
|
version: 6.6.0
|
||||||
|
|
@ -366,16 +366,16 @@ packages:
|
||||||
'@prisma/prisma-schema-wasm@5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59':
|
'@prisma/prisma-schema-wasm@5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59':
|
||||||
resolution: {integrity: sha512-+zUI7NQDXfcNnU8HgrAj4jRMv8yRfITLzcfv0Urf0adKimM+hkkVG4rX38i9zWMlxekkEBw7NLFx3Gxxy8d3iQ==}
|
resolution: {integrity: sha512-+zUI7NQDXfcNnU8HgrAj4jRMv8yRfITLzcfv0Urf0adKimM+hkkVG4rX38i9zWMlxekkEBw7NLFx3Gxxy8d3iQ==}
|
||||||
|
|
||||||
'@scalar/express-api-reference@0.4.173':
|
'@scalar/express-api-reference@0.4.182':
|
||||||
resolution: {integrity: sha512-C/s+rdImUb7gLbYRH6ICZjVPV8SHHMwJQ/Fiu6fVGomPldi0fpTDMaXH+9jRIlTm3LR6ACl/OlH7MXcPPRaFSA==}
|
resolution: {integrity: sha512-T8y+/FM24H1C13GMDkjmM62obEhfGclIPwR2tn2JK+TY6LhKuHAF0xPzaBkfiRjlSEnrJigJSJxb8lwGxHWr9A==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
'@scalar/openapi-types@0.1.5':
|
'@scalar/openapi-types@0.1.7':
|
||||||
resolution: {integrity: sha512-6geH9ehvQ/sG/xUyy3e0lyOw3BaY5s6nn22wHjEJhcobdmWyFER0O6m7AU0ZN4QTjle/gYvFJOjj552l/rsNSw==}
|
resolution: {integrity: sha512-oOTG3JQifg55U3DhKB7WdNIxFnJzbPJe7rqdyWdio977l8IkxQTVmObftJhdNIMvhV2K+1f/bDoMQGu6yTaD0A==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
'@scalar/types@0.0.25':
|
'@scalar/types@0.0.33':
|
||||||
resolution: {integrity: sha512-sGnOFnfiSn4o23rklU/jrg81hO+630bsFIdHg8MZ/w2Nc6IoUwARA2hbe4d4Fg+D0KBu40Tan/L+WAYDXkTJQg==}
|
resolution: {integrity: sha512-4mQYkQJO0HHaoFd8Z+vSdQAvYcCJ2bRLN9ewE+GneB8kvoLG/oM3ynroqzGQdoytH8BmhnJwD3aEUagfbK2x5g==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
'@swc/helpers@0.5.15':
|
'@swc/helpers@0.5.15':
|
||||||
|
|
@ -3123,15 +3123,15 @@ snapshots:
|
||||||
|
|
||||||
'@prisma/prisma-schema-wasm@5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59': {}
|
'@prisma/prisma-schema-wasm@5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59': {}
|
||||||
|
|
||||||
'@scalar/express-api-reference@0.4.173':
|
'@scalar/express-api-reference@0.4.182':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/types': 0.0.25
|
'@scalar/types': 0.0.33
|
||||||
|
|
||||||
'@scalar/openapi-types@0.1.5': {}
|
'@scalar/openapi-types@0.1.7': {}
|
||||||
|
|
||||||
'@scalar/types@0.0.25':
|
'@scalar/types@0.0.33':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/openapi-types': 0.1.5
|
'@scalar/openapi-types': 0.1.7
|
||||||
'@unhead/schema': 1.11.14
|
'@unhead/schema': 1.11.14
|
||||||
|
|
||||||
'@swc/helpers@0.5.15':
|
'@swc/helpers@0.5.15':
|
||||||
|
|
|
||||||
22
src/app.ts
22
src/app.ts
|
|
@ -6,7 +6,6 @@ import morgan from "./middlewares/morgan";
|
||||||
import { RegisterRoutes } from "./routes";
|
import { RegisterRoutes } from "./routes";
|
||||||
import { initEmploymentOffice, initThailandAreaDatabase } from "./utils/thailand-area";
|
import { initEmploymentOffice, initThailandAreaDatabase } from "./utils/thailand-area";
|
||||||
import { initFirstAdmin } from "./utils/database";
|
import { initFirstAdmin } from "./utils/database";
|
||||||
import { apiReference } from "@scalar/express-api-reference";
|
|
||||||
import { initSchedule } from "./services/schedule";
|
import { initSchedule } from "./services/schedule";
|
||||||
|
|
||||||
const APP_HOST = process.env.APP_HOST || "0.0.0.0";
|
const APP_HOST = process.env.APP_HOST || "0.0.0.0";
|
||||||
|
|
@ -24,8 +23,7 @@ const APP_PORT = +(process.env.APP_PORT || 3000);
|
||||||
const originalSend = app.response.json;
|
const originalSend = app.response.json;
|
||||||
|
|
||||||
app.response.json = function (body: unknown) {
|
app.response.json = function (body: unknown) {
|
||||||
this.app.locals.response = body;
|
return originalSend.call(this, (this.app.locals.response = body));
|
||||||
return originalSend.call(this, body);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
|
@ -36,12 +34,18 @@ const APP_PORT = +(process.env.APP_PORT || 3000);
|
||||||
app.use("/", express.static("static"));
|
app.use("/", express.static("static"));
|
||||||
app.use(
|
app.use(
|
||||||
"/api-docs",
|
"/api-docs",
|
||||||
apiReference({
|
await import("@scalar/express-api-reference").then(({ apiReference }) =>
|
||||||
theme: "kepler",
|
apiReference({
|
||||||
layout: "classic",
|
theme: "kepler",
|
||||||
spec: { url: "/api/openapi" },
|
layout: "classic",
|
||||||
cdn: "https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.74",
|
|
||||||
}),
|
hideModels: true,
|
||||||
|
hideClientButton: true,
|
||||||
|
customCss: `.endpoint-label-name { display: none }`,
|
||||||
|
|
||||||
|
spec: { url: "/api/openapi" },
|
||||||
|
}),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
RegisterRoutes(app);
|
RegisterRoutes(app);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue