arkos 1.5.16-beta → 1.5.17-beta

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.
@@ -1 +1 @@
1
- {"version":3,"file":"class-validator-to-json-schema.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/class-validator-to-json-schema.ts"],"names":[],"mappings":";;AAIA,6CAcC;AAED,8CAuCC;AAED,8CAGC;AAhED,qDAAqD;AACrD,iEAA0E;AAC1E,2EAA0E;AAE1E,SAAwB,0BAA0B,CAChD,cAA8C;IAE9C,MAAM,WAAW,GAAG,IAAA,yDAA4B,EAAC;QAC/C,6BAA6B,EAAE,IAAA,oCAAkB,GAAE;QACnD,+BAA+B,EAAE,mCAAsB;QACvD,gBAAgB,EAAE,uBAAuB;KAC1C,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEtD,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAE/B,OAAO,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,iBAAiB,CAC/B,MAAW,EACX,UAA+B,EAC/B,UAAU,IAAI,GAAG,EAAU;IAE3B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAEzD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE/C,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YACtB,OAAO;gBACL,YAAY,EAAE,OAAO;gBACrB,WAAW,EAAE,yBAAyB,OAAO,EAAE;aAChD,CAAC;QAEJ,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,gBAAgB,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YAC1E,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAExB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;YACjC,OAAO,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC;QAClC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { getMetadataStorage } from \"class-validator\";\nimport { defaultMetadataStorage } from \"class-transformer/cjs/storage.js\";\nimport { validationMetadatasToSchemas } from \"class-validator-jsonschema\";\n\nexport default function classValidatorToJsonSchema(\n decoratedClass: new (...args: any[]) => object\n): any {\n const jsonSchemas = validationMetadatasToSchemas({\n classValidatorMetadataStorage: getMetadataStorage(),\n classTransformerMetadataStorage: defaultMetadataStorage,\n refPointerPrefix: \"#/components/schemas/\",\n });\n\n const targetSchema = jsonSchemas[decoratedClass.name];\n\n if (!targetSchema) return null;\n\n return resolveReferences(targetSchema, jsonSchemas);\n}\n\nexport function resolveReferences(\n schema: any,\n allSchemas: Record<string, any>,\n visited = new Set<string>()\n): any {\n if (!schema || typeof schema !== \"object\") return schema;\n\n if (schema.$ref) {\n const refName = extractSchemaName(schema.$ref);\n\n if (visited.has(refName))\n return {\n $resolvedRef: refName,\n description: `Circular reference to ${refName}`,\n };\n\n const referencedSchema = allSchemas[refName];\n if (referencedSchema) {\n visited.add(refName);\n const resolved = resolveReferences(referencedSchema, allSchemas, visited);\n visited.delete(refName);\n\n const { $ref, ...rest } = schema;\n return { ...resolved, ...rest };\n }\n\n return schema;\n }\n\n if (Array.isArray(schema)) {\n return schema.map((item) => resolveReferences(item, allSchemas, visited));\n }\n\n const result: any = {};\n for (const [key, value] of Object.entries(schema)) {\n result[key] = resolveReferences(value, allSchemas, visited);\n }\n\n return result;\n}\n\nexport function extractSchemaName(ref: string): string {\n const parts = ref.split(\"/\");\n return parts[parts.length - 1];\n}\n"]}
1
+ {"version":3,"file":"class-validator-to-json-schema.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/class-validator-to-json-schema.ts"],"names":[],"mappings":";;AAIA,6CAcC;AAED,8CAuCC;AAED,8CAGC;AAhED,qDAAqD;AACrD,iEAA0E;AAC1E,2EAA0E;AAE1E,SAAwB,0BAA0B,CAChD,cAA8C;IAE9C,MAAM,WAAW,GAAG,IAAA,yDAA4B,EAAC;QAC/C,6BAA6B,EAAE,IAAA,oCAAkB,GAAS;QAC1D,+BAA+B,EAAE,mCAAsB;QACvD,gBAAgB,EAAE,uBAAuB;KAC1C,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEtD,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAE/B,OAAO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M,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { getMetadataStorage } from \"class-validator\";\nimport { defaultMetadataStorage } from \"class-transformer/cjs/storage.js\";\nimport { validationMetadatasToSchemas } from \"class-validator-jsonschema\";\n\nexport default function classValidatorToJsonSchema(\n decoratedClass: new (...args: any[]) => object\n): any {\n const jsonSchemas = validationMetadatasToSchemas({\n classValidatorMetadataStorage: getMetadataStorage() as any, // FIXME: dummy typing because of updates\n classTransformerMetadataStorage: defaultMetadataStorage,\n refPointerPrefix: \"#/components/schemas/\",\n });\n\n const targetSchema = jsonSchemas[decoratedClass.name];\n\n if (!targetSchema) return null;\n\n return resolveReferences(targetSchema, jsonSchemas);\n}\n\nexport function resolveReferences(\n schema: any,\n allSchemas: Record<string, any>,\n visited = new Set<string>()\n): any {\n if (!schema || typeof schema !== \"object\") return schema;\n\n if (schema.$ref) {\n const refName = extractSchemaName(schema.$ref);\n\n if (visited.has(refName))\n return {\n $resolvedRef: refName,\n description: `Circular reference to ${refName}`,\n };\n\n const referencedSchema = allSchemas[refName];\n if (referencedSchema) {\n visited.add(refName);\n const resolved = resolveReferences(referencedSchema, allSchemas, visited);\n visited.delete(refName);\n\n const { $ref, ...rest } = schema;\n return { ...resolved, ...rest };\n }\n\n return schema;\n }\n\n if (Array.isArray(schema)) {\n return schema.map((item) => resolveReferences(item, allSchemas, visited));\n }\n\n const result: any = {};\n for (const [key, value] of Object.entries(schema)) {\n result[key] = resolveReferences(value, allSchemas, visited);\n }\n\n return result;\n}\n\nexport function extractSchemaName(ref: string): string {\n const parts = ref.split(\"/\");\n return parts[parts.length - 1];\n}\n"]}
@@ -81,7 +81,7 @@ async function initApp(initConfig = {}) {
81
81
  }
82
82
  }
83
83
  process.on("unhandledRejection", (err) => {
84
- if (process.env.NO_CLI === "true")
84
+ if (process.env.NO_CLI === "true" && process.env.__SKIP_LISTEN !== "true")
85
85
  sheu_1.default.error("UNHANDLED REJECTION! SHUTTING DOWN...\n", {
86
86
  timestamp: true,
87
87
  bold: true,
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";;;;;;AAiBA,wCAGC;AAgID,sCAEC;AAEgB,0BAAO;AArJxB,+BAAkC;AAClC,gDAAwB;AACxB,wDAAgC;AAChC,uGAA4E;AAG5E,+EAA8F;AAC9F,oGAA0E;AAO1E,SAAgB,cAAc;IAE5B,OAAO,IAAA,qCAAoB,GAAE,CAAC;AAChC,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;IACtC,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO;IAE1C,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM;QAC/B,cAAI,CAAC,KAAK,CAAC,wCAAwC,EAAE;YACnD,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IAEL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC;AAEH,IAAI,MAA6D,CAAC;AAClE,IAAI,IAAa,CAAC;AAelB,KAAK,UAAU,OAAO,CACpB,aAA8B,EAAE;IAEhC,IAAI,CAAC;QACH,MAAM,WAAW,GA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C;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,cAAI,CAAC,KAAK,CACR,GAAG,EAAE,OAAO,IAAI,uDAAuD,CACxE,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,GAAa,EAAE,EAAE;IACjD,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM;QAC/B,cAAI,CAAC,KAAK,CAAC,yCAAyC,EAAE;YACpD,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEnB,IAAI,MAAM,EAAE,KAAK;QACf,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;;QAEH,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC,CAAC,CAAC;AAEH,SAAgB,aAAa;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { IncomingMessage, Server, ServerResponse } from \"http\";\nimport AppError from \"./modules/error-handler/utils/app-error\";\nimport { Express } from \"express\";\nimport { bootstrap } from \"./app\";\nimport http from \"http\";\nimport sheu from \"./utils/sheu\";\nimport portAndHostAllocator from \"./utils/features/port-and-host-allocator\";\nimport { ArkosConfig } from \"./types/new-arkos-config\";\nimport { ArkosInitConfig } from \"./types/arkos-config\";\nimport { getArkosConfig as getArkosConfigHelper } from \"./utils/helpers/arkos-config.helpers\";\nimport runtimeCliCommander from \"./utils/cli/utils/runtime-cli-commander\";\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): ArkosConfig {\n // This was kept only not to require many changes on the given time\n return getArkosConfigHelper();\n}\n\nprocess.on(\"uncaughtException\", (err) => {\n if (err.message.includes(\"EPIPE\")) return;\n\n if (process.env.NO_CLI === \"true\")\n sheu.error(\"UNCAUGHT EXCEPTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n\n console.error(err);\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nlet server: Server<typeof IncomingMessage, typeof ServerResponse>;\nlet _app: Express;\n\n/**\n * Initializes the application server.\n *\n * This function starts the server by listening on a specified port.\n * The port is determined by the following order of precedence:\n * 1. The `port` argument passed to the function.\n * 2. Defaults to `8000` if neither is provided.\n *\n * @param {ArkosInitConfig} initConfig - initial configs for the api ( authentication, port).\n * @returns {Promise<Express>} This function returns the Express App after all middlewares configurations.\n * You can prevent it from listen py passing port as undefined\n *\n */\nasync function initApp(\n initConfig: ArkosInitConfig = {}\n): Promise<Express | undefined> {\n try {\n const arkosConfig = getArkosConfig();\n\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n\n let networkHost = portAndHostAllocator.getFirstNonLocalIp();\n\n _app = await bootstrap(initConfig);\n const time = new Date().toTimeString().split(\" \")[0];\n const cliCommand = process.env.CLI_COMMAND;\n\n if (\n !cliCommand &&\n ((\"port\" in arkosConfig && arkosConfig?.port !== undefined) ||\n !(\"port\" in arkosConfig))\n ) {\n server = http.createServer(_app);\n\n if (initConfig?.configureServer) await initConfig.configureServer(server);\n\n process.send?.({ started: true });\n if (process.env.__SKIP_LISTEN !== \"true\")\n server.listen(\n Number(portAndHost?.port),\n portAndHost.host! === \"localhost\" ? \"127.0.0.1\" : portAndHost.host!,\n () => {\n const host = [\"0.0.0.0\", \"127.0.0.1\"].includes(portAndHost?.host)\n ? \"localhost\"\n : portAndHost?.host;\n\n const message = `${sheu.gray(time)} {{server}} waiting on http://${host}:${portAndHost?.port}`;\n\n sheu.ready(\n message.replace(\n \"{{server}}\",\n `${process.env.ARKOS_BUILD === \"true\" ? \"Production\" : \"Development\"} server`\n )\n );\n if (networkHost && portAndHost.host === \"0.0.0.0\")\n sheu.ready(\n message\n .replace(host, networkHost)\n .replace(\"{{server}}\", `Network server`)\n );\n if (\n arkosConfig?.swagger?.mode &&\n ((arkosConfig?.swagger?.enableAfterBuild &&\n process.env.ARKOS_BUILD === \"true\") ||\n process.env.ARKOS_BUILD !== \"true\")\n )\n sheu.ready(\n `${message.replace(\"{{server}}\", \"Documentation\")}${arkosConfig?.swagger?.endpoint || \"/api/docs\"}`\n );\n }\n );\n } else if (!cliCommand) {\n sheu.warn(\n `${sheu.gray(time)} Port set to undefined, hence no internal http server was setup.`\n );\n } else if (cliCommand) runtimeCliCommander.handle();\n\n return _app;\n } catch (err: any) {\n sheu.error(\n err?.message || \"Something went wrong while starting your application!\"\n );\n console.error(err);\n throw err;\n }\n}\n\nprocess.on(\"unhandledRejection\", (err: AppError) => {\n if (process.env.NO_CLI === \"true\")\n sheu.error(\"UNHANDLED REJECTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n console.error(err);\n\n if (server?.close)\n server?.close(() => {\n process.exit(1);\n });\n else\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nexport function getExpressApp() {\n return _app;\n}\n\nexport { server, initApp };\n"]}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";;;;;;AAiBA,wCAGC;AAgID,sCAEC;AAEgB,0BAAO;AArJxB,+BAAkC;AAClC,gDAAwB;AACxB,wDAAgC;AAChC,uGAA4E;AAG5E,+EAA8F;AAC9F,oGAA0E;AAO1E,SAAgB,cAAc;IAE5B,OAAO,IAAA,qCAAoB,GAAE,CAAC;AAChC,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAA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;QAEH,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC,CAAC,CAAC;AAEH,SAAgB,aAAa;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { IncomingMessage, Server, ServerResponse } from \"http\";\nimport AppError from \"./modules/error-handler/utils/app-error\";\nimport { Express } from \"express\";\nimport { bootstrap } from \"./app\";\nimport http from \"http\";\nimport sheu from \"./utils/sheu\";\nimport portAndHostAllocator from \"./utils/features/port-and-host-allocator\";\nimport { ArkosConfig } from \"./types/new-arkos-config\";\nimport { ArkosInitConfig } from \"./types/arkos-config\";\nimport { getArkosConfig as getArkosConfigHelper } from \"./utils/helpers/arkos-config.helpers\";\nimport runtimeCliCommander from \"./utils/cli/utils/runtime-cli-commander\";\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): ArkosConfig {\n // This was kept only not to require many changes on the given time\n return getArkosConfigHelper();\n}\n\nprocess.on(\"uncaughtException\", (err) => {\n if (err.message.includes(\"EPIPE\")) return;\n\n if (process.env.NO_CLI === \"true\")\n sheu.error(\"UNCAUGHT EXCEPTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n\n console.error(err);\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nlet server: Server<typeof IncomingMessage, typeof ServerResponse>;\nlet _app: Express;\n\n/**\n * Initializes the application server.\n *\n * This function starts the server by listening on a specified port.\n * The port is determined by the following order of precedence:\n * 1. The `port` argument passed to the function.\n * 2. Defaults to `8000` if neither is provided.\n *\n * @param {ArkosInitConfig} initConfig - initial configs for the api ( authentication, port).\n * @returns {Promise<Express>} This function returns the Express App after all middlewares configurations.\n * You can prevent it from listen py passing port as undefined\n *\n */\nasync function initApp(\n initConfig: ArkosInitConfig = {}\n): Promise<Express | undefined> {\n try {\n const arkosConfig = getArkosConfig();\n\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n\n let networkHost = portAndHostAllocator.getFirstNonLocalIp();\n\n _app = await bootstrap(initConfig);\n const time = new Date().toTimeString().split(\" \")[0];\n const cliCommand = process.env.CLI_COMMAND;\n\n if (\n !cliCommand &&\n ((\"port\" in arkosConfig && arkosConfig?.port !== undefined) ||\n !(\"port\" in arkosConfig))\n ) {\n server = http.createServer(_app);\n\n if (initConfig?.configureServer) await initConfig.configureServer(server);\n\n process.send?.({ started: true });\n if (process.env.__SKIP_LISTEN !== \"true\")\n server.listen(\n Number(portAndHost?.port),\n portAndHost.host! === \"localhost\" ? \"127.0.0.1\" : portAndHost.host!,\n () => {\n const host = [\"0.0.0.0\", \"127.0.0.1\"].includes(portAndHost?.host)\n ? \"localhost\"\n : portAndHost?.host;\n\n const message = `${sheu.gray(time)} {{server}} waiting on http://${host}:${portAndHost?.port}`;\n\n sheu.ready(\n message.replace(\n \"{{server}}\",\n `${process.env.ARKOS_BUILD === \"true\" ? \"Production\" : \"Development\"} server`\n )\n );\n if (networkHost && portAndHost.host === \"0.0.0.0\")\n sheu.ready(\n message\n .replace(host, networkHost)\n .replace(\"{{server}}\", `Network server`)\n );\n if (\n arkosConfig?.swagger?.mode &&\n ((arkosConfig?.swagger?.enableAfterBuild &&\n process.env.ARKOS_BUILD === \"true\") ||\n process.env.ARKOS_BUILD !== \"true\")\n )\n sheu.ready(\n `${message.replace(\"{{server}}\", \"Documentation\")}${arkosConfig?.swagger?.endpoint || \"/api/docs\"}`\n );\n }\n );\n } else if (!cliCommand) {\n sheu.warn(\n `${sheu.gray(time)} Port set to undefined, hence no internal http server was setup.`\n );\n } else if (cliCommand) runtimeCliCommander.handle();\n\n return _app;\n } catch (err: any) {\n sheu.error(\n err?.message || \"Something went wrong while starting your application!\"\n );\n console.error(err);\n throw err;\n }\n}\n\nprocess.on(\"unhandledRejection\", (err: AppError) => {\n if (process.env.NO_CLI === \"true\" && process.env.__SKIP_LISTEN !== \"true\")\n sheu.error(\"UNHANDLED REJECTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n console.error(err);\n\n if (server?.close)\n server?.close(() => {\n process.exit(1);\n });\n else\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nexport function getExpressApp() {\n return _app;\n}\n\nexport { server, initApp };\n"]}
@@ -35,9 +35,7 @@ program
35
35
  .description("Run production server")
36
36
  .option("-p, --port <number>", "Port number")
37
37
  .option("-h, --host <host>", "Host to bind to")
38
- .action(() => {
39
- (0, start_1.startCommand)();
40
- });
38
+ .action(start_1.startCommand);
41
39
  const generate = program
42
40
  .command("generate")
43
41
  .alias("g")
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/cli/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,mCAAuC;AAuOrB,6FAvOT,oBAAY,OAuOS;AAtO9B,+BAAmC;AAsOH,2FAtOvB,gBAAU,OAsOuB;AArO1C,mCAAuC;AAqOK,6FArOnC,oBAAY,OAqOmC;AApOxD,yCAA6C;AAoOa,gGApOjD,0BAAe,OAoOiD;AAnOzE,qDAAiD;AACjD,wEAAsD;AACtD,8EAA2D;AAE3D,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AA+NrB,0BAAO;AA7NhB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,IAAA,wBAAU,GAAE,CAAC,CAAC;AAExE,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,qBAAqB,EAAE,0BAA0B,EAAE,KAAK,CAAC;KAChE,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAA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AAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,0DAA0D,CAAC;KACvE,MAAM,CAAC,yBAAqB,CAAC,CAAC;AAEjC,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,OAAO,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,uDAAuD,CAAC;KACpE,MAAM,CAAC,iBAAiB,EAAE,0CAA0C,CAAC;KACrE,MAAM,CACL,mBAAmB,EACnB,8BAA8B,EAC9B,wBAAwB,CACzB;KACA,MAAM,CAAC,4BAAuB,CAAC,CAAC;AAEnC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { Command } from \"commander\";\nimport { buildCommand } from \"./build\";\nimport { devCommand } from \"./dev\";\nimport { startCommand } from \"./start\";\nimport { generateCommand } from \"./generate\";\nimport { getVersion } from \"./utils/cli.helpers\";\nimport prismaGenerateCommand from \"./prisma-generate\";\nimport exportAuthActionCommand from \"./export-auth-action\";\n\nconst program = new Command();\n\nprogram.name(\"arkos\").description(\"Arkos.js CLI\").version(getVersion());\n\nprogram\n .command(\"build\")\n .description(\"Build your Arkos project\")\n .option(\"-m, --module <type>\", \"Module type (cjs or esm)\", \"cjs\")\n .action(buildCommand);\n\nprogram\n .command(\"dev\")\n .description(\"Run development server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(devCommand);\n\nprogram\n .command(\"start\")\n .description(\"Run production server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(() => {\n startCommand();\n });\n\nconst generate = program\n .command(\"generate\")\n .alias(\"g\")\n .description(\"Generate arkos components\")\n .option(\"-m, --module <name>\", \"Module name\")\n .option(\"--model <name>\", \"Module name (alias for --module)\")\n .option(\"-p, --path <path>\", \"Custom path for the component\")\n .option(\"-o, --overwrite\", \"Overwrites all the content on the existing file\");\n\ngenerate\n .command(\"controller\")\n .alias(\"c\")\n .description(\"Generate a new controller\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.controller({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"service\")\n .alias(\"s\")\n .description(\"Generate a new service\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.service({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"router\")\n .alias(\"r\")\n .description(\"Generate a new router\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.router({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"auth-configs\")\n .alias(\"a\")\n .description(\"Generate auth configuration\")\n .option(\"-a, --advanced\", \"Advanced code structure\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.authConfigs({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-options\")\n .alias(\"q\")\n .description(\"Generate prisma query options\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryOptions({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"interceptors\")\n .alias(\"i\")\n .description(\"Generate a new interceptors file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.interceptors({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"hooks\")\n .alias(\"h\")\n .description(\"Generate a new service hooks file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.hooks({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-schema\")\n .alias(\"cs\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-schema\")\n .alias(\"us\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"schema\")\n .alias(\"sc\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-schema\")\n .alias(\"qs\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.querySchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-dto\")\n .alias(\"cd\")\n .description(\n \"Generate a new class-validator create dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-dto\")\n .alias(\"ud\")\n .description(\n \"Generate a new class-validator update dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"dto\")\n .alias(\"d\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-dto\")\n .alias(\"qd\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"model\")\n .alias(\"m\")\n .description(\"Generate a new prisma model\")\n .option(\"-p, --path <path>\", \"Custom path for prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.prismaModel({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"components\")\n .alias(\"co\")\n .description(\"Generate multiple components for a module\")\n .option(\"-a, --all\", \"Generate all components\")\n .option(\n \"-n, --names <names>\",\n \"Comma-separated list of components (e.g., s,sc,m or service,schema,model)\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.multipleComponents({ ...generateOptions, ...options });\n });\n\nprogram\n .command(\"prisma\")\n .command(\"generate\")\n .description(\"Generate your @prisma/client and BaseService class types\")\n .action(prismaGenerateCommand);\n\nprogram\n .command(\"export\")\n .command(\"auth-action\")\n .description(\"Export file with an array containing all auth-actions\")\n .option(\"-o, --overwrite\", \"Overwrites all the changes on the object\")\n .option(\n \"-p, --path <path>\",\n \"Custom path for auth-actions\",\n \"src/modules/auth/utils\"\n )\n .action(exportAuthActionCommand);\n\nprogram.parse(process.argv);\n\nexport { program, buildCommand, devCommand, startCommand, generateCommand };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/cli/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,mCAAuC;AAqOrB,6FArOT,oBAAY,OAqOS;AApO9B,+BAAmC;AAoOH,2FApOvB,gBAAU,OAoOuB;AAnO1C,mCAAuC;AAmOK,6FAnOnC,oBAAY,OAmOmC;AAlOxD,yCAA6C;AAkOa,gGAlOjD,0BAAe,OAkOiD;AAjOzE,qDAAiD;AACjD,wEAAsD;AACtD,8EAA2D;AAE3D,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AA6NrB,0BAAO;AA3NhB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,IAAA,wBAAU,GAAE,CAAC,CAAC;AAExE,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,qBAAqB,EAAE,0BAA0B,EAAE,KAAK,CAAC;KAChE,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,wBAAwB,CAAC;KACrC,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC;KAC5C,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;KAC9C,MAAM,CAAC,gBAAU,CAAC,CAAC;AAEtB,OAAO;KACJ,OAAO,CAAC,OAA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,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,uDAAuD,CAAC;KACpE,MAAM,CAAC,iBAAiB,EAAE,0CAA0C,CAAC;KACrE,MAAM,CACL,mBAAmB,EACnB,8BAA8B,EAC9B,wBAAwB,CACzB;KACA,MAAM,CAAC,4BAAuB,CAAC,CAAC;AAEnC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { Command } from \"commander\";\nimport { buildCommand } from \"./build\";\nimport { devCommand } from \"./dev\";\nimport { startCommand } from \"./start\";\nimport { generateCommand } from \"./generate\";\nimport { getVersion } from \"./utils/cli.helpers\";\nimport prismaGenerateCommand from \"./prisma-generate\";\nimport exportAuthActionCommand from \"./export-auth-action\";\n\nconst program = new Command();\n\nprogram.name(\"arkos\").description(\"Arkos.js CLI\").version(getVersion());\n\nprogram\n .command(\"build\")\n .description(\"Build your Arkos project\")\n .option(\"-m, --module <type>\", \"Module type (cjs or esm)\", \"cjs\")\n .action(buildCommand);\n\nprogram\n .command(\"dev\")\n .description(\"Run development server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(devCommand);\n\nprogram\n .command(\"start\")\n .description(\"Run production server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(startCommand);\n\nconst generate = program\n .command(\"generate\")\n .alias(\"g\")\n .description(\"Generate arkos components\")\n .option(\"-m, --module <name>\", \"Module name\")\n .option(\"--model <name>\", \"Module name (alias for --module)\")\n .option(\"-p, --path <path>\", \"Custom path for the component\")\n .option(\"-o, --overwrite\", \"Overwrites all the content on the existing file\");\n\ngenerate\n .command(\"controller\")\n .alias(\"c\")\n .description(\"Generate a new controller\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.controller({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"service\")\n .alias(\"s\")\n .description(\"Generate a new service\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.service({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"router\")\n .alias(\"r\")\n .description(\"Generate a new router\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.router({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"auth-configs\")\n .alias(\"a\")\n .description(\"Generate auth configuration\")\n .option(\"-a, --advanced\", \"Advanced code structure\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.authConfigs({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-options\")\n .alias(\"q\")\n .description(\"Generate prisma query options\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryOptions({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"interceptors\")\n .alias(\"i\")\n .description(\"Generate a new interceptors file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.interceptors({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"hooks\")\n .alias(\"h\")\n .description(\"Generate a new service hooks file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.hooks({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-schema\")\n .alias(\"cs\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-schema\")\n .alias(\"us\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"schema\")\n .alias(\"sc\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-schema\")\n .alias(\"qs\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.querySchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-dto\")\n .alias(\"cd\")\n .description(\n \"Generate a new class-validator create dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-dto\")\n .alias(\"ud\")\n .description(\n \"Generate a new class-validator update dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"dto\")\n .alias(\"d\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-dto\")\n .alias(\"qd\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"model\")\n .alias(\"m\")\n .description(\"Generate a new prisma model\")\n .option(\"-p, --path <path>\", \"Custom path for prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.prismaModel({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"components\")\n .alias(\"co\")\n .description(\"Generate multiple components for a module\")\n .option(\"-a, --all\", \"Generate all components\")\n .option(\n \"-n, --names <names>\",\n \"Comma-separated list of components (e.g., s,sc,m or service,schema,model)\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.multipleComponents({ ...generateOptions, ...options });\n });\n\nprogram\n .command(\"prisma\")\n .command(\"generate\")\n .description(\"Generate your @prisma/client and BaseService class types\")\n .action(prismaGenerateCommand);\n\nprogram\n .command(\"export\")\n .command(\"auth-action\")\n .description(\"Export file with an array containing all auth-actions\")\n .option(\"-o, --overwrite\", \"Overwrites all the changes on the object\")\n .option(\n \"-p, --path <path>\",\n \"Custom path for auth-actions\",\n \"src/modules/auth/utils\"\n )\n .action(exportAuthActionCommand);\n\nprogram.parse(process.argv);\n\nexport { program, buildCommand, devCommand, startCommand, generateCommand };\n"]}
@@ -19,6 +19,6 @@ function killServerChildProcess() {
19
19
  (0, start_1.killProductionServerChildProcess)();
20
20
  }
21
21
  function getVersion() {
22
- return "1.5.16-beta";
22
+ return "1.5.17-beta";
23
23
  }
24
24
  //# sourceMappingURL=cli.helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"class-validator-to-json-schema.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/class-validator-to-json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,cAA8C;IAE9C,MAAM,WAAW,GAAG,4BAA4B,CAAC;QAC/C,6BAA6B,EAAE,kBAAkB,EAAE;QACnD,+BAA+B,EAAE,sBAAsB;QACvD,gBAAgB,EAAE,uBAAuB;KAC1C,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEtD,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAE/B,OAAO,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,MAAW,EACX,UAA+B,EAC/B,UAAU,IAAI,GAAG,EAAU;IAE3B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAEzD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE/C,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YACtB,OAAO;gBACL,YAAY,EAAE,OAA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js/storage.js\";\nimport { validationMetadatasToSchemas } from \"class-validator-jsonschema\";\n\nexport default function classValidatorToJsonSchema(\n decoratedClass: new (...args: any[]) => object\n): any {\n const jsonSchemas = validationMetadatasToSchemas({\n classValidatorMetadataStorage: getMetadataStorage(),\n classTransformerMetadataStorage: defaultMetadataStorage,\n refPointerPrefix: \"#/components/schemas/\",\n });\n\n const targetSchema = jsonSchemas[decoratedClass.name];\n\n if (!targetSchema) return null;\n\n return resolveReferences(targetSchema, jsonSchemas);\n}\n\nexport function resolveReferences(\n schema: any,\n allSchemas: Record<string, any>,\n visited = new Set<string>()\n): any {\n if (!schema || typeof schema !== \"object\") return schema;\n\n if (schema.$ref) {\n const refName = extractSchemaName(schema.$ref);\n\n if (visited.has(refName))\n return {\n $resolvedRef: refName,\n description: `Circular reference to ${refName}`,\n };\n\n const referencedSchema = allSchemas[refName];\n if (referencedSchema) {\n visited.add(refName);\n const resolved = resolveReferences(referencedSchema, allSchemas, visited);\n visited.delete(refName);\n\n const { $ref, ...rest } = schema;\n return { ...resolved, ...rest };\n }\n\n return schema;\n }\n\n if (Array.isArray(schema)) {\n return schema.map((item) => resolveReferences(item, allSchemas, visited));\n }\n\n const result: any = {};\n for (const [key, value] of Object.entries(schema)) {\n result[key] = resolveReferences(value, allSchemas, visited);\n }\n\n return result;\n}\n\nexport function extractSchemaName(ref: string): string {\n const parts = ref.split(\"/\");\n return parts[parts.length - 1];\n}\n"]}
1
+ {"version":3,"file":"class-validator-to-json-schema.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/class-validator-to-json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,cAA8C;IAE9C,MAAM,WAAW,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CAAC;QAC1B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { getMetadataStorage } from \"class-validator\";\nimport { defaultMetadataStorage } from \"class-transformer/cjs/storage.js\";\nimport { validationMetadatasToSchemas } from \"class-validator-jsonschema\";\n\nexport default function classValidatorToJsonSchema(\n decoratedClass: new (...args: any[]) => object\n): any {\n const jsonSchemas = validationMetadatasToSchemas({\n classValidatorMetadataStorage: getMetadataStorage() as any, // FIXME: dummy typing because of updates\n classTransformerMetadataStorage: defaultMetadataStorage,\n refPointerPrefix: \"#/components/schemas/\",\n });\n\n const targetSchema = jsonSchemas[decoratedClass.name];\n\n if (!targetSchema) return null;\n\n return resolveReferences(targetSchema, jsonSchemas);\n}\n\nexport function resolveReferences(\n schema: any,\n allSchemas: Record<string, any>,\n visited = new Set<string>()\n): any {\n if (!schema || typeof schema !== \"object\") return schema;\n\n if (schema.$ref) {\n const refName = extractSchemaName(schema.$ref);\n\n if (visited.has(refName))\n return {\n $resolvedRef: refName,\n description: `Circular reference to ${refName}`,\n };\n\n const referencedSchema = allSchemas[refName];\n if (referencedSchema) {\n visited.add(refName);\n const resolved = resolveReferences(referencedSchema, allSchemas, visited);\n visited.delete(refName);\n\n const { $ref, ...rest } = schema;\n return { ...resolved, ...rest };\n }\n\n return schema;\n }\n\n if (Array.isArray(schema)) {\n return schema.map((item) => resolveReferences(item, allSchemas, visited));\n }\n\n const result: any = {};\n for (const [key, value] of Object.entries(schema)) {\n result[key] = resolveReferences(value, allSchemas, visited);\n }\n\n return result;\n}\n\nexport function extractSchemaName(ref: string): string {\n const parts = ref.split(\"/\");\n return parts[parts.length - 1];\n}\n"]}
@@ -72,7 +72,7 @@ async function initApp(initConfig = {}) {
72
72
  }
73
73
  }
74
74
  process.on("unhandledRejection", (err) => {
75
- if (process.env.NO_CLI === "true")
75
+ if (process.env.NO_CLI === "true" && process.env.__SKIP_LISTEN !== "true")
76
76
  sheu.error("UNHANDLED REJECTION! SHUTTING DOWN...\n", {
77
77
  timestamp: true,
78
78
  bold: true,
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,mBAAmB,MAAM,yCAAyC,CAAC;AAO1E,MAAM,UAAU,cAAc;IAE5B,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;IACtC,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO;IAE1C,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM;QAC/B,IAAI,CAAC,KAAK,CA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,OAAO,EAAE,CAAC","sourcesContent":["import { IncomingMessage, Server, ServerResponse } from \"http\";\nimport AppError from \"./modules/error-handler/utils/app-error\";\nimport { Express } from \"express\";\nimport { bootstrap } from \"./app\";\nimport http from \"http\";\nimport sheu from \"./utils/sheu\";\nimport portAndHostAllocator from \"./utils/features/port-and-host-allocator\";\nimport { ArkosConfig } from \"./types/new-arkos-config\";\nimport { ArkosInitConfig } from \"./types/arkos-config\";\nimport { getArkosConfig as getArkosConfigHelper } from \"./utils/helpers/arkos-config.helpers\";\nimport runtimeCliCommander from \"./utils/cli/utils/runtime-cli-commander\";\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): ArkosConfig {\n // This was kept only not to require many changes on the given time\n return getArkosConfigHelper();\n}\n\nprocess.on(\"uncaughtException\", (err) => {\n if (err.message.includes(\"EPIPE\")) return;\n\n if (process.env.NO_CLI === \"true\")\n sheu.error(\"UNCAUGHT EXCEPTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n\n console.error(err);\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nlet server: Server<typeof IncomingMessage, typeof ServerResponse>;\nlet _app: Express;\n\n/**\n * Initializes the application server.\n *\n * This function starts the server by listening on a specified port.\n * The port is determined by the following order of precedence:\n * 1. The `port` argument passed to the function.\n * 2. Defaults to `8000` if neither is provided.\n *\n * @param {ArkosInitConfig} initConfig - initial configs for the api ( authentication, port).\n * @returns {Promise<Express>} This function returns the Express App after all middlewares configurations.\n * You can prevent it from listen py passing port as undefined\n *\n */\nasync function initApp(\n initConfig: ArkosInitConfig = {}\n): Promise<Express | undefined> {\n try {\n const arkosConfig = getArkosConfig();\n\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n\n let networkHost = portAndHostAllocator.getFirstNonLocalIp();\n\n _app = await bootstrap(initConfig);\n const time = new Date().toTimeString().split(\" \")[0];\n const cliCommand = process.env.CLI_COMMAND;\n\n if (\n !cliCommand &&\n ((\"port\" in arkosConfig && arkosConfig?.port !== undefined) ||\n !(\"port\" in arkosConfig))\n ) {\n server = http.createServer(_app);\n\n if (initConfig?.configureServer) await initConfig.configureServer(server);\n\n process.send?.({ started: true });\n if (process.env.__SKIP_LISTEN !== \"true\")\n server.listen(\n Number(portAndHost?.port),\n portAndHost.host! === \"localhost\" ? \"127.0.0.1\" : portAndHost.host!,\n () => {\n const host = [\"0.0.0.0\", \"127.0.0.1\"].includes(portAndHost?.host)\n ? \"localhost\"\n : portAndHost?.host;\n\n const message = `${sheu.gray(time)} {{server}} waiting on http://${host}:${portAndHost?.port}`;\n\n sheu.ready(\n message.replace(\n \"{{server}}\",\n `${process.env.ARKOS_BUILD === \"true\" ? \"Production\" : \"Development\"} server`\n )\n );\n if (networkHost && portAndHost.host === \"0.0.0.0\")\n sheu.ready(\n message\n .replace(host, networkHost)\n .replace(\"{{server}}\", `Network server`)\n );\n if (\n arkosConfig?.swagger?.mode &&\n ((arkosConfig?.swagger?.enableAfterBuild &&\n process.env.ARKOS_BUILD === \"true\") ||\n process.env.ARKOS_BUILD !== \"true\")\n )\n sheu.ready(\n `${message.replace(\"{{server}}\", \"Documentation\")}${arkosConfig?.swagger?.endpoint || \"/api/docs\"}`\n );\n }\n );\n } else if (!cliCommand) {\n sheu.warn(\n `${sheu.gray(time)} Port set to undefined, hence no internal http server was setup.`\n );\n } else if (cliCommand) runtimeCliCommander.handle();\n\n return _app;\n } catch (err: any) {\n sheu.error(\n err?.message || \"Something went wrong while starting your application!\"\n );\n console.error(err);\n throw err;\n }\n}\n\nprocess.on(\"unhandledRejection\", (err: AppError) => {\n if (process.env.NO_CLI === \"true\")\n sheu.error(\"UNHANDLED REJECTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n console.error(err);\n\n if (server?.close)\n server?.close(() => {\n process.exit(1);\n });\n else\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nexport function getExpressApp() {\n return _app;\n}\n\nexport { server, initApp };\n"]}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,mBAAmB,MAAM,yCAAyC,CAAC;AAO1E,MAAM,UAAU,cAAc;IAE5B,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;IACtC,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO;IAE1C,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM;QAC/B,IAAI,CAAC,KAAK,CAAC,wCAAwC,EAAE;YACnD,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IAEL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC;AAEH,IAAI,MAA6D,CAAC;AAClE,IAAI,IAAa,CAAC;AAelB,KAAK,UAAU,OAAO,CACpB,aAA8B,EAAE;IAEhC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;QAErC,MAAM,WAAW,GAAG;YAClB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO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CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,GAAa,EAAE,EAAE;IACjD,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM;QACvE,IAAI,CAAC,KAAK,CAAC,yCAAyC,EAAE;YACpD,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEnB,IAAI,MAAM,EAAE,KAAK;QACf,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;;QAEH,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { IncomingMessage, Server, ServerResponse } from \"http\";\nimport AppError from \"./modules/error-handler/utils/app-error\";\nimport { Express } from \"express\";\nimport { bootstrap } from \"./app\";\nimport http from \"http\";\nimport sheu from \"./utils/sheu\";\nimport portAndHostAllocator from \"./utils/features/port-and-host-allocator\";\nimport { ArkosConfig } from \"./types/new-arkos-config\";\nimport { ArkosInitConfig } from \"./types/arkos-config\";\nimport { getArkosConfig as getArkosConfigHelper } from \"./utils/helpers/arkos-config.helpers\";\nimport runtimeCliCommander from \"./utils/cli/utils/runtime-cli-commander\";\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): ArkosConfig {\n // This was kept only not to require many changes on the given time\n return getArkosConfigHelper();\n}\n\nprocess.on(\"uncaughtException\", (err) => {\n if (err.message.includes(\"EPIPE\")) return;\n\n if (process.env.NO_CLI === \"true\")\n sheu.error(\"UNCAUGHT EXCEPTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n\n console.error(err);\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nlet server: Server<typeof IncomingMessage, typeof ServerResponse>;\nlet _app: Express;\n\n/**\n * Initializes the application server.\n *\n * This function starts the server by listening on a specified port.\n * The port is determined by the following order of precedence:\n * 1. The `port` argument passed to the function.\n * 2. Defaults to `8000` if neither is provided.\n *\n * @param {ArkosInitConfig} initConfig - initial configs for the api ( authentication, port).\n * @returns {Promise<Express>} This function returns the Express App after all middlewares configurations.\n * You can prevent it from listen py passing port as undefined\n *\n */\nasync function initApp(\n initConfig: ArkosInitConfig = {}\n): Promise<Express | undefined> {\n try {\n const arkosConfig = getArkosConfig();\n\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n\n let networkHost = portAndHostAllocator.getFirstNonLocalIp();\n\n _app = await bootstrap(initConfig);\n const time = new Date().toTimeString().split(\" \")[0];\n const cliCommand = process.env.CLI_COMMAND;\n\n if (\n !cliCommand &&\n ((\"port\" in arkosConfig && arkosConfig?.port !== undefined) ||\n !(\"port\" in arkosConfig))\n ) {\n server = http.createServer(_app);\n\n if (initConfig?.configureServer) await initConfig.configureServer(server);\n\n process.send?.({ started: true });\n if (process.env.__SKIP_LISTEN !== \"true\")\n server.listen(\n Number(portAndHost?.port),\n portAndHost.host! === \"localhost\" ? \"127.0.0.1\" : portAndHost.host!,\n () => {\n const host = [\"0.0.0.0\", \"127.0.0.1\"].includes(portAndHost?.host)\n ? \"localhost\"\n : portAndHost?.host;\n\n const message = `${sheu.gray(time)} {{server}} waiting on http://${host}:${portAndHost?.port}`;\n\n sheu.ready(\n message.replace(\n \"{{server}}\",\n `${process.env.ARKOS_BUILD === \"true\" ? \"Production\" : \"Development\"} server`\n )\n );\n if (networkHost && portAndHost.host === \"0.0.0.0\")\n sheu.ready(\n message\n .replace(host, networkHost)\n .replace(\"{{server}}\", `Network server`)\n );\n if (\n arkosConfig?.swagger?.mode &&\n ((arkosConfig?.swagger?.enableAfterBuild &&\n process.env.ARKOS_BUILD === \"true\") ||\n process.env.ARKOS_BUILD !== \"true\")\n )\n sheu.ready(\n `${message.replace(\"{{server}}\", \"Documentation\")}${arkosConfig?.swagger?.endpoint || \"/api/docs\"}`\n );\n }\n );\n } else if (!cliCommand) {\n sheu.warn(\n `${sheu.gray(time)} Port set to undefined, hence no internal http server was setup.`\n );\n } else if (cliCommand) runtimeCliCommander.handle();\n\n return _app;\n } catch (err: any) {\n sheu.error(\n err?.message || \"Something went wrong while starting your application!\"\n );\n console.error(err);\n throw err;\n }\n}\n\nprocess.on(\"unhandledRejection\", (err: AppError) => {\n if (process.env.NO_CLI === \"true\" && process.env.__SKIP_LISTEN !== \"true\")\n sheu.error(\"UNHANDLED REJECTION! SHUTTING DOWN...\\n\", {\n timestamp: true,\n bold: true,\n });\n console.error(err);\n\n if (server?.close)\n server?.close(() => {\n process.exit(1);\n });\n else\n setTimeout(() => {\n process.exit(1);\n }, 0);\n});\n\nexport function getExpressApp() {\n return _app;\n}\n\nexport { server, initApp };\n"]}
@@ -24,9 +24,7 @@ program
24
24
  .description("Run production server")
25
25
  .option("-p, --port <number>", "Port number")
26
26
  .option("-h, --host <host>", "Host to bind to")
27
- .action(() => {
28
- startCommand();
29
- });
27
+ .action(startCommand);
30
28
  const generate = program
31
29
  .command("generate")
32
30
  .alias("g")
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,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EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { Command } from \"commander\";\nimport { buildCommand } from \"./build\";\nimport { devCommand } from \"./dev\";\nimport { startCommand } from \"./start\";\nimport { generateCommand } from \"./generate\";\nimport { getVersion } from \"./utils/cli.helpers\";\nimport prismaGenerateCommand from \"./prisma-generate\";\nimport exportAuthActionCommand from \"./export-auth-action\";\n\nconst program = new Command();\n\nprogram.name(\"arkos\").description(\"Arkos.js CLI\").version(getVersion());\n\nprogram\n .command(\"build\")\n .description(\"Build your Arkos project\")\n .option(\"-m, --module <type>\", \"Module type (cjs or esm)\", \"cjs\")\n .action(buildCommand);\n\nprogram\n .command(\"dev\")\n .description(\"Run development server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(devCommand);\n\nprogram\n .command(\"start\")\n .description(\"Run production server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(() => {\n startCommand();\n });\n\nconst generate = program\n .command(\"generate\")\n .alias(\"g\")\n .description(\"Generate arkos components\")\n .option(\"-m, --module <name>\", \"Module name\")\n .option(\"--model <name>\", \"Module name (alias for --module)\")\n .option(\"-p, --path <path>\", \"Custom path for the component\")\n .option(\"-o, --overwrite\", \"Overwrites all the content on the existing file\");\n\ngenerate\n .command(\"controller\")\n .alias(\"c\")\n .description(\"Generate a new controller\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.controller({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"service\")\n .alias(\"s\")\n .description(\"Generate a new service\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.service({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"router\")\n .alias(\"r\")\n .description(\"Generate a new router\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.router({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"auth-configs\")\n .alias(\"a\")\n .description(\"Generate auth configuration\")\n .option(\"-a, --advanced\", \"Advanced code structure\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.authConfigs({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-options\")\n .alias(\"q\")\n .description(\"Generate prisma query options\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryOptions({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"interceptors\")\n .alias(\"i\")\n .description(\"Generate a new interceptors file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.interceptors({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"hooks\")\n .alias(\"h\")\n .description(\"Generate a new service hooks file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.hooks({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-schema\")\n .alias(\"cs\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-schema\")\n .alias(\"us\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"schema\")\n .alias(\"sc\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-schema\")\n .alias(\"qs\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.querySchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-dto\")\n .alias(\"cd\")\n .description(\n \"Generate a new class-validator create dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-dto\")\n .alias(\"ud\")\n .description(\n \"Generate a new class-validator update dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"dto\")\n .alias(\"d\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-dto\")\n .alias(\"qd\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"model\")\n .alias(\"m\")\n .description(\"Generate a new prisma model\")\n .option(\"-p, --path <path>\", \"Custom path for prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.prismaModel({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"components\")\n .alias(\"co\")\n .description(\"Generate multiple components for a module\")\n .option(\"-a, --all\", \"Generate all components\")\n .option(\n \"-n, --names <names>\",\n \"Comma-separated list of components (e.g., s,sc,m or service,schema,model)\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.multipleComponents({ ...generateOptions, ...options });\n });\n\nprogram\n .command(\"prisma\")\n .command(\"generate\")\n .description(\"Generate your @prisma/client and BaseService class types\")\n .action(prismaGenerateCommand);\n\nprogram\n .command(\"export\")\n .command(\"auth-action\")\n .description(\"Export file with an array containing all auth-actions\")\n .option(\"-o, --overwrite\", \"Overwrites all the changes on the object\")\n .option(\n \"-p, --path <path>\",\n \"Custom path for auth-actions\",\n \"src/modules/auth/utils\"\n )\n .action(exportAuthActionCommand);\n\nprogram.parse(process.argv);\n\nexport { program, buildCommand, devCommand, startCommand, generateCommand };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAA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C3D,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;IAClB,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxC,eAAe,CAAC,WAAW,CAAC,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEL,QAAQ;KACL,OAAO,CAAC,YAAY,CAAC;KACrB,KAAK,CAAC,IAAI,CAAC;KACX,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,WAAW,EAAE,yBAAyB,CAAC;KAC9C,MAAM,CACL,qBAAqB,EACrB,2EAA2E,CAC5E;KACA,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;IAClB,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxC,eAAe,CAAC,kBAAkB,CAAC,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,0DAA0D,CAAC;KACvE,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjC,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,OAAO,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,uDAAuD,CAAC;KACpE,MAAM,CAAC,iBAAiB,EAAE,0CAA0C,CAAC;KACrE,MAAM,CACL,mBAAmB,EACnB,8BAA8B,EAC9B,wBAAwB,CACzB;KACA,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAEnC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { Command } from \"commander\";\nimport { buildCommand } from \"./build\";\nimport { devCommand } from \"./dev\";\nimport { startCommand } from \"./start\";\nimport { generateCommand } from \"./generate\";\nimport { getVersion } from \"./utils/cli.helpers\";\nimport prismaGenerateCommand from \"./prisma-generate\";\nimport exportAuthActionCommand from \"./export-auth-action\";\n\nconst program = new Command();\n\nprogram.name(\"arkos\").description(\"Arkos.js CLI\").version(getVersion());\n\nprogram\n .command(\"build\")\n .description(\"Build your Arkos project\")\n .option(\"-m, --module <type>\", \"Module type (cjs or esm)\", \"cjs\")\n .action(buildCommand);\n\nprogram\n .command(\"dev\")\n .description(\"Run development server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(devCommand);\n\nprogram\n .command(\"start\")\n .description(\"Run production server\")\n .option(\"-p, --port <number>\", \"Port number\")\n .option(\"-h, --host <host>\", \"Host to bind to\")\n .action(startCommand);\n\nconst generate = program\n .command(\"generate\")\n .alias(\"g\")\n .description(\"Generate arkos components\")\n .option(\"-m, --module <name>\", \"Module name\")\n .option(\"--model <name>\", \"Module name (alias for --module)\")\n .option(\"-p, --path <path>\", \"Custom path for the component\")\n .option(\"-o, --overwrite\", \"Overwrites all the content on the existing file\");\n\ngenerate\n .command(\"controller\")\n .alias(\"c\")\n .description(\"Generate a new controller\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.controller({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"service\")\n .alias(\"s\")\n .description(\"Generate a new service\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.service({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"router\")\n .alias(\"r\")\n .description(\"Generate a new router\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.router({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"auth-configs\")\n .alias(\"a\")\n .description(\"Generate auth configuration\")\n .option(\"-a, --advanced\", \"Advanced code structure\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.authConfigs({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-options\")\n .alias(\"q\")\n .description(\"Generate prisma query options\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryOptions({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"interceptors\")\n .alias(\"i\")\n .description(\"Generate a new interceptors file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.interceptors({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"hooks\")\n .alias(\"h\")\n .description(\"Generate a new service hooks file\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.hooks({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-schema\")\n .alias(\"cs\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-schema\")\n .alias(\"us\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"schema\")\n .alias(\"sc\")\n .description(\"Generate a new zod create schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseSchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-schema\")\n .alias(\"qs\")\n .description(\"Generate a new zod update schema file for a prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.querySchema({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"create-dto\")\n .alias(\"cd\")\n .description(\n \"Generate a new class-validator create dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.createDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"update-dto\")\n .alias(\"ud\")\n .description(\n \"Generate a new class-validator update dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.updateDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"dto\")\n .alias(\"d\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.baseDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"query-dto\")\n .alias(\"qd\")\n .description(\n \"Generate a new class-validator base dto file for a prisma model\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.queryDto({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"model\")\n .alias(\"m\")\n .description(\"Generate a new prisma model\")\n .option(\"-p, --path <path>\", \"Custom path for prisma model\")\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.prismaModel({ ...generateOptions, ...options });\n });\n\ngenerate\n .command(\"components\")\n .alias(\"co\")\n .description(\"Generate multiple components for a module\")\n .option(\"-a, --all\", \"Generate all components\")\n .option(\n \"-n, --names <names>\",\n \"Comma-separated list of components (e.g., s,sc,m or service,schema,model)\"\n )\n .action((options) => {\n const generateOptions = generate.opts();\n generateCommand.multipleComponents({ ...generateOptions, ...options });\n });\n\nprogram\n .command(\"prisma\")\n .command(\"generate\")\n .description(\"Generate your @prisma/client and BaseService class types\")\n .action(prismaGenerateCommand);\n\nprogram\n .command(\"export\")\n .command(\"auth-action\")\n .description(\"Export file with an array containing all auth-actions\")\n .option(\"-o, --overwrite\", \"Overwrites all the changes on the object\")\n .option(\n \"-p, --path <path>\",\n \"Custom path for auth-actions\",\n \"src/modules/auth/utils\"\n )\n .action(exportAuthActionCommand);\n\nprogram.parse(process.argv);\n\nexport { program, buildCommand, devCommand, startCommand, generateCommand };\n"]}
@@ -11,6 +11,6 @@ export function killServerChildProcess() {
11
11
  killProductionServerChildProcess();
12
12
  }
13
13
  export function getVersion() {
14
- return "1.5.16-beta";
14
+ return "1.5.17-beta";
15
15
  }
16
16
  //# sourceMappingURL=cli.helpers.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkos",
3
- "version": "1.5.16-beta",
3
+ "version": "1.5.17-beta",
4
4
  "description": "The Express & Prisma RESTful Framework",
5
5
  "main": "dist/cjs/exports/index.js",
6
6
  "module": "dist/esm/exports/index.js",