arkos 1.2.25-test → 1.2.26-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/utils/cli/utils/cli.helpers.js +1 -1
- package/dist/cjs/utils/cli/utils/cli.helpers.js.map +1 -1
- package/dist/esm/app.js +1 -1
- package/dist/esm/server.js +1 -1
- package/dist/esm/utils/cli/utils/cli.helpers.js +1 -1
- package/dist/esm/utils/cli/utils/cli.helpers.js.map +1 -1
- package/package.json +3 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.helpers.js","sourceRoot":"","sources":["../../../../../src/utils/cli/utils/cli.helpers.ts"],"names":[],"mappings":";;;;;AAQA,sDAIC;AAED,wDAGC;AA+BD,gCAEC;AAlDD,4CAAoB;AACpB,gCAA2D;AAC3D,oCAA4D;AAM5D,SAAgB,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,SAAgB,sBAAsB;IACpC,IAAA,uCAAiC,GAAE,CAAC;IACpC,IAAA,wCAAgC,GAAE,CAAC;AACrC,CAAC;AA+BD,SAAgB,UAAU;IACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.helpers.js","sourceRoot":"","sources":["../../../../../src/utils/cli/utils/cli.helpers.ts"],"names":[],"mappings":";;;;;AAQA,sDAIC;AAED,wDAGC;AA+BD,gCAEC;AAlDD,4CAAoB;AACpB,gCAA2D;AAC3D,oCAA4D;AAM5D,SAAgB,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,SAAgB,sBAAsB;IACpC,IAAA,uCAAiC,GAAE,CAAC;IACpC,IAAA,wCAAgC,GAAE,CAAC;AACrC,CAAC;AA+BD,SAAgB,UAAU;IACxB,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import fs from \"fs\";\nimport { killDevelopmentServerChildProcess } from \"../dev\";\nimport { killProductionServerChildProcess } from \"../start\";\nimport path, { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n// import { fileURLToPath } from \"url\";\n// import { dirname } from \"path\";\n\nexport function ensureDirectoryExists(dirPath: string): void {\n if (!fs.existsSync(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true });\n }\n}\n\nexport function killServerChildProcess() {\n killDevelopmentServerChildProcess();\n killProductionServerChildProcess();\n}\n\n// export function getVersion() {\n// let currentDir: string;\n// // @ts-ignore\n// if (typeof __dirname !== \"undefined\") {\n// // @ts-ignore\n// currentDir = __dirname;\n// } else {\n// // @ts-ignore\n// currentDir = dirname(fileURLToPath((import.meta as any).url));\n// }\n\n// const packageJson = JSON.parse(\n// fs.readFileSync(\n// path.join(currentDir, \"../../../../../package.json\"),\n// \"utf8\"\n// ) || \"{}\"\n// );\n// return packageJson?.version || \"1.0.0\";\n// }\n\n//export async function getVersion() {\n// //@ts-ignore\n// const pkg = await import(\"../../../../../package.json\", {\n// with: { type: \"json\" }, // Use 'with' instead of 'assert'\n// });\n// const version = \"default\" in pkg ? pkg.default.versoin : pkg.version;\n\n// return version || \"1.0.0\";\n//}\nexport function getVersion() {\n return \"{{version}}\";\n}\n"]}
|
package/dist/esm/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import c from"express";import p from"cors";import m from"cookie-parser";import{getAuthRouter as f}from"./modules/auth/auth.router
|
|
1
|
+
"use strict";import c from"express";import p from"cors";import m from"cookie-parser";import{getAuthRouter as f}from"./modules/auth/auth.router";import{getPrismaModelsRouter as w,getAvailableResourcesAndRoutesRouter as R}from"./modules/base/base.router";import h from"./modules/error-handler/error-handler.controller";import{rateLimit as P}from"express-rate-limit";import y from"compression";import{handleRequestLogs as b}from"./modules/base/base.middlewares";import{checkDatabaseConnection as q,loadPrismaModule as A}from"./utils/helpers/prisma.helpers";import{getFileUploadRouter as O}from"./modules/file-upload/file-upload.router";import{queryParser as g}from"./utils/helpers/query-parser.helpers";import d from"./utils/helpers/deepmerge.helper";import{getSwaggerRouter as E}from"./modules/swagger/swagger.router";export const app=c();export async function bootstrap(e){await A(),e?.configureApp&&await e.configureApp(app);const n=e?.middlewares,t=n?.disable||[],a=n?.replace||{};t?.includes?.("compression")||app.use(a.compression||y(e?.compressionOptions)),t?.includes?.("global-rate-limit")||app.use(a.globalRateLimit||P(d({windowMs:60*1e3,limit:500,standardHeaders:"draft-7",legacyHeaders:!1,handler:(r,s)=>{s.status(429).json({message:"Too many requests, please try again later"})}},e?.globalRequestRateLimitOptions||{}))),t?.includes?.("cors")||app.use(a.cors||p(e?.cors?.customHandler?e.cors.customHandler:d({origin:(r,s)=>{const i=e?.cors?.allowedOrigins;i==="*"?s(null,!0):Array.isArray(i)?s(null,!r||i?.includes?.(r)):typeof i=="string"?s(null,!r||i===r):s(null,!1)},methods:["GET","POST","PUT","DELETE","PATCH","OPTIONS"],allowedHeaders:["Content-Type","Authorization","Connection"],credentials:!0},e?.cors?.options||{}))),t?.includes?.("express-json")||app.use(a.expressJson||c.json(e?.jsonBodyParserOptions)),t?.includes?.("cookie-parser")||app.use(a.cookieParser||m(...e?.cookieParserParameters||[])),t?.includes?.("query-parser")||app.use(a.queryParser||g(d({parseNull:!0,parseUndefined:!0,parseBoolean:!0},e?.queryParserOptions||{}))),t?.includes?.("database-connection")||app.use(a.databaseConnection||q),t?.includes?.("request-logger")||app.use(a.requestLogger||b),e?.middlewares?.additional&&e.middlewares.additional.forEach(r=>{app.use(r)});const l=e?.routers,u=l?.disable||[],o=l?.replace||{};if(u?.includes?.("welcome-endpoint")||app.get("/api",o.welcomeEndpoint||((r,s)=>{s.status(200).json({message:e.welcomeMessage})})),!u?.includes?.("file-upload")){const r=o.fileUpload?await o.fileUpload(e):await O(e);app.use(r)}if(!u?.includes?.("auth-router")&&e.authentication){const r=o.authRouter?await o.authRouter(e):await f(e);app.use("/api",r)}if(!u?.includes?.("prisma-models-router")){const r=o.prismaModelsRouter?await o.prismaModelsRouter(e):await w(e);app.use("/api",r)}return app.use("/api",R()),e.swagger&&(process.env.ARKOS_BUILD!=="true"||e.swagger.enableAfterBuild===!0)&&app.use("/api",await E(e)),l?.additional&&l.additional.forEach(r=>{app.use(r)}),t?.includes?.("global-error-handler")||app.use(a.globalErrorHandler||h),app.use("*",(r,s)=>{s.status(404).json({message:"Route not found!"})}),app}
|
package/dist/esm/server.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";import{bootstrap as a}from"./app
|
|
1
|
+
"use strict";import{bootstrap as a}from"./app";import p from"./utils/helpers/deepmerge.helper";import c from"http";import s from"./utils/sheu";import{initializePrismaModels as l}from"./utils/helpers/models.helpers";process.on("uncaughtException",o=>{o.message.includes("EPIPE")||(console.error(`
|
|
2
2
|
UNCAUGHT EXCEPTION! SHUTTING DOWN...
|
|
3
3
|
`),console.error(o.name,o.message),console.error(o),process.exit(1))});let r,t,e={welcomeMessage:"Welcome to our RESTful API generated by Arkos, find out more about Arkos at www.arkosjs.com",port:Number(process.env.CLI_PORT)||Number(process.env.PORT)||8e3,host:process.env.CLI_HOST||process.env.HOST||"localhost",fileUpload:{baseUploadDir:"uploads",baseRoute:"/api/uploads"},available:!1};async function u(o={}){l(),e.available=!0,e=p(e,o);const n=process.env.CLI_PORT||e.port||process.env.PORT||"port"in e?e.port:8e3;t=await a(e);const i=new Date().toTimeString().split(" ")[0];return n?(r=c.createServer(t),e?.configureServer&&await e.configureServer(r),r.listen(Number(n),e.host,()=>{s.ready(`${s.gray(i)} server waiting on http://${e.host||"localhost"}:${n}`)})):s.warn(`${s.gray(i)} port set to undefined, hence no internal http server was setup.`),t}process.on("unhandledRejection",o=>{console.error("UNHANDLED REJECTION! SHUTTING DOWN..."),console.error(o.name,o.message),console.error(o),r?.close(()=>{process.exit(1)})});export function terminateApplicationRunningProcessAndServer(){r?.close(()=>{process.exit(1)})}export function getArkosConfig(){return e}export function getExpressApp(){return t}export{r as server,u as initApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.helpers.js","sourceRoot":"","sources":["../../../../../src/utils/cli/utils/cli.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,iCAAiC,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAM5D,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,iCAAiC,EAAE,CAAC;IACpC,gCAAgC,EAAE,CAAC;AACrC,CAAC;AA+BD,MAAM,UAAU,UAAU;IACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.helpers.js","sourceRoot":"","sources":["../../../../../src/utils/cli/utils/cli.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,iCAAiC,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAM5D,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,iCAAiC,EAAE,CAAC;IACpC,gCAAgC,EAAE,CAAC;AACrC,CAAC;AA+BD,MAAM,UAAU,UAAU;IACxB,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import fs from \"fs\";\nimport { killDevelopmentServerChildProcess } from \"../dev\";\nimport { killProductionServerChildProcess } from \"../start\";\nimport path, { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n// import { fileURLToPath } from \"url\";\n// import { dirname } from \"path\";\n\nexport function ensureDirectoryExists(dirPath: string): void {\n if (!fs.existsSync(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true });\n }\n}\n\nexport function killServerChildProcess() {\n killDevelopmentServerChildProcess();\n killProductionServerChildProcess();\n}\n\n// export function getVersion() {\n// let currentDir: string;\n// // @ts-ignore\n// if (typeof __dirname !== \"undefined\") {\n// // @ts-ignore\n// currentDir = __dirname;\n// } else {\n// // @ts-ignore\n// currentDir = dirname(fileURLToPath((import.meta as any).url));\n// }\n\n// const packageJson = JSON.parse(\n// fs.readFileSync(\n// path.join(currentDir, \"../../../../../package.json\"),\n// \"utf8\"\n// ) || \"{}\"\n// );\n// return packageJson?.version || \"1.0.0\";\n// }\n\n//export async function getVersion() {\n// //@ts-ignore\n// const pkg = await import(\"../../../../../package.json\", {\n// with: { type: \"json\" }, // Use 'with' instead of 'assert'\n// });\n// const version = \"default\" in pkg ? pkg.default.versoin : pkg.version;\n\n// return version || \"1.0.0\";\n//}\nexport function getVersion() {\n return \"{{version}}\";\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkos",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.26-test",
|
|
4
4
|
"description": "The Express & Prisma Framework For RESTful API",
|
|
5
5
|
"main": "dist/cjs/exports/index.js",
|
|
6
6
|
"module": "dist/esm/exports/index.js",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
|
-
"build:esm": "tsc -p tsconfig.esm.json
|
|
80
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
81
81
|
"build:types": "tsc -p tsconfig.types.json",
|
|
82
82
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
83
|
-
"build": "npx rimraf dist && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run minify",
|
|
83
|
+
"build": "npx rimraf dist && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run minify && ts-node scripts/post-build-scripts.ts",
|
|
84
84
|
"minify": "esbuild dist/**/*.js --minify --outdir=dist --allow-overwrite --log-limit=0 --define:process.env.NODE_ENV=process.env.NODE_ENV",
|
|
85
85
|
"clean": "rm -r dist",
|
|
86
86
|
"dev": "ts-node --watch",
|
|
@@ -185,16 +185,5 @@
|
|
|
185
185
|
},
|
|
186
186
|
"engines": {
|
|
187
187
|
"node": ">=14.16"
|
|
188
|
-
},
|
|
189
|
-
"pnpm": {
|
|
190
|
-
"overrides": {},
|
|
191
|
-
"onlyBuiltDependencies": [
|
|
192
|
-
"@prisma/client",
|
|
193
|
-
"@prisma/engines",
|
|
194
|
-
"@scarf/scarf",
|
|
195
|
-
"esbuild",
|
|
196
|
-
"prisma",
|
|
197
|
-
"sharp"
|
|
198
|
-
]
|
|
199
188
|
}
|
|
200
189
|
}
|