@autobe/compiler 0.24.1 → 0.25.0

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,8 +1,8 @@
1
- import { IAutoBeRealizeCompiler, IAutoBeRealizeCompilerListener, IAutoBeRealizeControllerProps, IAutoBeRealizeTestProps, IAutoBeRealizeTestResult } from "@autobe/interface";
1
+ import { IAutoBeGetFilesOptions, IAutoBeRealizeCompiler, IAutoBeRealizeCompilerListener, IAutoBeRealizeControllerProps, IAutoBeRealizeTestProps, IAutoBeRealizeTestResult } from "@autobe/interface";
2
2
  export declare class AutoBeRealizeCompiler implements IAutoBeRealizeCompiler {
3
3
  private readonly listener;
4
4
  constructor(listener: IAutoBeRealizeCompilerListener);
5
5
  controller(props: IAutoBeRealizeControllerProps): Promise<Record<string, string>>;
6
6
  test(props: IAutoBeRealizeTestProps): Promise<IAutoBeRealizeTestResult>;
7
- getTemplate(): Promise<Record<string, string>>;
7
+ getTemplate(options: IAutoBeGetFilesOptions): Promise<Record<string, string>>;
8
8
  }
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AutoBeRealizeCompiler = void 0;
13
13
  const AutoBeCompilerInterfaceTemplate_1 = require("../raw/AutoBeCompilerInterfaceTemplate");
14
14
  const AutoBeCompilerRealizeTemplate_1 = require("../raw/AutoBeCompilerRealizeTemplate");
15
+ const AutoBeCompilerRealizeTemplateOfPostgres_1 = require("../raw/AutoBeCompilerRealizeTemplateOfPostgres");
16
+ const AutoBeCompilerRealizeTemplateOfSQLite_1 = require("../raw/AutoBeCompilerRealizeTemplateOfSQLite");
15
17
  const AutoBeCompilerTestTemplate_1 = require("../raw/AutoBeCompilerTestTemplate");
16
18
  const FilePrinter_1 = require("../utils/FilePrinter");
17
19
  const testRealizeProject_1 = require("./testRealizeProject");
@@ -31,9 +33,13 @@ class AutoBeRealizeCompiler {
31
33
  test(props) {
32
34
  return (0, testRealizeProject_1.testRealizeProject)(Object.assign(Object.assign({}, props), { files: Object.assign(Object.assign({}, props.files), AutoBeCompilerRealizeTemplate_1.AutoBeCompilerRealizeTemplate) }), this.listener.test);
33
35
  }
34
- getTemplate() {
36
+ getTemplate(options) {
35
37
  return __awaiter(this, void 0, void 0, function* () {
36
- return Object.assign(Object.assign(Object.assign({}, AutoBeCompilerInterfaceTemplate_1.AutoBeCompilerInterfaceTemplate), AutoBeCompilerTestTemplate_1.AutoBeCompilerTestTemplate), AutoBeCompilerRealizeTemplate_1.AutoBeCompilerRealizeTemplate);
38
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, AutoBeCompilerInterfaceTemplate_1.AutoBeCompilerInterfaceTemplate), AutoBeCompilerTestTemplate_1.AutoBeCompilerTestTemplate), AutoBeCompilerRealizeTemplate_1.AutoBeCompilerRealizeTemplate), (options.dbms === "postgres"
39
+ ? AutoBeCompilerRealizeTemplateOfPostgres_1.AutoBeCompilerRealizeTemplateOfPostgres
40
+ : {})), (options.dbms === "sqlite"
41
+ ? AutoBeCompilerRealizeTemplateOfSQLite_1.AutoBeCompilerRealizeTemplateOfSQLite
42
+ : {}));
37
43
  });
38
44
  }
39
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AutoBeRealizeCompiler.js","sourceRoot":"","sources":["../../src/realize/AutoBeRealizeCompiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,4FAAyF;AACzF,wFAAqF;AACrF,kFAA+E;AAC/E,sDAAmD;AACnD,6DAA0D;AAC1D,uEAAoE;AAEpE,MAAa,qBAAqB;IAChC,YACmB,QAAwC;QAAxC,aAAQ,GAAR,QAAQ,CAAgC;IACxD,CAAC;IAES,UAAU,CACrB,KAAoC;;YAEpC,MAAM,MAAM,GAA2B,MAAM,IAAA,iDAAuB,EAAC,KAAK,CAAC,CAAC;YAC5E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,yBAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;IAEM,IAAI,CACT,KAA8B;QAE9B,OAAO,IAAA,uCAAkB,kCAElB,KAAK,KACR,KAAK,kCACA,KAAK,CAAC,KAAK,GACX,6DAA6B,MAGpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CACnB,CAAC;IACJ,CAAC;IAEY,WAAW;;YACtB,qDACK,iEAA+B,GAC/B,uDAA0B,GAC1B,6DAA6B,EAChC;QACJ,CAAC;KAAA;CACF;AApCD,sDAoCC"}
1
+ {"version":3,"file":"AutoBeRealizeCompiler.js","sourceRoot":"","sources":["../../src/realize/AutoBeRealizeCompiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA,4FAAyF;AACzF,wFAAqF;AACrF,4GAAyG;AACzG,wGAAqG;AACrG,kFAA+E;AAC/E,sDAAmD;AACnD,6DAA0D;AAC1D,uEAAoE;AAEpE,MAAa,qBAAqB;IAChC,YACmB,QAAwC;QAAxC,aAAQ,GAAR,QAAQ,CAAgC;IACxD,CAAC;IAES,UAAU,CACrB,KAAoC;;YAEpC,MAAM,MAAM,GAA2B,MAAM,IAAA,iDAAuB,EAAC,KAAK,CAAC,CAAC;YAC5E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,yBAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;IAEM,IAAI,CACT,KAA8B;QAE9B,OAAO,IAAA,uCAAkB,kCAElB,KAAK,KACR,KAAK,kCACA,KAAK,CAAC,KAAK,GACX,6DAA6B,MAGpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CACnB,CAAC;IACJ,CAAC;IAEY,WAAW,CACtB,OAA+B;;YAE/B,iFACK,iEAA+B,GAC/B,uDAA0B,GAC1B,6DAA6B,GAC7B,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU;gBAC7B,CAAC,CAAC,iFAAuC;gBACzC,CAAC,CAAC,EAAE,CAAC,GACJ,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;gBAC3B,CAAC,CAAC,6EAAqC;gBACvC,CAAC,CAAC,EAAE,CAAC,EACP;QACJ,CAAC;KAAA;CACF;AA5CD,sDA4CC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobe/compiler",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "description": "AI backend server code generator",
5
5
  "main": "lib/index.js",
6
6
  "author": "Wrtn Technologies",
@@ -20,7 +20,7 @@
20
20
  "@typescript-eslint/eslint-plugin": "8.40.0",
21
21
  "@typescript-eslint/parser": "8.40.0",
22
22
  "embed-eslint": "^2.0.1",
23
- "embed-prisma": "^1.1.1",
23
+ "embed-prisma": "^1.1.2",
24
24
  "embed-typescript": "^2.0.1",
25
25
  "eslint": "9.34.0",
26
26
  "import2": "^1.0.3",
@@ -30,9 +30,9 @@
30
30
  "tgrid": "^1.2.0",
31
31
  "tstl": "^3.0.0",
32
32
  "typia": "^9.7.2",
33
- "@autobe/utils": "^0.24.1",
34
- "@autobe/filesystem": "^0.24.1",
35
- "@autobe/interface": "^0.24.1"
33
+ "@autobe/filesystem": "^0.25.0",
34
+ "@autobe/utils": "^0.25.0",
35
+ "@autobe/interface": "^0.25.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.15.3",
@@ -382,8 +382,8 @@ const POSTGRES_PHYSICAL_TYPES = {
382
382
  const POSTGRES_MAIN_FILE = StringUtil.trim`
383
383
  generator client {
384
384
  provider = "prisma-client-js"
385
+ engineType = "client"
385
386
  previewFeatures = ["postgresqlExtensions", "views"]
386
- binaryTargets = ["native"]
387
387
  }
388
388
  datasource db {
389
389
  provider = "postgresql"
@@ -397,11 +397,12 @@ const POSTGRES_MAIN_FILE = StringUtil.trim`
397
397
  `;
398
398
  const SQLITE_MAIN_FILE = StringUtil.trim`
399
399
  generator client {
400
- provider = "prisma-client-js"
400
+ provider = "prisma-client-js"
401
+ engineType = "client"
401
402
  }
402
403
  datasource db {
403
404
  provider = "sqlite"
404
- url = "file:../../data.db"
405
+ url = "file:../db.sqlite"
405
406
  }
406
407
  generator markdown {
407
408
  provider = "prisma-markdown"
@@ -1,10 +1,9 @@
1
1
  export const AutoBeCompilerRealizeTemplate: Record<string, string> = {
2
2
  ".env.local": "API_PORT=37001\nJWT_SECRET_KEY=your_jwt_secret_key",
3
3
  ".gitignore": "bin/\ndist/\nlib/\nnode_modules/\n\nprisma/migrations\nprisma/schema/migrations\nprisma/bbs.db\n\n*.DS_Store\npackage-lock.json\npnpm-lock.yaml\n.npmrc",
4
- "package.json": "{\n \"private\": true,\n \"name\": \"@ORGANIZATION/PROJECT\",\n \"version\": \"0.1.0\",\n \"description\": \"Starter kit of Nestia\",\n \"main\": \"lib/index.js\",\n \"scripts\": {\n \"benchmark\": \"node bin/test/benchmark\",\n \"test\": \"node bin/test\",\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------BUILDS------------------------\": \"\",\n \"build\": \"npm run build:prisma && npm run build:sdk && npm run build:main && npm run build:test\",\n \"build:api\": \"rimraf packages/api/lib && nestia all && rimraf packages/api/lib && tsc -p packages/api/tsconfig.json && rollup -c packages/api/rollup.config.js\",\n \"build:env\": \"ts-node build/env.ts\",\n \"build:main\": \"rimraf lib && tsc\",\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\n \"build:prisma\": \"prisma generate --schema prisma/schema\",\n \"build:swagger\": \"nestia swagger\",\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\n \"dev\": \"npm run build:test -- --watch\",\n \"eslint\": \"eslint src && eslint test\",\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\n \"prepare\": \"ts-patch install && npm run build:env && npm run build:prisma\",\n \"prettier\": \"prettier src --write && prettier test --write\",\n \"------------------------WEBPACK------------------------\": \"\",\n \"webpack\": \"rimraf dist && webpack\",\n \"webpack:start\": \"cd dist && node dist/server\",\n \"webpack:test\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------DEPLOYS------------------------\": \"\",\n \"package:api\": \"npm run build:api && cd packages/api && npm publish\",\n \"start\": \"node lib/executable/server\",\n \"start:dev\": \"nest start --watch\",\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia-start\"\n },\n \"keywords\": [\n \"nestia\",\n \"template\",\n \"boilerplate\"\n ],\n \"author\": \"AUTHOR\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\n },\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\n \"devDependencies\": {\n \"@autobe/interface\": \"^0.10.6\",\n \"@nestia/benchmark\": \"^8.0.7\",\n \"@nestia/e2e\": \"^8.0.7\",\n \"@nestia/sdk\": \"^8.0.7\",\n \"@nestjs/cli\": \"^11.0.7\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/bcryptjs\": \"^3.0.0\",\n \"@types/cli\": \"^0.11.21\",\n \"@types/cli-progress\": \"^3.11.5\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"^8.2.5\",\n \"@types/jsonwebtoken\": \"^9.0.5\",\n \"@types/node\": \"^18.11.0\",\n \"@types/uuid\": \"^8.3.4\",\n \"@typescript-eslint/eslint-plugin\": \"^8.1.0\",\n \"@typescript-eslint/parser\": \"^8.1.0\",\n \"chalk\": \"^4.1.2\",\n \"cli\": \"^1.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"eslint-plugin-deprecation\": \"^3.0.0\",\n \"express\": \"^4.18.2\",\n \"fastify\": \"^5.4.0\",\n \"nestia\": \"^8.0.7\",\n \"prettier\": \"^3.2.4\",\n \"prettier-plugin-prisma\": \"^5.0.0\",\n \"prisma-markdown\": \"^3.0.1\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^4.18.0\",\n \"source-map-support\": \"^0.5.21\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-loader\": \"^9.5.1\",\n \"ts-node\": \"^10.9.1\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.2\",\n \"typescript-transform-paths\": \"^3.5.5\",\n \"webpack\": \"^5.89.0\",\n \"webpack-cli\": \"^5.1.4\",\n \"write-file-webpack-plugin\": \"^4.5.1\"\n },\n \"dependencies\": {\n \"@nestia/core\": \"^8.0.7\",\n \"@nestia/fetcher\": \"^8.0.7\",\n \"@nestjs/common\": \"^11.1.3\",\n \"@nestjs/core\": \"^11.1.3\",\n \"@nestjs/platform-express\": \"^11.1.3\",\n \"@nestjs/platform-fastify\": \"^11.1.3\",\n \"@prisma/client\": \"^6.11.1\",\n \"bcryptjs\": \"^3.0.2\",\n \"commander\": \"10.0.0\",\n \"dotenv\": \"^16.3.1\",\n \"dotenv-expand\": \"^10.0.0\",\n \"inquirer\": \"8.2.5\",\n \"jsonwebtoken\": \"^9.0.2\",\n \"prisma\": \"^6.11.1\",\n \"serialize-error\": \"^4.1.0\",\n \"tgrid\": \"^1.1.0\",\n \"tstl\": \"^3.0.0\",\n \"typia\": \"^9.7.2\",\n \"uuid\": \"^9.0.0\"\n },\n \"stackblitz\": {\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test -- --simultaneous 1\"\n }\n}\n",
5
- "src/MyGlobal.ts": "import { PrismaClient } from \"@prisma/client\";\nimport crypto from \"crypto\";\nimport dotenv from \"dotenv\";\nimport dotenvExpand from \"dotenv-expand\";\nimport { Singleton } from \"tstl\";\nimport typia from \"typia\";\n\n/* eslint-disable */\nexport class MyGlobal {\n public static readonly prisma: PrismaClient = new PrismaClient();\n public static testing: boolean = false;\n public static get env(): MyGlobal.IEnvironments {\n return environments.get();\n }\n\n /**\n * Common password utilities for consistent authentication Uses native crypto\n * module for password hashing\n */\n public static readonly password = {\n // Fixed salt for password hashing (consistent across all operations)\n FIXED_SALT: \"autobe-fixed-salt-2024\",\n\n /**\n * Hash a plain password using crypto.pbkdf2 All authentication operations\n * (join, login) MUST use this method\n *\n * @param plainPassword - The plain text password to hash\n * @returns The hashed password as hex string\n */\n async hash(plainPassword: string): Promise<string> {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n plainPassword,\n this.FIXED_SALT,\n 10000,\n 64,\n \"sha512\",\n (err: Error | null, derivedKey: Buffer) => {\n if (err) reject(err);\n else resolve(derivedKey.toString(\"hex\"));\n },\n );\n });\n },\n\n /**\n * Verify a plain password against a hashed password Login operations MUST\n * use this method for password verification\n *\n * @param plainPassword - The plain text password to verify\n * @param hashedPassword - The hashed password from database\n * @returns True if passwords match, false otherwise\n */\n async verify(\n plainPassword: string,\n hashedPassword: string,\n ): Promise<boolean> {\n const hash = await this.hash(plainPassword);\n return hash === hashedPassword;\n },\n };\n}\nexport namespace MyGlobal {\n export interface IEnvironments {\n API_PORT: `${number}`;\n\n /** JWT Secret Key. */\n JWT_SECRET_KEY: string;\n }\n}\nconst environments = new Singleton(() => {\n const env = dotenv.config();\n dotenvExpand.expand(env);\n return typia.assert<MyGlobal.IEnvironments>(process.env);\n});\n",
4
+ "src/MyConfiguration.ts": "import { ExceptionManager } from \"@nestia/core\";\nimport {\n ConflictException,\n InternalServerErrorException,\n NotFoundException,\n} from \"@nestjs/common\";\nimport { Prisma } from \"@prisma/client\";\nimport fs from \"fs\";\nimport path from \"path\";\n\nimport { MyGlobal } from \"./MyGlobal\";\n\nexport namespace MyConfiguration {\n export const API_PORT = () => Number(MyGlobal.env.API_PORT);\n export const ROOT = (() => {\n const split: string[] = __dirname.split(path.sep);\n return split.at(-1) === \"src\" && split.at(-2) === \"bin\"\n ? path.resolve(__dirname + \"/../..\")\n : fs.existsSync(__dirname + \"/.env\")\n ? __dirname\n : path.resolve(__dirname + \"/..\");\n })().replaceAll(\"\\\\\", \"/\");\n}\n\nExceptionManager.insert(Prisma.PrismaClientKnownRequestError, (exp) => {\n switch (exp.code) {\n case \"P2025\":\n return new NotFoundException(exp.message);\n case \"P2002\": // UNIQUE CONSTRAINT\n return new ConflictException(exp.message);\n default:\n return new InternalServerErrorException(exp.message);\n }\n});\n",
6
5
  "src/providers/authorize/jwtAuthorize.ts": "import { ForbiddenException, UnauthorizedException } from \"@nestjs/common\";\nimport jwt from \"jsonwebtoken\";\n\nimport { MyGlobal } from \"../../MyGlobal\";\n\nexport function jwtAuthorize(props: {\n request: {\n headers: { authorization?: string };\n };\n}) {\n if (!props.request.headers.authorization)\n throw new ForbiddenException(\"No token value exists\");\n\n // PARSE TOKEN\n try {\n if (\n props.request.headers.authorization.startsWith(BEARER_PREFIX) === true\n ) {\n const token: string = props.request.headers.authorization.substring(\n BEARER_PREFIX.length,\n );\n\n const verified = jwt.verify(token, MyGlobal.env.JWT_SECRET_KEY);\n\n return verified;\n } else {\n const token = props.request.headers.authorization;\n\n const verified = jwt.verify(token, MyGlobal.env.JWT_SECRET_KEY);\n\n return verified;\n }\n } catch {\n throw new UnauthorizedException(\"Invalid token\");\n }\n}\n\nconst BEARER_PREFIX = \"Bearer \";\n",
7
- "src/setup/MySetupWizard.ts": "import cp from \"child_process\";\n\nimport { MyConfiguration } from \"../MyConfiguration\";\nimport { MyGlobal } from \"../MyGlobal\";\n\nexport namespace MySetupWizard {\n export async function schema(): Promise<void> {\n if (MyGlobal.testing === false)\n throw new Error(\n \"Error on SetupWizard.schema(): unable to reset database in non-test mode.\",\n );\n const execute = (type: string) => (argv: string) =>\n cp.execSync(`npx prisma migrate ${type} --schema=prisma/schema ${argv}`, {\n stdio: \"ignore\",\n cwd: MyConfiguration.ROOT,\n });\n execute(\"reset\")(\"--force\");\n execute(\"dev\")(\"--name init\");\n }\n\n export async function seed(): Promise<void> {}\n}\n",
6
+ "src/setup/MySetupWizard.ts": "import cp from \"child_process\";\n\nimport { MyConfiguration } from \"../MyConfiguration\";\nimport { MyGlobal } from \"../MyGlobal\";\n\nexport namespace MySetupWizard {\n export async function schema(): Promise<void> {\n if (MyGlobal.testing === false)\n throw new Error(\n \"Error on MySetupWizard.schema(): unable to reset database in non-test mode.\",\n );\n const execute = (type: string) => (argv: string) =>\n cp.execSync(`npx prisma migrate ${type} --schema=prisma/schema ${argv}`, {\n stdio: \"ignore\",\n cwd: MyConfiguration.ROOT,\n });\n execute(\"reset\")(\"--force\");\n execute(\"dev\")(\"--name init\");\n }\n\n export async function seed(): Promise<void> {}\n}\n",
8
7
  "src/util/toISOStringSafe.ts": "import { tags } from \"typia\";\n\n/**\n * Transforms a value that is either a Date or a string into an ISO 8601\n * formatted string. If it's already a string, it assumes it's already in ISO\n * format.\n */\nexport function toISOStringSafe(\n value: Date | (string & tags.Format<\"date-time\">),\n): string & tags.Format<\"date-time\"> {\n if (value instanceof Date) {\n return value.toISOString() as string & tags.Format<\"date-time\">;\n }\n return value;\n}\n",
9
8
  "test/servant.ts": "import { DynamicExecutor } from \"@nestia/e2e\";\nimport { Driver, WorkerServer } from \"tgrid\";\n\nimport { MyBackend } from \"../src/MyBackend\";\nimport { MyGlobal } from \"../src/MyGlobal\";\nimport { IAutoBeRealizeTestConfig } from \"./autobe/compiler/IAutoBeRealizeTestConfig\";\nimport { IAutoBeRealizeTestListener } from \"./autobe/compiler/IAutoBeRealizeTestListener\";\nimport { IAutoBeRealizeTestOperation } from \"./autobe/compiler/IAutoBeRealizeTestOperation\";\nimport { IAutoBeRealizeTestResult } from \"./autobe/compiler/IAutoBeRealizeTestResult\";\nimport { IAutoBeRealizeTestService } from \"./autobe/compiler/IAutoBeRealizeTestService\";\nimport { TestAutomation } from \"./helpers/TestAutomation\";\n\nclass AutoBeRealizeTestService implements IAutoBeRealizeTestService {\n public constructor(\n private readonly listener: Driver<IAutoBeRealizeTestListener>,\n ) {}\n\n public async execute(\n config: IAutoBeRealizeTestConfig,\n ): Promise<IAutoBeRealizeTestResult> {\n const start: Date = new Date();\n const operations: IAutoBeRealizeTestOperation[] = [];\n await TestAutomation.execute({\n open: async (): Promise<MyBackend> => {\n const backend: MyBackend = new MyBackend();\n await backend.open();\n return backend;\n },\n close: (backend: MyBackend): Promise<void> => backend.close(),\n options: {\n reset: config.reset ?? true,\n simultaneous: config.simultaneous ?? 1,\n },\n onComplete: (exec: DynamicExecutor.IExecution): void => {\n const op: IAutoBeRealizeTestOperation = {\n name: exec.name,\n location: exec.location,\n value: exec.value,\n error: exec.error,\n started_at: exec.started_at,\n completed_at: exec.completed_at,\n };\n this.listener.onOperation(op).catch(() => {});\n operations.push(op);\n },\n onReset: (): void => {\n this.listener.onReset().catch(() => {});\n },\n });\n return {\n reset: config.reset ?? true,\n simultaneous: config.simultaneous ?? 1,\n operations,\n started_at: start.toISOString(),\n completed_at: new Date().toISOString(),\n };\n }\n}\n\nconst main = async (): Promise<void> => {\n const worker: WorkerServer<\n null,\n IAutoBeRealizeTestService,\n IAutoBeRealizeTestListener\n > = new WorkerServer();\n const listener: Driver<IAutoBeRealizeTestListener> = worker.getDriver();\n const service: AutoBeRealizeTestService = new AutoBeRealizeTestService(\n listener,\n );\n\n MyGlobal.testing = true;\n await worker.open(service);\n};\nmain().catch((error) => {\n console.log(error);\n process.exit(-1);\n});\n",
10
9
  "tsconfig.json": "{\n \"compilerOptions\": {\n /* Visit https://aka.ms/tsconfig to read more about this file */\n\n /* Projects */\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\n\n /* Language and Environment */\n \"target\": \"ES2015\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\n \"lib\": [\n \"DOM\",\n \"ESNext\",\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */\n // \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\n \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\n \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\n\n /* Modules */\n \"module\": \"commonjs\", /* Specify what module code is generated. */\n // \"rootDir\": \"./\", /* Specify the root folder within your source files. */\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\n \"paths\": {\n \"@ORGANIZATION/PROJECT-api/lib/*\": [\"./src/api/*\"],\n \"@ORGANIZATION/PROJECT-api\": [\"./src/api\"],\n }, /* Specify a set of entries that re-map imports to additional lookup locations. */\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\n\n /* JavaScript Support */\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\n\n /* Emit */\n // \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */\n // \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */\n // \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */\n // \"removeComments\": true, /* Disable emitting comments. */\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\n // \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */\n // \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */\n \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\n\n /* Interop Constraints */\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */\n // \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. */\n\n /* Type Checking */\n \"strict\": true, /* Enable all strict type-checking options. */\n // \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\n \"noUnusedLocals\": false, /* Enable error reporting when local variables aren't read. */\n \"noUnusedParameters\": false, /* Raise an error when a function parameter isn't read. */\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\n \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\n \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\n\n /* Completeness */\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\n \"plugins\": [\n { \"transform\": \"typescript-transform-paths\" },\n { \"transform\": \"typia/lib/transform\" },\n { \n \"transform\": \"@nestia/core/lib/transform\",\n /**\n * Validate request body.\n * \n * - \"assert\": Use typia.assert() function\n * - \"is\": Use typia.is() function\n * - \"validate\": Use typia.validate() function\n * - \"assertEquals\": Use typia.assertEquals() function\n * - \"equals\": Use typia.equals() function\n * - \"validateEquals\": Use typia.validateEquals() function\n */\n \"validate\": \"validate\",\n /**\n * Validate JSON typed response body.\n * \n * - \"assert\": Use typia.assertStringify() function\n * - \"is\": Use typia.isStringify() function\n * - \"validate\": Use typia.validateStringify() function\n * - \"validate.log\": typia.validateStringify(), but do not throw and just log it\n * - \"stringify\": Use typia.stringify() function, but dangerous\n * - null: Just use JSON.stringify() function, without boosting\n */\n \"stringify\": \"assert\",\n },\n ]\n },\n \"include\": [\n \"src\"\n ],\n \"exclude\": [\n \"node_modules\",\n \"packages\",\n ]\n}\n",
@@ -0,0 +1,5 @@
1
+ export const AutoBeCompilerRealizeTemplateOfPostgres: Record<string, string> = {
2
+ ".env.local": "API_PORT=37001\nJWT_SECRET_KEY=your_jwt_secret_key\n\nPOSTGRES_HOST=127.0.0.1\nPOSTGRES_PORT=5432\nPOSTGRES_DATABASE=wrtnlabs\nPOSTGRES_SCHEMA=autobe\nPOSTGRES_USERNAME=autobe\nPOSTGRES_PASSWORD=1234\nPOSTGRES_URL=postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}?schema=${POSTGRES_SCHEMA}",
3
+ "src/MyGlobal.ts": "import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"@prisma/client\";\nimport crypto from \"crypto\";\nimport dotenv from \"dotenv\";\nimport dotenvExpand from \"dotenv-expand\";\nimport { Singleton } from \"tstl\";\nimport typia from \"typia\";\n\n/* eslint-disable */\nexport class MyGlobal {\n public static testing: boolean = false;\n\n public static get env(): MyGlobal.IEnvironments {\n return environments.get();\n }\n\n public static get prisma(): PrismaClient {\n return prisma.get();\n }\n\n /**\n * Common password utilities for consistent authentication Uses native crypto\n * module for password hashing\n */\n public static readonly password = {\n // Fixed salt for password hashing (consistent across all operations)\n FIXED_SALT: \"autobe-fixed-salt-2024\",\n\n /**\n * Hash a plain password using crypto.pbkdf2 All authentication operations\n * (join, login) MUST use this method\n *\n * @param plainPassword - The plain text password to hash\n * @returns The hashed password as hex string\n */\n async hash(plainPassword: string): Promise<string> {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n plainPassword,\n this.FIXED_SALT,\n 10000,\n 64,\n \"sha512\",\n (err: Error | null, derivedKey: Buffer) => {\n if (err) reject(err);\n else resolve(derivedKey.toString(\"hex\"));\n },\n );\n });\n },\n\n /**\n * Verify a plain password against a hashed password Login operations MUST\n * use this method for password verification\n *\n * @param plainPassword - The plain text password to verify\n * @param hashedPassword - The hashed password from database\n * @returns True if passwords match, false otherwise\n */\n async verify(\n plainPassword: string,\n hashedPassword: string,\n ): Promise<boolean> {\n const hash = await this.hash(plainPassword);\n return hash === hashedPassword;\n },\n };\n}\nexport namespace MyGlobal {\n export interface IEnvironments {\n API_PORT: `${number}`;\n JWT_SECRET_KEY: string;\n\n POSTGRES_HOST: string;\n POSTGRES_PORT: `${number}`;\n POSTGRES_DATABASE: string;\n POSTGRES_SCHEMA: string;\n POSTGRES_USERNAME: string;\n POSTGRES_PASSWORD: string;\n POSTGRES_URL: string;\n }\n}\nconst environments = new Singleton(() => {\n const env = dotenv.config();\n dotenvExpand.expand(env);\n return typia.assert<MyGlobal.IEnvironments>(process.env);\n});\nconst prisma = new Singleton(\n () =>\n new PrismaClient({\n adapter: new PrismaPg(\n { connectionString: environments.get().POSTGRES_URL },\n { schema: environments.get().POSTGRES_SCHEMA },\n ),\n }),\n);\n",
4
+ "src/executable/schema.ts": "import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"@prisma/client\";\n\nimport { MyGlobal } from \"../MyGlobal\";\nimport { MySetupWizard } from \"../setup/MySetupWizard\";\n\nasync function execute(\n database: string,\n username: string,\n password: string,\n script: string,\n): Promise<void> {\n try {\n const prisma = new PrismaClient({\n adapter: new PrismaPg(\n {\n connectionString: `postgresql://${username}:${password}@${MyGlobal.env.POSTGRES_HOST}:${MyGlobal.env.POSTGRES_PORT}/${database}?schema=${MyGlobal.env.POSTGRES_SCHEMA}`,\n },\n { schema: MyGlobal.env.POSTGRES_SCHEMA },\n ),\n });\n const queries: string[] = script\n .split(\"\\n\")\n .map((str) => str.trim())\n .filter((str) => !!str);\n for (const query of queries)\n try {\n await prisma.$queryRawUnsafe(query);\n } catch (e) {\n console.log(e);\n }\n await prisma.$disconnect();\n } catch (err) {\n console.log(err);\n }\n}\n\nasync function main(): Promise<void> {\n const config = {\n database: MyGlobal.env.POSTGRES_DATABASE,\n schema: MyGlobal.env.POSTGRES_SCHEMA,\n username: MyGlobal.env.POSTGRES_USERNAME,\n password: MyGlobal.env.POSTGRES_PASSWORD,\n };\n const root = {\n account: process.argv[2] ?? \"postgres\",\n password: process.argv[3] ?? \"root\",\n };\n\n await execute(\n \"postgres\",\n root.account,\n root.password,\n `\n CREATE USER ${config.username} WITH ENCRYPTED PASSWORD '${config.password}';\n ALTER ROLE ${config.username} WITH CREATEDB\n CREATE DATABASE ${config.database} OWNER ${config.username};\n `,\n );\n\n await execute(\n config.database,\n root.account,\n root.password,\n `\n CREATE SCHEMA ${config.schema} AUTHORIZATION ${config.username};\n `,\n );\n\n console.log(\"------------------------------------------\");\n console.log(\"CREATE TABLES\");\n console.log(\"------------------------------------------\");\n MyGlobal.testing = true;\n await MySetupWizard.schema();\n\n console.log(\"------------------------------------------\");\n console.log(\"INITIAL DATA\");\n console.log(\"------------------------------------------\");\n await MySetupWizard.seed();\n}\nmain().catch((exp) => {\n console.log(exp);\n process.exit(-1);\n});\n"
5
+ };
@@ -0,0 +1,5 @@
1
+ export const AutoBeCompilerRealizeTemplateOfSQLite: Record<string, string> = {
2
+ ".env.local": "API_PORT=37001\nJWT_SECRET_KEY=your_jwt_secret_key",
3
+ "src/MyGlobal.ts": "import { PrismaBetterSQLite3 } from \"@prisma/adapter-better-sqlite3\";\nimport { PrismaClient } from \"@prisma/client\";\nimport crypto from \"crypto\";\nimport dotenv from \"dotenv\";\nimport dotenvExpand from \"dotenv-expand\";\nimport { Singleton } from \"tstl\";\nimport typia from \"typia\";\n\nimport { MyConfiguration } from \"./MyConfiguration\";\n\n/* eslint-disable */\nexport class MyGlobal {\n public static testing: boolean = false;\n\n public static get env(): MyGlobal.IEnvironments {\n return environments.get();\n }\n\n public static get prisma(): PrismaClient {\n return prisma.get();\n }\n\n /**\n * Common password utilities for consistent authentication Uses native crypto\n * module for password hashing\n */\n public static readonly password = {\n // Fixed salt for password hashing (consistent across all operations)\n FIXED_SALT: \"autobe-fixed-salt-2024\",\n\n /**\n * Hash a plain password using crypto.pbkdf2 All authentication operations\n * (join, login) MUST use this method\n *\n * @param plainPassword - The plain text password to hash\n * @returns The hashed password as hex string\n */\n async hash(plainPassword: string): Promise<string> {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n plainPassword,\n this.FIXED_SALT,\n 10000,\n 64,\n \"sha512\",\n (err: Error | null, derivedKey: Buffer) => {\n if (err) reject(err);\n else resolve(derivedKey.toString(\"hex\"));\n },\n );\n });\n },\n\n /**\n * Verify a plain password against a hashed password Login operations MUST\n * use this method for password verification\n *\n * @param plainPassword - The plain text password to verify\n * @param hashedPassword - The hashed password from database\n * @returns True if passwords match, false otherwise\n */\n async verify(\n plainPassword: string,\n hashedPassword: string,\n ): Promise<boolean> {\n const hash = await this.hash(plainPassword);\n return hash === hashedPassword;\n },\n };\n}\nexport namespace MyGlobal {\n export interface IEnvironments {\n API_PORT: `${number}`;\n JWT_SECRET_KEY: string;\n }\n}\nconst environments = new Singleton(() => {\n const env = dotenv.config();\n dotenvExpand.expand(env);\n return typia.assert<MyGlobal.IEnvironments>(process.env);\n});\n\nconst prisma = new Singleton(\n () =>\n new PrismaClient({\n adapter: new PrismaBetterSQLite3({\n url: `${MyConfiguration.ROOT}/prisma/db.sqlite`,\n }),\n }),\n);\n",
4
+ "src/executable/schema.ts": "import { MyGlobal } from \"../MyGlobal\";\nimport { MySetupWizard } from \"../setup/MySetupWizard\";\n\nconst main = async (): Promise<void> => {\n MyGlobal.testing = true;\n await MySetupWizard.schema();\n await MySetupWizard.seed();\n};\nmain().catch((error) => {\n console.error(error);\n process.exit(-1);\n});\n"
5
+ };
@@ -1,5 +1,6 @@
1
1
  export const AutoBeCompilerTestTemplate: Record<string, string> = {
2
- "package.json": "{\n \"private\": true,\n \"name\": \"@ORGANIZATION/PROJECT\",\n \"version\": \"0.1.0\",\n \"description\": \"Starter kit of Nestia\",\n \"main\": \"lib/index.js\",\n \"scripts\": {\n \"benchmark\": \"node bin/test/benchmark\",\n \"test\": \"node bin/test\",\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------BUILDS------------------------\": \"\",\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\n \"build:api\": \"rimraf packages/api/lib && nestia all && rimraf packages/api/lib && tsc -p packages/api/tsconfig.json && rollup -c packages/api/rollup.config.js\",\n \"build:main\": \"rimraf lib && tsc\",\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\n \"build:swagger\": \"npx nestia swagger\",\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\n \"dev\": \"npm run build:test -- --watch\",\n \"eslint\": \"eslint src && eslint test\",\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\n \"prepare\": \"ts-patch install && ts-node build/env.ts\",\n \"prettier\": \"prettier src --write && prettier test --write\",\n \"------------------------WEBPACK------------------------\": \"\",\n \"webpack\": \"rimraf dist && webpack\",\n \"webpack:start\": \"cd dist && node dist/server\",\n \"webpack:test\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------DEPLOYS------------------------\": \"\",\n \"package:api\": \"npm run build:api && cd packages/api && npm publish\",\n \"start\": \"node lib/executable/server\",\n \"start:dev\": \"nest start --watch\",\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia-start\"\n },\n \"keywords\": [\n \"nestia\",\n \"template\",\n \"boilerplate\"\n ],\n \"author\": \"AUTHOR\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\n },\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\n \"devDependencies\": {\n \"@nestia/benchmark\": \"^8.0.7\",\n \"@nestia/e2e\": \"^8.0.7\",\n \"@nestia/sdk\": \"^8.0.7\",\n \"@nestjs/cli\": \"^11.0.7\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/cli\": \"^0.11.21\",\n \"@types/cli-progress\": \"^3.11.5\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"^8.2.5\",\n \"@types/node\": \"^18.11.0\",\n \"@types/uuid\": \"^8.3.4\",\n \"@typescript-eslint/eslint-plugin\": \"^8.1.0\",\n \"@typescript-eslint/parser\": \"^8.1.0\",\n \"chalk\": \"^4.1.2\",\n \"cli\": \"^1.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"eslint-plugin-deprecation\": \"^3.0.0\",\n \"express\": \"^4.18.2\",\n \"nestia\": \"^8.0.7\",\n \"prettier\": \"^3.2.4\",\n \"prettier-plugin-prisma\": \"^5.0.0\",\n \"prisma-markdown\": \"^3.0.1\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^4.18.0\",\n \"source-map-support\": \"^0.5.21\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-loader\": \"^9.5.1\",\n \"ts-node\": \"^10.9.1\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.2\",\n \"typescript-transform-paths\": \"^3.5.5\",\n \"webpack\": \"^5.89.0\",\n \"webpack-cli\": \"^5.1.4\",\n \"write-file-webpack-plugin\": \"^4.5.1\"\n },\n \"dependencies\": {\n \"@nestia/core\": \"^8.0.7\",\n \"@nestia/fetcher\": \"^8.0.7\",\n \"@nestjs/common\": \"^11.1.3\",\n \"@nestjs/core\": \"^11.1.3\",\n \"@nestjs/platform-express\": \"^11.1.3\",\n \"@prisma/client\": \"^6.11.1\",\n \"commander\": \"10.0.0\",\n \"dotenv\": \"^16.3.1\",\n \"dotenv-expand\": \"^10.0.0\",\n \"inquirer\": \"8.2.5\",\n \"prisma\": \"^6.11.1\",\n \"serialize-error\": \"^4.1.0\",\n \"tgrid\": \"^1.1.0\",\n \"tstl\": \"^3.0.0\",\n \"typia\": \"^9.7.2\",\n \"uuid\": \"^9.0.0\"\n },\n \"stackblitz\": {\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test -- --simultaneous 1\"\n }\n}\n",
2
+ "package.json": "{\n \"private\": true,\n \"name\": \"@ORGANIZATION/PROJECT\",\n \"version\": \"0.1.0\",\n \"description\": \"Starter kit of Nestia\",\n \"main\": \"lib/index.js\",\n \"scripts\": {\n \"benchmark\": \"node bin/test/benchmark\",\n \"test\": \"node bin/test\",\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------BUILDS------------------------\": \"\",\n \"build\": \"npm run build:prisma && npm run build:sdk && npm run build:main && npm run build:test\",\n \"build:api\": \"rimraf packages/api/lib && nestia all && rimraf packages/api/lib && tsc -p packages/api/tsconfig.json && rollup -c packages/api/rollup.config.js\",\n \"build:env\": \"ts-node build/env.ts\",\n \"build:main\": \"rimraf lib && tsc\",\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\n \"build:prisma\": \"prisma generate --schema prisma/schema\",\n \"build:swagger\": \"nestia swagger\",\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\n \"dev\": \"npm run build:test -- --watch\",\n \"eslint\": \"eslint src && eslint test\",\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\n \"prepare\": \"ts-patch install && npm run build:env && npm run build:prisma\",\n \"prettier\": \"prettier src --write && prettier test --write\",\n \"------------------------WEBPACK------------------------\": \"\",\n \"webpack\": \"rimraf dist && webpack\",\n \"webpack:start\": \"cd dist && node dist/server\",\n \"webpack:test\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------DEPLOYS------------------------\": \"\",\n \"package:api\": \"npm run build:api && cd packages/api && npm publish\",\n \"schema\": \"ts-node src/executable/schema\",\n \"start\": \"node lib/executable/server\",\n \"start:dev\": \"nest start --watch\",\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia-start\"\n },\n \"keywords\": [\n \"nestia\",\n \"template\",\n \"boilerplate\"\n ],\n \"author\": \"AUTHOR\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\n },\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\n \"devDependencies\": {\n \"@nestia/benchmark\": \"^8.0.7\",\n \"@nestia/e2e\": \"^8.0.7\",\n \"@nestia/sdk\": \"^8.0.7\",\n \"@nestjs/cli\": \"^11.0.7\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/bcryptjs\": \"^3.0.0\",\n \"@types/cli\": \"^0.11.21\",\n \"@types/cli-progress\": \"^3.11.5\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"^8.2.5\",\n \"@types/jsonwebtoken\": \"^9.0.5\",\n \"@types/node\": \"^18.11.0\",\n \"@types/uuid\": \"^8.3.4\",\n \"@typescript-eslint/eslint-plugin\": \"^8.1.0\",\n \"@typescript-eslint/parser\": \"^8.1.0\",\n \"chalk\": \"^4.1.2\",\n \"cli\": \"^1.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"eslint-plugin-deprecation\": \"^3.0.0\",\n \"express\": \"^4.18.2\",\n \"fastify\": \"^5.4.0\",\n \"nestia\": \"^8.0.7\",\n \"prettier\": \"^3.2.4\",\n \"prettier-plugin-prisma\": \"^5.0.0\",\n \"prisma-markdown\": \"^3.0.1\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^4.18.0\",\n \"source-map-support\": \"^0.5.21\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-loader\": \"^9.5.1\",\n \"ts-node\": \"^10.9.1\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.2\",\n \"typescript-transform-paths\": \"^3.5.5\",\n \"webpack\": \"^5.89.0\",\n \"webpack-cli\": \"^5.1.4\",\n \"write-file-webpack-plugin\": \"^4.5.1\"\n },\n \"dependencies\": {\n \"@nestia/core\": \"^8.0.7\",\n \"@nestia/fetcher\": \"^8.0.7\",\n \"@nestjs/common\": \"^11.1.3\",\n \"@nestjs/core\": \"^11.1.3\",\n \"@nestjs/platform-express\": \"^11.1.3\",\n \"@nestjs/platform-fastify\": \"^11.1.3\",\n \"@prisma/adapter-pg\": \"^6.16.2\",\n \"@prisma/adapter-better-sqlite3\": \"^6.16.2\",\n \"@prisma/client\": \"^6.16.2\",\n \"bcryptjs\": \"^3.0.2\",\n \"commander\": \"10.0.0\",\n \"dotenv\": \"^16.3.1\",\n \"dotenv-expand\": \"^10.0.0\",\n \"inquirer\": \"8.2.5\",\n \"jsonwebtoken\": \"^9.0.2\",\n \"prisma\": \"^6.16.2\",\n \"serialize-error\": \"^4.1.0\",\n \"tgrid\": \"^1.1.0\",\n \"tstl\": \"^3.0.0\",\n \"typia\": \"^9.7.2\",\n \"uuid\": \"^9.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\"better-sqlite3\"]\n },\n \"stackblitz\": {\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test -- --simultaneous 1\"\n }\n}\n",
3
+ "src/executable/schema.ts": "import { MySetupWizard } from \"../setup/MySetupWizard\";\n\nconst main = async (): Promise<void> => {\n await MySetupWizard.schema();\n await MySetupWizard.seed();\n};\nmain().catch((error) => {\n console.error(error);\n process.exit(-1);\n});\n",
3
4
  "src/setup/MySetupWizard.ts": "export namespace MySetupWizard {\n export async function schema(): Promise<void> {\n console.log(\"Realize agent has not generated main program yet.\");\n }\n\n export async function seed(): Promise<void> {}\n}\n",
4
5
  "test/helpers/TestAutomation.ts": "import api from \"@ORGANIZATION/PROJECT-api\";\nimport { DynamicExecutor } from \"@nestia/e2e\";\nimport { sleep_for } from \"tstl\";\n\nimport { MyConfiguration } from \"../../src/MyConfiguration\";\nimport { MySetupWizard } from \"../../src/setup/MySetupWizard\";\n\nexport namespace TestAutomation {\n export interface IProps<T> {\n open(options: IOptions): Promise<T>;\n close(backend: T): Promise<void>;\n onComplete(exec: DynamicExecutor.IExecution): void;\n onReset(): void;\n options: IOptions;\n }\n\n export interface IOptions {\n reset: boolean;\n simultaneous: number;\n include?: string[];\n exclude?: string[];\n }\n\n export const execute = async <T>(\n props: IProps<T>,\n ): Promise<DynamicExecutor.IReport> => {\n // RESET\n if (props.options.reset === true) {\n await MySetupWizard.schema();\n await MySetupWizard.seed();\n await props.onReset();\n }\n\n // OPEN BACKEND\n const backend: T = await props.open(props.options);\n const connection: api.IConnection = {\n host: `http://127.0.0.1:${MyConfiguration.API_PORT()}`,\n };\n\n // DO TEST\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\n prefix: \"test\",\n location: __dirname + \"/../features\",\n parameters: () => [\n {\n host: connection.host,\n } satisfies api.IConnection,\n ],\n filter: (func) =>\n (!props.options.include?.length ||\n (props.options.include ?? []).some((str) => func.includes(str))) &&\n (!props.options.exclude?.length ||\n (props.options.exclude ?? []).every((str) => !func.includes(str))),\n onComplete: props.onComplete,\n simultaneous: props.options.simultaneous,\n extension: __filename.split(\".\").pop()!,\n });\n\n // TERMINATE\n await sleep_for(2500);\n await props.close(backend);\n return report;\n };\n}\n",
5
6
  "test/helpers/TestAutomationStdio.ts": "import { DynamicExecutor } from \"@nestia/e2e\";\nimport chalk from \"chalk\";\n\nimport { ArgumentParser } from \"./ArgumentParser\";\nimport { TestAutomation } from \"./TestAutomation\";\n\nexport namespace TestAutomationStdio {\n export const getOptions = () =>\n ArgumentParser.parse<TestAutomation.IOptions>(\n async (command, prompt, action) => {\n command.option(\"--reset <true|false>\", \"reset local DB or not\");\n command.option(\n \"--simultaneous <number>\",\n \"number of simultaneous requests\",\n );\n command.option(\"--include <string...>\", \"include feature files\");\n command.option(\"--exclude <string...>\", \"exclude feature files\");\n\n return action(async (options) => {\n // reset\n if (typeof options.reset === \"string\")\n options.reset = options.reset === \"true\";\n options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\n\n // simultaneous\n options.simultaneous = Number(\n options.simultaneous ??\n (await prompt.number(\"simultaneous\")(\n \"Number of simultaneous requests to make\",\n )),\n );\n if (isNaN(options.simultaneous) || options.simultaneous <= 0)\n options.simultaneous = 1;\n return options as TestAutomation.IOptions;\n });\n },\n );\n\n export const onComplete = (exec: DynamicExecutor.IExecution): void => {\n const trace = (str: string) =>\n console.log(` - ${chalk.green(exec.name)}: ${str}`);\n if (exec.error === null) {\n const elapsed: number =\n new Date(exec.completed_at).getTime() -\n new Date(exec.started_at).getTime();\n trace(`${chalk.yellow(elapsed.toLocaleString())} ms`);\n } else trace(chalk.red(exec.error.name));\n };\n\n export const onReset = (start: Date) => (): void => {\n const now: Date = new Date();\n console.log(\n ` - Reset DB: ${(now.getDate() - start.getDate()).toLocaleString()} ms`,\n );\n };\n\n export const report = (report: DynamicExecutor.IReport): void => {\n const exceptions: Error[] = report.executions\n .filter((exec) => exec.error !== null)\n .map((exec) => exec.error!);\n if (exceptions.length === 0) {\n console.log(\"Success\");\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\n } else {\n for (const exp of exceptions) console.log(exp);\n console.log(\"Failed\");\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\n process.exit(-1);\n }\n };\n}\n",