@autobe/compiler 0.25.0 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/prisma/writePrismaApplication.js +6 -1
- package/lib/prisma/writePrismaApplication.js.map +1 -1
- package/lib/raw/AutoBeCompilerRealizeTemplate.js +2 -1
- package/lib/raw/AutoBeCompilerRealizeTemplate.js.map +1 -1
- package/lib/raw/AutoBeCompilerRealizeTemplateOfPostgres.js +1 -1
- package/lib/raw/AutoBeCompilerRealizeTemplateOfPostgres.js.map +1 -1
- package/lib/raw/AutoBeCompilerRealizeTemplateOfSQLite.js +1 -1
- package/lib/raw/AutoBeCompilerRealizeTemplateOfSQLite.js.map +1 -1
- package/lib/test/AutoBeTestCompiler.js +1 -1
- package/lib/test/AutoBeTestCompiler.js.map +1 -1
- package/lib/test/programmers/writeTestFunction.js +2 -2
- package/lib/test/programmers/writeTestFunction.js.map +1 -1
- package/package.json +4 -4
- package/src/prisma/writePrismaApplication.ts +8 -1
- package/src/raw/AutoBeCompilerRealizeTemplate.ts +2 -1
- package/src/raw/AutoBeCompilerRealizeTemplateOfPostgres.ts +1 -1
- package/src/raw/AutoBeCompilerRealizeTemplateOfSQLite.ts +1 -1
- package/src/test/AutoBeTestCompiler.ts +6 -3
- package/src/test/programmers/writeTestFunction.ts +5 -5
|
@@ -58,6 +58,7 @@ function writeColumns(props) {
|
|
|
58
58
|
"//----",
|
|
59
59
|
writePrimary({
|
|
60
60
|
dbms: props.dbms,
|
|
61
|
+
model: props.model,
|
|
61
62
|
field: props.model.primaryField,
|
|
62
63
|
}),
|
|
63
64
|
...props.model.foreignFields
|
|
@@ -82,9 +83,13 @@ function writeColumns(props) {
|
|
|
82
83
|
}
|
|
83
84
|
function writePrimary(props) {
|
|
84
85
|
const type = props.dbms === "postgres" ? POSTGRES_PHYSICAL_TYPES.uuid : undefined;
|
|
86
|
+
const pkeyName = `${props.model.name}__pkey`;
|
|
87
|
+
const signature = pkeyName.length <= MAX_IDENTIFIER_LENGTH
|
|
88
|
+
? "@id"
|
|
89
|
+
: `@id(map: "${shortName(pkeyName)}")`;
|
|
85
90
|
return [
|
|
86
91
|
writeComment(props.field.description, 78),
|
|
87
|
-
`${props.field.name} String
|
|
92
|
+
`${props.field.name} String ${signature}${type ? ` ${type}` : ""}`,
|
|
88
93
|
].join("\n");
|
|
89
94
|
}
|
|
90
95
|
function writeField(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writePrismaApplication.js","sourceRoot":"","sources":["../../src/prisma/writePrismaApplication.ts"],"names":[],"mappings":";;;;;AAMA,wDAqBC;AA1BD,yCAAoD;AACpD,oDAA4B;AAE5B,kDAA+C;AAE/C,SAAgB,sBAAsB,CAAC,KAGtC;IACC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK;QACxC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM;YAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1D,uCACK,MAAM,CAAC,WAAW,CACnB,KAAK,CAAC,WAAW,CAAC,KAAK;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,aAAa,CAAC;SACjD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ;QACb,SAAS,iCACJ,KAAK,KACR,IAAI,IACJ;KACH,CAAC,CACL,KACD,aAAa,EACX,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,gBAAgB,IACnE;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAIlB;IACC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM;SACrB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACb,UAAU,iCACL,KAAK,KACR,KAAK,IACL,CACH;SACA,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AAED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CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"writePrismaApplication.js","sourceRoot":"","sources":["../../src/prisma/writePrismaApplication.ts"],"names":[],"mappings":";;;;;AAMA,wDAqBC;AA1BD,yCAAoD;AACpD,oDAA4B;AAE5B,kDAA+C;AAE/C,SAAgB,sBAAsB,CAAC,KAGtC;IACC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK;QACxC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM;YAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1D,uCACK,MAAM,CAAC,WAAW,CACnB,KAAK,CAAC,WAAW,CAAC,KAAK;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,aAAa,CAAC;SACjD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ;QACb,SAAS,iCACJ,KAAK,KACR,IAAI,IACJ;KACH,CAAC,CACL,KACD,aAAa,EACX,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,gBAAgB,IACnE;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAIlB;IACC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM;SACrB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACb,UAAU,iCACL,KAAK,KACR,KAAK,IACL,CACH;SACA,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,UAAU,CAAC,KAKnB;IACC,OAAO;QACL,YAAY,CACV;YACE,KAAK,CAAC,KAAK,CAAC,WAAW;YACvB,EAAE;YACF,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;YACvE,qDAAqD;SACtD,CAAC,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
|
|
@@ -7,7 +7,8 @@ exports.AutoBeCompilerRealizeTemplate = {
|
|
|
7
7
|
"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",
|
|
8
8
|
"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",
|
|
9
9
|
"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",
|
|
10
|
-
"src/
|
|
10
|
+
"src/utils/PasswordUtil.ts": "import crypto from \"crypto\";\n\nexport namespace PasswordUtil {\n /**\n * Common password utilities for consistent authentication Uses native crypto\n * module for password hashing\n */\n // Fixed salt for password hashing (consistent across all operations)\n export const FIXED_SALT: \"autobe-fixed-salt-2024\" = \"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 export async function hash(plainPassword: string): Promise<string> {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n plainPassword,\n PasswordUtil.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 use\n * 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 export async function verify(\n plainPassword: string,\n hashedPassword: string,\n ): Promise<boolean> {\n const hash = await PasswordUtil.hash(plainPassword);\n return hash === hashedPassword;\n }\n}\n",
|
|
11
|
+
"src/utils/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",
|
|
11
12
|
"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",
|
|
12
13
|
"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",
|
|
13
14
|
"test/autobe/compiler/IAutoBeRealizeTestOperation.ts": "//---------------------------------------------------\n// Cloned from @autobe/interface\n//---------------------------------------------------\nimport { tags } from \"typia\";\n\n/**\n * Detailed result interface representing the execution outcome of an individual\n * E2E test function during comprehensive backend implementation validation.\n *\n * This interface captures comprehensive information about a single test\n * operation execution, including identification details, execution results,\n * error conditions, and precise timing data. Each operation represents the\n * validation of a specific API endpoint or business scenario through Test\n * agent-generated E2E test functions executed against the fully implemented\n * backend application.\n *\n * The operation result provides granular visibility into test execution\n * outcomes, enabling detailed analysis of implementation quality, business\n * logic compliance, and performance characteristics at the individual test\n * level. This detailed tracking supports comprehensive validation reporting and\n * precise identification of implementation issues when they occur.\n *\n * @author Samchon\n */\nexport interface IAutoBeRealizeTestOperation {\n /**\n * Unique identifier name of the executed E2E test function.\n *\n * Specifies the function name that was executed during this test operation,\n * typically corresponding to the Test agent-generated test function\n * identifier. This name provides direct traceability between test results and\n * the specific business scenarios, API endpoints, or validation logic being\n * tested.\n *\n * The test function name serves as the primary identifier for correlating\n * execution results with the original test scenarios, enabling stakeholders\n * to understand which specific functionality was validated and whether the\n * implementation correctly fulfills the intended business requirements and\n * API contracts.\n */\n name: string;\n\n /**\n * File system path location of the executed test function source code.\n *\n * Specifies the relative or absolute path to the test file that contains the\n * executed function within the project structure. This location information\n * enables direct navigation to the test source code for detailed analysis,\n * debugging, result interpretation, or modification purposes.\n *\n * The file location provides essential context for understanding test\n * organization, enables developers to quickly locate and examine the specific\n * test implementation, and supports comprehensive test suite maintenance and\n * documentation activities.\n */\n location: string;\n\n /**\n * Return value or result data produced by the test function execution.\n *\n * Contains the actual value returned by the test function upon completion,\n * regardless of whether execution succeeded or failed. This could include API\n * response objects, validation results, test data, computed values, or any\n * other output that the test function produces as part of its business logic\n * validation or endpoint testing.\n *\n * For successful test executions, this value represents the expected result\n * that demonstrates correct implementation behavior. The return value\n * provides insight into the test execution flow and can be analyzed to verify\n * that API responses match expected formats, business logic produces correct\n * outcomes, and data transformations operate as intended.\n */\n value: unknown;\n\n /**\n * Error information captured during test function execution, if any occurred.\n *\n * Contains detailed error information when the test function encounters\n * exceptions, assertion failures, timeout conditions, or other error states\n * during execution. When null, it indicates that the test completed\n * successfully without encountering any error conditions. When present, the\n * error provides comprehensive diagnostic information for understanding\n * implementation issues or test failures.\n *\n * Error information is crucial for identifying implementation defects, API\n * contract violations, business logic errors, integration failures, or\n * performance issues that prevent the backend application from meeting its\n * requirements. The error details enable developers to pinpoint specific\n * problems and implement necessary corrections to achieve full compliance\n * with validation scenarios.\n */\n error: null | unknown;\n\n /**\n * Precise timestamp when this specific test operation began execution.\n *\n * Records the exact moment when this individual test function started\n * execution, providing the reference point for measuring test duration and\n * understanding the temporal sequence of test operations within the overall\n * validation process. This timestamp enables detailed performance analysis\n * and execution timeline reconstruction.\n *\n * The start timestamp is essential for identifying execution patterns,\n * analyzing test concurrency behavior, measuring individual test performance,\n * and understanding the temporal distribution of test execution within the\n * comprehensive validation suite.\n */\n started_at: string & tags.Format<\"date-time\">;\n\n /**\n * Precise timestamp when this specific test operation finished execution.\n *\n * Records the exact moment when this individual test function completed\n * execution, regardless of whether it succeeded or failed. Combined with the\n * start timestamp, this enables precise calculation of test execution\n * duration and provides completion reference for the overall test timeline.\n *\n * The completion timestamp is valuable for performance analysis of individual\n * test operations, identifying slow-performing test scenarios, understanding\n * test execution efficiency, and maintaining comprehensive audit trails of\n * the validation process. It supports optimization efforts and helps identify\n * potential bottlenecks in either the test implementation or the backend\n * application being validated.\n */\n completed_at: string & tags.Format<\"date-time\">;\n}\n",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeCompilerRealizeTemplate.js","sourceRoot":"","sources":["../../src/raw/AutoBeCompilerRealizeTemplate.ts"],"names":[],"mappings":";;;AAAa,QAAA,6BAA6B,GAA2B;IACnE,YAAY,EAAE,oDAAoD;IAClE,YAAY,EAAE,yJAAyJ;IACvK,wBAAwB,EAAE,slCAAslC;IAChnC,yCAAyC,EAAE,0/BAA0/B;IACriC,4BAA4B,EAAE,muBAAmuB;IACjwB,
|
|
1
|
+
{"version":3,"file":"AutoBeCompilerRealizeTemplate.js","sourceRoot":"","sources":["../../src/raw/AutoBeCompilerRealizeTemplate.ts"],"names":[],"mappings":";;;AAAa,QAAA,6BAA6B,GAA2B;IACnE,YAAY,EAAE,oDAAoD;IAClE,YAAY,EAAE,yJAAyJ;IACvK,wBAAwB,EAAE,slCAAslC;IAChnC,yCAAyC,EAAE,0/BAA0/B;IACriC,4BAA4B,EAAE,muBAAmuB;IACjwB,2BAA2B,EAAE,+iDAA+iD;IAC5kD,8BAA8B,EAAE,ydAAyd;IACzf,iBAAiB,EAAE,uqFAAuqF;IAC1rF,eAAe,EAAE,6xZAA6xZ;IAC9yZ,qDAAqD,EAAE,wlMAAwlM;IAC/oM,kDAAkD,EAAE,uoGAAuoG;IAC3rG,kDAAkD,EAAE,w6KAAw6K;IAC59K,oDAAoD,EAAE,wgKAAwgK;IAC9jK,mDAAmD,EAAE,gpKAAgpK;CACtsK,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AutoBeCompilerRealizeTemplateOfPostgres = void 0;
|
|
4
4
|
exports.AutoBeCompilerRealizeTemplateOfPostgres = {
|
|
5
5
|
".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}",
|
|
6
|
-
"src/MyGlobal.ts": "import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"@prisma/client\";\nimport
|
|
6
|
+
"src/MyGlobal.ts": "import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"@prisma/client\";\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\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",
|
|
7
7
|
"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"
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=AutoBeCompilerRealizeTemplateOfPostgres.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeCompilerRealizeTemplateOfPostgres.js","sourceRoot":"","sources":["../../src/raw/AutoBeCompilerRealizeTemplateOfPostgres.ts"],"names":[],"mappings":";;;AAAa,QAAA,uCAAuC,GAA2B;IAC7E,YAAY,EAAE,+VAA+V;IAC7W,iBAAiB,EAAE
|
|
1
|
+
{"version":3,"file":"AutoBeCompilerRealizeTemplateOfPostgres.js","sourceRoot":"","sources":["../../src/raw/AutoBeCompilerRealizeTemplateOfPostgres.ts"],"names":[],"mappings":";;;AAAa,QAAA,uCAAuC,GAA2B;IAC7E,YAAY,EAAE,+VAA+V;IAC7W,iBAAiB,EAAE,qvCAAqvC;IACxwC,0BAA0B,EAAE,80EAA80E;CAC32E,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AutoBeCompilerRealizeTemplateOfSQLite = void 0;
|
|
4
4
|
exports.AutoBeCompilerRealizeTemplateOfSQLite = {
|
|
5
5
|
".env.local": "API_PORT=37001\nJWT_SECRET_KEY=your_jwt_secret_key",
|
|
6
|
-
"src/MyGlobal.ts": "import { PrismaBetterSQLite3 } from \"@prisma/adapter-better-sqlite3\";\nimport { PrismaClient } from \"@prisma/client\";\nimport
|
|
6
|
+
"src/MyGlobal.ts": "import { PrismaBetterSQLite3 } from \"@prisma/adapter-better-sqlite3\";\nimport { PrismaClient } from \"@prisma/client\";\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}\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",
|
|
7
7
|
"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"
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=AutoBeCompilerRealizeTemplateOfSQLite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeCompilerRealizeTemplateOfSQLite.js","sourceRoot":"","sources":["../../src/raw/AutoBeCompilerRealizeTemplateOfSQLite.ts"],"names":[],"mappings":";;;AAAa,QAAA,qCAAqC,GAA2B;IAC3E,YAAY,EAAE,oDAAoD;IAClE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"AutoBeCompilerRealizeTemplateOfSQLite.js","sourceRoot":"","sources":["../../src/raw/AutoBeCompilerRealizeTemplateOfSQLite.ts"],"names":[],"mappings":";;;AAAa,QAAA,qCAAqC,GAA2B;IAC3E,YAAY,EAAE,oDAAoD;IAClE,iBAAiB,EAAE,4jCAA4jC;IAC/kC,0BAA0B,EAAE,mUAAmU;CAChW,CAAC"}
|
|
@@ -67,7 +67,7 @@ class AutoBeTestCompiler {
|
|
|
67
67
|
const endpoints = new tstl_1.HashMap(props.document.operations.map((op) => new tstl_1.Pair({
|
|
68
68
|
method: op.method,
|
|
69
69
|
path: op.path,
|
|
70
|
-
}, op)), utils_1.
|
|
70
|
+
}, op)), utils_1.AutoBeOpenApiEndpointComparator.hashCode, utils_1.AutoBeOpenApiEndpointComparator.equals);
|
|
71
71
|
(0, utils_1.validateTestFunction)({
|
|
72
72
|
function: props.function,
|
|
73
73
|
document: props.document,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeTestCompiler.js","sourceRoot":"","sources":["../../src/test/AutoBeTestCompiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"AutoBeTestCompiler.js","sourceRoot":"","sources":["../../src/test/AutoBeTestCompiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAQA,yCAGuB;AACvB,+CAA2C;AAC3C,+BAAqC;AACrC,4DAA4B;AAE5B,oEAAiD;AAEjD,4FAAyF;AACzF,kFAA+E;AAC/E,iEAA4C;AAC5C,sDAAmD;AACnD,sEAAmE;AACnE,uEAAoE;AAEpE,MAAa,kBAAkB;IAChB,OAAO,CAClB,KAAoC;;;YAEpC,MAAM,KAAK,GAAW,MAAA,KAAK,CAAC,OAAO,mCAAI,2BAA2B,CAAC;YACnE,MAAM,QAAQ,GAAgB,IAAI,0BAAW,CAAC;gBAC5C,QAAQ,EAAE,mBAAsC;gBAChD,eAAe,EAAE;oBACf,MAAM,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM;oBAC9B,MAAM,EAAE,oBAAE,CAAC,UAAU,CAAC,QAAQ;oBAC9B,kBAAkB,EAAE,IAAI;oBACxB,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE;wBACL,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC;wBACtB,CAAC,GAAG,KAAK,QAAQ,CAAC,EAAE,CAAC,aAAa,CAAC;qBACpC;oBACD,MAAM,EAAE,IAAI;oBACZ,YAAY,EAAE,I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OAAO,GAAW,IAAA,qCAAiB,EAAC,KAAK,CAAC,CAAC;YACjD,OAAO,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC5E,CAAC;KAAA;IAEY,WAAW;;YACtB,OAAO,mBAAsC,CAAC;QAChD,CAAC;KAAA;IAEY,WAAW;;YACtB,uCACK,iEAA+B,GAC/B,uDAA0B,EAC7B;QACJ,CAAC;KAAA;CACF;AAtFD,gDAsFC"}
|
|
@@ -43,8 +43,8 @@ function associate(document) {
|
|
|
43
43
|
const operations = new tstl_1.HashMap(document.operations.map((o) => new tstl_1.Pair({
|
|
44
44
|
method: o.method,
|
|
45
45
|
path: o.path,
|
|
46
|
-
}, o)), utils_1.
|
|
47
|
-
const functions = new tstl_1.HashMap(utils_1.
|
|
46
|
+
}, o)), utils_1.AutoBeOpenApiEndpointComparator.hashCode, utils_1.AutoBeOpenApiEndpointComparator.equals);
|
|
47
|
+
const functions = new tstl_1.HashMap(utils_1.AutoBeOpenApiEndpointComparator.hashCode, utils_1.AutoBeOpenApiEndpointComparator.equals);
|
|
48
48
|
// from migrate application
|
|
49
49
|
const migrate = openapi_1.HttpMigration.application((0, utils_1.transformOpenApiDocument)(document));
|
|
50
50
|
for (const route of migrate.routes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeTestFunction.js","sourceRoot":"","sources":["../../../src/test/programmers/writeTestFunction.ts"],"names":[],"mappings":";;;;;AAeA,8CA4CC;AA1DD,yCAGuB;AACvB,iHAA8G;AAC9G,8CAA0E;AAC1E,+BAAqC;AACrC,4DAAqD;AAErD,yDAAsD;AACtD,mFAAgF;AAIhF,SAAgB,iBAAiB,CAAC,KAA4B;IAC5D,MAAM,GAAG,GAAiC;QACxC,QAAQ,EAAE,IAAI,6DAA6B,EAAE;QAC7C,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB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EAAE,CACJ,IAAI,WAAI,CACN;QACE,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,CAAC,CAAC,IAAI;KACb,EACD,CAAC,CACF,CACJ,EACD,
|
|
1
|
+
{"version":3,"file":"writeTestFunction.js","sourceRoot":"","sources":["../../../src/test/programmers/writeTestFunction.ts"],"names":[],"mappings":";;;;;AAeA,8CA4CC;AA1DD,yCAGuB;AACvB,iHAA8G;AAC9G,8CAA0E;AAC1E,+BAAqC;AACrC,4DAAqD;AAErD,yDAAsD;AACtD,mFAAgF;AAIhF,SAAgB,iBAAiB,CAAC,KAA4B;IAC5D,MAAM,GAAG,GAAiC;QACxC,QAAQ,EAAE,IAAI,6DAA6B,EAAE;QAC7C,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;KACrC,CAAC;IACF,MAAM,KAAK,GAAwB,oBAAE,CAAC,OAAO,CAAC,yBAAyB,CACrE;QACE,oBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QACtD,oBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAE,CAAC,UAAU,CAAC,YAAY,CAAC;KACtD,EACD,SAAS,EACT,KAAK,CAAC,QAAQ,CAAC,YAAY,EAC3B,SAAS,EACT;QACE,oBAAE,CAAC,OAAO,CAAC,0BAA0B,CACnC,SAAS,EACT,SAAS,EACT,YAAY,EACZ,SAAS,EACT,oBAAE,CAAC,OAAO,CAAC,uBAAuB,CAChC,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,2BAA2B;SACrC,CAAC,cAAc,CACjB,CACF;KACF,EACD,SAAS,EACT,6DAA6B,CAAC,KAAK,CAAC,GAAG,EAAE;QACvC,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,KAAK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,CAAC,QAAQ,CAAC;SACpC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobe/compiler",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"description": "AI backend server code generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Wrtn Technologies",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"tgrid": "^1.2.0",
|
|
31
31
|
"tstl": "^3.0.0",
|
|
32
32
|
"typia": "^9.7.2",
|
|
33
|
-
"@autobe/filesystem": "^0.25.
|
|
34
|
-
"@autobe/
|
|
35
|
-
"@autobe/
|
|
33
|
+
"@autobe/filesystem": "^0.25.2",
|
|
34
|
+
"@autobe/interface": "^0.25.2",
|
|
35
|
+
"@autobe/utils": "^0.25.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.15.3",
|
|
@@ -92,6 +92,7 @@ function writeColumns(props: {
|
|
|
92
92
|
"//----",
|
|
93
93
|
writePrimary({
|
|
94
94
|
dbms: props.dbms,
|
|
95
|
+
model: props.model,
|
|
95
96
|
field: props.model.primaryField,
|
|
96
97
|
}),
|
|
97
98
|
...props.model.foreignFields
|
|
@@ -117,13 +118,19 @@ function writeColumns(props: {
|
|
|
117
118
|
|
|
118
119
|
function writePrimary(props: {
|
|
119
120
|
dbms: "postgres" | "sqlite";
|
|
121
|
+
model: AutoBePrisma.IModel;
|
|
120
122
|
field: AutoBePrisma.IPrimaryField;
|
|
121
123
|
}): string {
|
|
122
124
|
const type: string | undefined =
|
|
123
125
|
props.dbms === "postgres" ? POSTGRES_PHYSICAL_TYPES.uuid : undefined;
|
|
126
|
+
const pkeyName: string = `${props.model.name}__pkey`;
|
|
127
|
+
const signature: string =
|
|
128
|
+
pkeyName.length <= MAX_IDENTIFIER_LENGTH
|
|
129
|
+
? "@id"
|
|
130
|
+
: `@id(map: "${shortName(pkeyName)}")`;
|
|
124
131
|
return [
|
|
125
132
|
writeComment(props.field.description, 78),
|
|
126
|
-
`${props.field.name} String
|
|
133
|
+
`${props.field.name} String ${signature}${type ? ` ${type}` : ""}`,
|
|
127
134
|
].join("\n");
|
|
128
135
|
}
|
|
129
136
|
|
|
@@ -4,7 +4,8 @@ export const AutoBeCompilerRealizeTemplate: Record<string, string> = {
|
|
|
4
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",
|
|
5
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",
|
|
6
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",
|
|
7
|
-
"src/
|
|
7
|
+
"src/utils/PasswordUtil.ts": "import crypto from \"crypto\";\n\nexport namespace PasswordUtil {\n /**\n * Common password utilities for consistent authentication Uses native crypto\n * module for password hashing\n */\n // Fixed salt for password hashing (consistent across all operations)\n export const FIXED_SALT: \"autobe-fixed-salt-2024\" = \"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 export async function hash(plainPassword: string): Promise<string> {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n plainPassword,\n PasswordUtil.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 use\n * 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 export async function verify(\n plainPassword: string,\n hashedPassword: string,\n ): Promise<boolean> {\n const hash = await PasswordUtil.hash(plainPassword);\n return hash === hashedPassword;\n }\n}\n",
|
|
8
|
+
"src/utils/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",
|
|
8
9
|
"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",
|
|
9
10
|
"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",
|
|
10
11
|
"test/autobe/compiler/IAutoBeRealizeTestOperation.ts": "//---------------------------------------------------\n// Cloned from @autobe/interface\n//---------------------------------------------------\nimport { tags } from \"typia\";\n\n/**\n * Detailed result interface representing the execution outcome of an individual\n * E2E test function during comprehensive backend implementation validation.\n *\n * This interface captures comprehensive information about a single test\n * operation execution, including identification details, execution results,\n * error conditions, and precise timing data. Each operation represents the\n * validation of a specific API endpoint or business scenario through Test\n * agent-generated E2E test functions executed against the fully implemented\n * backend application.\n *\n * The operation result provides granular visibility into test execution\n * outcomes, enabling detailed analysis of implementation quality, business\n * logic compliance, and performance characteristics at the individual test\n * level. This detailed tracking supports comprehensive validation reporting and\n * precise identification of implementation issues when they occur.\n *\n * @author Samchon\n */\nexport interface IAutoBeRealizeTestOperation {\n /**\n * Unique identifier name of the executed E2E test function.\n *\n * Specifies the function name that was executed during this test operation,\n * typically corresponding to the Test agent-generated test function\n * identifier. This name provides direct traceability between test results and\n * the specific business scenarios, API endpoints, or validation logic being\n * tested.\n *\n * The test function name serves as the primary identifier for correlating\n * execution results with the original test scenarios, enabling stakeholders\n * to understand which specific functionality was validated and whether the\n * implementation correctly fulfills the intended business requirements and\n * API contracts.\n */\n name: string;\n\n /**\n * File system path location of the executed test function source code.\n *\n * Specifies the relative or absolute path to the test file that contains the\n * executed function within the project structure. This location information\n * enables direct navigation to the test source code for detailed analysis,\n * debugging, result interpretation, or modification purposes.\n *\n * The file location provides essential context for understanding test\n * organization, enables developers to quickly locate and examine the specific\n * test implementation, and supports comprehensive test suite maintenance and\n * documentation activities.\n */\n location: string;\n\n /**\n * Return value or result data produced by the test function execution.\n *\n * Contains the actual value returned by the test function upon completion,\n * regardless of whether execution succeeded or failed. This could include API\n * response objects, validation results, test data, computed values, or any\n * other output that the test function produces as part of its business logic\n * validation or endpoint testing.\n *\n * For successful test executions, this value represents the expected result\n * that demonstrates correct implementation behavior. The return value\n * provides insight into the test execution flow and can be analyzed to verify\n * that API responses match expected formats, business logic produces correct\n * outcomes, and data transformations operate as intended.\n */\n value: unknown;\n\n /**\n * Error information captured during test function execution, if any occurred.\n *\n * Contains detailed error information when the test function encounters\n * exceptions, assertion failures, timeout conditions, or other error states\n * during execution. When null, it indicates that the test completed\n * successfully without encountering any error conditions. When present, the\n * error provides comprehensive diagnostic information for understanding\n * implementation issues or test failures.\n *\n * Error information is crucial for identifying implementation defects, API\n * contract violations, business logic errors, integration failures, or\n * performance issues that prevent the backend application from meeting its\n * requirements. The error details enable developers to pinpoint specific\n * problems and implement necessary corrections to achieve full compliance\n * with validation scenarios.\n */\n error: null | unknown;\n\n /**\n * Precise timestamp when this specific test operation began execution.\n *\n * Records the exact moment when this individual test function started\n * execution, providing the reference point for measuring test duration and\n * understanding the temporal sequence of test operations within the overall\n * validation process. This timestamp enables detailed performance analysis\n * and execution timeline reconstruction.\n *\n * The start timestamp is essential for identifying execution patterns,\n * analyzing test concurrency behavior, measuring individual test performance,\n * and understanding the temporal distribution of test execution within the\n * comprehensive validation suite.\n */\n started_at: string & tags.Format<\"date-time\">;\n\n /**\n * Precise timestamp when this specific test operation finished execution.\n *\n * Records the exact moment when this individual test function completed\n * execution, regardless of whether it succeeded or failed. Combined with the\n * start timestamp, this enables precise calculation of test execution\n * duration and provides completion reference for the overall test timeline.\n *\n * The completion timestamp is valuable for performance analysis of individual\n * test operations, identifying slow-performing test scenarios, understanding\n * test execution efficiency, and maintaining comprehensive audit trails of\n * the validation process. It supports optimization efforts and helps identify\n * potential bottlenecks in either the test implementation or the backend\n * application being validated.\n */\n completed_at: string & tags.Format<\"date-time\">;\n}\n",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const AutoBeCompilerRealizeTemplateOfPostgres: Record<string, string> = {
|
|
2
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
|
|
3
|
+
"src/MyGlobal.ts": "import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"@prisma/client\";\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\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
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
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const AutoBeCompilerRealizeTemplateOfSQLite: Record<string, string> = {
|
|
2
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
|
|
3
|
+
"src/MyGlobal.ts": "import { PrismaBetterSQLite3 } from \"@prisma/adapter-better-sqlite3\";\nimport { PrismaClient } from \"@prisma/client\";\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}\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
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
5
|
};
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
IAutoBeTypeScriptCompileProps,
|
|
7
7
|
IAutoBeTypeScriptCompileResult,
|
|
8
8
|
} from "@autobe/interface";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
AutoBeOpenApiEndpointComparator,
|
|
11
|
+
validateTestFunction,
|
|
12
|
+
} from "@autobe/utils";
|
|
10
13
|
import { EmbedEsLint } from "embed-eslint";
|
|
11
14
|
import { HashMap, Pair } from "tstl";
|
|
12
15
|
import ts from "typescript";
|
|
@@ -79,8 +82,8 @@ export class AutoBeTestCompiler implements IAutoBeTestCompiler {
|
|
|
79
82
|
op,
|
|
80
83
|
),
|
|
81
84
|
),
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
86
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
84
87
|
);
|
|
85
88
|
validateTestFunction({
|
|
86
89
|
function: props.function,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutoBeOpenApi, IAutoBeTestWriteProps } from "@autobe/interface";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
AutoBeOpenApiEndpointComparator,
|
|
4
4
|
transformOpenApiDocument,
|
|
5
5
|
} from "@autobe/utils";
|
|
6
6
|
import { NestiaMigrateImportProgrammer } from "@nestia/migrate/lib/programmers/NestiaMigrateImportProgrammer";
|
|
@@ -75,13 +75,13 @@ function associate(
|
|
|
75
75
|
o,
|
|
76
76
|
),
|
|
77
77
|
),
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
79
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
80
80
|
);
|
|
81
81
|
const functions: HashMap<AutoBeOpenApi.IEndpoint, IAutoBeTestApiFunction> =
|
|
82
82
|
new HashMap(
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
84
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
// from migrate application
|