UNPKG

@autobe/agent

Version:

AI backend server code generator

832 lines 127 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.orchestrateDatabaseCorrect = orchestrateDatabaseCorrect; const __typia_transform__isTypeUint32 = __importStar(require("typia/lib/internal/_isTypeUint32")); const __typia_transform__isUniqueItems = __importStar(require("typia/lib/internal/_isUniqueItems")); const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport")); const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize")); const typia_1 = __importDefault(require("typia")); const uuid_1 = require("uuid"); const AutoBePreliminaryController_1 = require("../common/AutoBePreliminaryController"); const transformDatabaseCorrectHistory_1 = require("./histories/transformDatabaseCorrectHistory"); const AutoBeDatabaseModelProgrammer_1 = require("./programmers/AutoBeDatabaseModelProgrammer"); function orchestrateDatabaseCorrect(ctx, application) { const unique = new Set(); for (const file of application.files) file.models = file.models.filter((model) => { if (unique.has(model.name)) return false; unique.add(model.name); return true; }); application.files = application.files.filter((f) => f.models.length !== 0); return iterate(ctx, application, 30 /* AutoBeConfigConstant.DATABASE_CORRECT_RETRY */); } function iterate(ctx, application, life) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const compiler = yield ctx.compiler(); const result = yield compiler.database.validate(application); if (result.success) return result; // SUCCESS else if (life < 0) return result; // FAILURE // VALIDATION FAILED const schemas = yield compiler.database.writePrismaSchemas(application, "postgres"); ctx.dispatch({ type: "databaseValidate", id: (0, uuid_1.v7)(), result, schemas, compiled: yield compiler.database.compilePrismaSchemas({ files: schemas, }), step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0, created_at: new Date().toISOString(), }); const data = yield (() => __awaiter(this, void 0, void 0, function* () { try { const next = yield process(ctx, result); return next.correction; } catch (error) { console.log("prismaCorrect iterate failure", error); return result.data; } }))(); return yield iterate(ctx, data, life - 1); }); } function process(ctx_1, failure_1) { return __awaiter(this, arguments, void 0, function* (ctx, failure, capacity = 8) { const count = getTableCount(failure); if (count <= capacity) return execute(ctx, failure); let correction = failure.data; const volume = Math.ceil(count / capacity); const plannings = []; const models = {}; let i = 0; while (i++ < volume && failure.errors.length !== 0) { const next = yield execute(ctx, Object.assign(Object.assign({}, failure), { errors: (() => { var _a; const unique = new Set(); const errors = []; for (const err of failure.errors) { unique.add((_a = err.table) !== null && _a !== void 0 ? _a : null); if (unique.size > capacity) break; else errors.push(err); } return errors; })() })); plannings.push(next.planning); for (const m of next.models) models[m.name] = m; const compiler = yield ctx.compiler(); const result = yield compiler.database.validate(next.correction); correction = next.correction; if (result.success === true) break; else failure = result; } return { type: "write", planning: plannings.join("\n\n"), models: Object.values(models), correction, }; }); } function execute(ctx, failure) { return __awaiter(this, void 0, void 0, function* () { const preliminary = new AutoBePreliminaryController_1.AutoBePreliminaryController({ dispatch: (e) => ctx.dispatch(e), application: { version: "3.1", components: { schemas: { "IAutoBeDatabaseCorrectApplication.IProps": { type: "object", properties: { thinking: { type: "string", description: "Think before you act.\n\nFor preliminary requests: what critical information is missing and why?\nBe brief \u2014 state the gap, don't list everything you have.\n\nFor write submissions: summarize what errors you are fixing and how." }, request: { oneOf: [ { $ref: "#/components/schemas/IAutoBePreliminaryGetAnalysisSections" }, { $ref: "#/components/schemas/IAutoBePreliminaryGetDatabaseSchemas" }, { $ref: "#/components/schemas/IAutoBePreliminaryGetPreviousAnalysisSections" }, { $ref: "#/components/schemas/IAutoBePreliminaryGetPreviousDatabaseSchemas" }, { $ref: "#/components/schemas/IAutoBeDatabaseCorrectApplication.IWrite" } ], discriminator: { propertyName: "type", mapping: { getAnalysisSections: "#/components/schemas/IAutoBePreliminaryGetAnalysisSections", getDatabaseSchemas: "#/components/schemas/IAutoBePreliminaryGetDatabaseSchemas", getPreviousAnalysisSections: "#/components/schemas/IAutoBePreliminaryGetPreviousAnalysisSections", getPreviousDatabaseSchemas: "#/components/schemas/IAutoBePreliminaryGetPreviousDatabaseSchemas", write: "#/components/schemas/IAutoBeDatabaseCorrectApplication.IWrite" } }, description: "Action to perform.\n\nPreliminary `getXxx` types are removed from the union once exhausted." } }, required: [ "thinking", "request" ] }, IAutoBePreliminaryGetAnalysisSections: { type: "object", properties: { type: { "const": "getAnalysisSections", description: "Type discriminator." }, sectionIds: { type: "array", items: { type: "integer", minimum: 0 }, minItems: 1, maxItems: 100, description: "Section IDs to retrieve. DO NOT request same IDs already requested in\nprevious calls." } }, required: [ "type", "sectionIds" ], description: "Request to retrieve individual analysis sections by numeric ID." }, IAutoBePreliminaryGetDatabaseSchemas: { type: "object", properties: { type: { "const": "getDatabaseSchemas", description: "Type discriminator." }, schemaNames: { type: "array", items: { type: "string" }, minItems: 1, description: "Database table names to retrieve. DO NOT request same names already\nrequested in previous calls." } }, required: [ "type", "schemaNames" ], description: "Request to retrieve database schema definitions for context." }, IAutoBePreliminaryGetPreviousAnalysisSections: { type: "object", properties: { type: { "const": "getPreviousAnalysisSections", description: "Type discriminator." }, sectionIds: { type: "array", items: { type: "integer", minimum: 0 }, minItems: 1, description: "Section IDs to retrieve from previous iteration. DO NOT request same IDs\nalready requested in previous calls." } }, required: [ "type", "sectionIds" ], description: "Request to retrieve analysis sections from the previous iteration by numeric\nID." }, IAutoBePreliminaryGetPreviousDatabaseSchemas: { type: "object", properties: { type: { "const": "getPreviousDatabaseSchemas", description: "Type discriminator." }, schemaNames: { type: "array", items: { type: "string" }, minItems: 1, description: "Table names to retrieve from previous iteration. DO NOT request same names\nalready requested in previous calls." } }, required: [ "type", "schemaNames" ], description: "Request to retrieve database schemas from the previous iteration.\n\nLoads database table definitions from the last successfully generated\nversion, used as reference context during regeneration or modification\ncycles." }, "IAutoBeDatabaseCorrectApplication.IWrite": { type: "object", properties: { type: { "const": "write", description: "Type discriminator for write submission." }, planning: { type: "string", description: "Execution plan for fixing validation errors. Required steps:\n\n1. Error scope analysis \u2014 list all validation errors, extract affected table\n names, categorize by type (duplications, references, types, indexes)\n2. Targeted fix strategy \u2014 focus ONLY on models in errors, outline minimal\n changes per model\n3. Model-specific fix plan \u2014 detail corrections per affected model\n4. Minimal scope validation \u2014 confirm which models are in/out of output\n5. Targeted impact assessment \u2014 verify fixes don't break references from\n unchanged models\n\nPreserve all business logic and cross-model references." }, models: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabase.IModel" }, description: "Models with validation errors that need correction.\n\nContains ONLY models from IAutoBeDatabaseValidation.IError[]. Output\ncorrected versions of these models only. Cross-model references must stay\nvalid but target models are not modified." } }, required: [ "type", "planning", "models" ], description: "Submit corrected models." }, "AutoBeDatabase.IModel": { type: "object", properties: { name: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "MUST use snake_case. Materialized views use \"mv_\" prefix." }, description: { type: "string", description: "Business purpose of this model.\n\nFormat: summary sentence first, `\\n\\n`, then paragraphs grouped by topic.\nUse `{@\\link ModelName}` for cross-references.\n\n> MUST be written in English." }, material: { type: "boolean", description: "Whether this model is a materialized view (read-only cached query). If\ntrue, name must use \"mv_\" prefix." }, stance: { oneOf: [ { "const": "primary" }, { "const": "subsidiary" }, { "const": "snapshot" }, { "const": "actor" }, { "const": "session" } ], description: "Architectural role of this model, guiding API endpoint generation.\n\n- \"primary\": Core entity users manage independently (full CRUD APIs). Use\n when users need to create, search, or manage entities outside their\n parent context.\n- \"actor\": Authenticated user type with its own identity, credentials, and\n auth flow. Generates auth endpoints.\n- \"session\": Login session table belonging to exactly one actor.\n Append-only audit trail, managed via auth flows.\n- \"subsidiary\": Supporting entity managed through its parent, rarely needs\n standalone endpoints.\n- \"snapshot\": Point-in-time versioning record, typically append-only and\n read-only from user perspective." }, primaryField: { $ref: "#/components/schemas/AutoBeDatabase.IPrimaryField", description: "Primary key field (UUID)." }, foreignFields: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabase.IForeignField" }, description: "Foreign key fields establishing relationships to other models." }, plainFields: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabase.IPlainField" }, description: "Regular data fields (names, timestamps, flags, amounts, etc.)." }, uniqueIndexes: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabase.IUniqueIndex" }, description: "Unique indexes for data integrity constraints." }, plainIndexes: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabase.IPlainIndex" }, description: "Regular indexes for query performance." }, ginIndexes: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabase.IGinIndex" }, description: "GIN indexes for PostgreSQL full-text search (trigram)." } }, required: [ "name", "description", "material", "stance", "primaryField", "foreignFields", "plainFields", "uniqueIndexes", "plainIndexes", "ginIndexes" ], description: "A single Prisma model (database table)." }, "AutoBeDatabase.IPrimaryField": { type: "object", properties: { name: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "MUST use snake_case." }, type: { "const": "uuid" }, description: { type: "string", description: "Business purpose of this primary key. MUST be written in English." } }, required: [ "name", "type", "description" ], description: "Primary key field of a model." }, "AutoBeDatabase.IForeignField": { type: "object", properties: { name: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "MUST use snake_case. Convention: \"{target_model}_id\"." }, type: { "const": "uuid" }, description: { type: "string", description: "Describe the relationship purpose and semantics of this foreign key.\n\nFormat: summary sentence first, `\\n\\n`, then paragraphs grouped by topic.\nUse `{@\\link ModelName}` for cross-references.\n\n> MUST be written in English." }, relation: { $ref: "#/components/schemas/AutoBeDatabase.IRelation", description: "Prisma relation configuration." }, unique: { type: "boolean", description: "True for 1:1 relationships, false for 1:N." }, nullable: { type: "boolean", description: "True if the relationship is optional." } }, required: [ "name", "type", "description", "relation", "unique", "nullable" ], description: "Foreign key field establishing a relationship to another model." }, "AutoBeDatabase.IRelation": { type: "object", properties: { name: { type: "string", pattern: "^[a-z][a-zA-Z0-9]*$", description: "Relation property name in this model. MUST use camelCase." }, targetModel: { type: "string", description: "Must match an existing model name in the schema." }, oppositeName: { type: "string", pattern: "^[a-z][a-zA-Z0-9]*$", description: "Inverse relation property name generated in the target model. Typically\nplural for 1:N (e.g., \"comments\"), singular for 1:1." } }, required: [ "name", "targetModel", "oppositeName" ], description: "Prisma" }, "AutoBeDatabase.IPlainField": { type: "object", properties: { name: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "MUST use snake_case." }, type: { oneOf: [ { "const": "string" }, { "const": "boolean" }, { "const": "uuid" }, { "const": "uri" }, { "const": "int" }, { "const": "double" }, { "const": "datetime" } ], description: "Prisma/PostgreSQL type mapping: boolean, int, double, string, uri, uuid\n(non-FK), datetime." }, description: { type: "string", description: "Business purpose of this field.\n\nFormat: summary sentence first, `\\n\\n`, then paragraphs grouped by topic.\nUse `{@\\link ModelName}` for cross-references.\n\n> MUST be written in English." }, nullable: { type: "boolean", description: "Whether this field can be null." } }, required: [ "name", "type", "description", "nullable" ], description: "A regular data field (not a primary or foreign key)." }, "AutoBeDatabase.IUniqueIndex": { type: "object", properties: { fieldNames: { type: "array", items: { type: "string" }, minItems: 1, uniqueItems: true, description: "Field names forming the unique constraint. All must exist in the model." }, unique: { "const": true, description: "Always true. Distinguishes from plain indexes." } }, required: [ "fieldNames", "unique" ], description: "Unique index constraint (@@unique)." }, "AutoBeDatabase.IPlainIndex": { type: "object", properties: { fieldNames: { type: "array", items: { type: "string" }, minItems: 1, uniqueItems: true, description: "Field names to index. Order matters for composite indexes." } }, required: [ "fieldNames" ], description: "Regular index for query performance (@@index)." }, "AutoBeDatabase.IGinIndex": { type: "object", properties: { fieldName: { type: "string", description: "Must be a string field containing searchable text." } }, required: [ "fieldName" ], description: "GIN index for PostgreSQL full-text search (gin_trgm_ops)." } } }, functions: [ { name: "process", async: false, parameters: [ { name: "props", description: " Request containing preliminary data request or write\nsubmission", required: true, schema: { $ref: "#/components/schemas/IAutoBeDatabaseCorrectApplication.IProps" } } ], description: "Process schema correction task or preliminary data requests.\n\nWorkflow:\n\n1. Request preliminary context if needed (getAnalysisSections, etc.)\n2. Submit corrected models via `write`" } ] }, source: SOURCE, kinds: [ "analysisSections", "previousAnalysisSections", "databaseSchemas", "previousDatabaseSchemas", ], state: ctx.state(), all: { databaseSchemas: failure.data.files.map((f) => f.models).flat(), }, local: { databaseSchemas: Array.from(new Set(failure.errors.map((e) => e.table).filter((t) => t !== null))) .map((table) => failure.data.files .map((f) => f.models) .flat() .find((m) => m.name === table)) .filter((m) => m !== undefined), }, config: { database: "ast", }, }); const pointer = { value: null, }; const event = yield preliminary.orchestrate(ctx, (out) => __awaiter(this, void 0, void 0, function* () { var _a, _b; const result = yield ctx.conversate(Object.assign({ source: SOURCE, controller: createController({ preliminary, build: (next) => { pointer.value = next; }, }), enforceFunctionCall: true }, (0, transformDatabaseCorrectHistory_1.transformDatabaseCorrectHistory)({ preliminary, result: failure, }))); if (pointer.value === null) return out(result)(null); const correction = { files: failure.data.files.map((file) => ({ filename: file.filename, namespace: file.namespace, models: file.models.map((model) => { var _a; AutoBeDatabaseModelProgrammer_1.AutoBeDatabaseModelProgrammer.emend(model); const newbie = (_a = pointer.value) === null || _a === void 0 ? void 0 : _a.models.find((m) => m.name === model.name); return newbie !== null && newbie !== void 0 ? newbie : model; }), })), }; return out(result)({ type: SOURCE, id: (0, uuid_1.v7)(), failure, planning: pointer.value.planning, correction: correction, acquisition: preliminary.getAcquisition(), metric: result.metric, tokenUsage: result.tokenUsage, step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0, created_at: new Date().toISOString(), }); })); ctx.dispatch(event); return Object.assign(Object.assign({}, pointer.value), { correction: event.correction }); }); } const getTableCount = (failure) => { const unique = new Set(failure.errors.map((error) => { var _a; return (_a = error.table) !== null && _a !== void 0 ? _a : null; })); return unique.size; }; function createController(props) { const validate = (input) => { const result = (() => { const _io0 = input => "string" === typeof input.thinking && ("object" === typeof input.request && null !== input.request && _iu0(input.request)); const _io1 = input => "getAnalysisSections" === input.type && (Array.isArray(input.sectionIds) && (1 <= input.sectionIds.length && input.sectionIds.length <= 100 && input.sectionIds.every(elem => "number" === typeof elem && __typia_transform__isTypeUint32._isTypeUint32(elem)))); const _io2 = input => "getDatabaseSchemas" === input.type && (Array.isArray(input.schemaNames) && (1 <= input.schemaNames.length && input.schemaNames.every(elem => "string" === typeof elem))); const _io3 = input => "getPreviousAnalysisSections" === input.type && (Array.isArray(input.sectionIds) && (1 <= input.sectionIds.length && input.sectionIds.every(elem => "number" === typeof elem && __typia_transform__isTypeUint32._isTypeUint32(elem)))); const _io4 = input => "getPreviousDatabaseSchemas" === input.type && (Array.isArray(input.schemaNames) && (1 <= input.schemaNames.length && input.schemaNames.every(elem => "string" === typeof elem))); const _io5 = input => "write" === input.type && "string" === typeof input.planning && (Array.isArray(input.models) && input.models.every(elem => "object" === typeof elem && null !== elem && _io6(elem))); const _io6 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || "actor" === input.stance || "session" === input.stance) && ("object" === typeof input.primaryField && null !== input.primaryField && _io7(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io8(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io10(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io11(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io12(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io13(elem))); const _io7 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io8 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io9(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io9 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.targetModel && ("string" === typeof input.oppositeName && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.oppositeName)); const _io10 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable; const _io11 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && true === input.unique; const _io12 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io13 = input => "string" === typeof input.fieldName; const _iu0 = input => (() => { if ("getAnalysisSections" === input.type) return _io1(input); else if ("getDatabaseSchemas" === input.type) return _io2(input); else if ("getPreviousAnalysisSections" === input.type) return _io3(input); else if ("getPreviousDatabaseSchemas" === input.type) return _io4(input); else if ("write" === input.type) return _io5(input); else return false; })(); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.thinking || _report(_exceptionable, { path: _path + ".thinking", expected: "string", value: input.thinking }), ("object" === typeof input.request && null !== input.request || _report(_exceptionable, { path: _path + ".request", expected: "(IAutoBeDatabaseCorrectApplication.IWrite | IAutoBePreliminaryGetAnalysisSections | IAutoBePreliminaryGetDatabaseSchemas | IAutoBePreliminaryGetPreviousAnalysisSections | IAutoBePreliminaryGetPreviousDatabaseSchemas)", value: input.request })) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, { path: _path + ".request", expected: "(IAutoBeDatabaseCorrectApplication.IWrite | IAutoBePreliminaryGetAnalysisSections | IAutoBePreliminaryGetDatabaseSchemas | IAutoBePreliminaryGetPreviousAnalysisSections | IAutoBePreliminaryGetPreviousDatabaseSchemas)", value: input.request })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["getAnalysisSections" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"getAnalysisSections\"", value: input.type }), (Array.isArray(input.sectionIds) || _report(_exceptionable, { path: _path + ".sectionIds", expected: "(Array<number & Type<\"uint32\">> & MinItems<1> & MaxItems<100>)", value: input.sectionIds })) && ((1 <= input.sectionIds.length || _report(_exceptionable, { path: _path + ".sectionIds", expected: "Array<> & MinItems<1>", value: input.sectionIds })) && (input.sectionIds.length <= 100 || _report(_exceptionable, { path: _path + ".sectionIds", expected: "Array<> & MaxItems<100>", value: input.sectionIds })) && input.sectionIds.map((elem, _index13) => "number" === typeof elem && (__typia_transform__isTypeUint32._isTypeUint32(elem) || _report(_exceptionable, { path: _path + ".sectionIds[" + _index13 + "]", expected: "number & Type<\"uint32\">", value: elem })) || _report(_exceptionable, { path: _path + ".sectionIds[" + _index13 + "]", expected: "(number & Type<\"uint32\">)", value: elem })).every(flag => flag)) || _report(_exceptionable, { path: _path + ".sectionIds", expected: "(Array<number & Type<\"uint32\">> & MinItems<1> & MaxItems<100>)", value: input.sectionIds })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["getDatabaseSchemas" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"getDatabaseSchemas\"", value: input.type }), (Array.isArray(input.schemaNames) || _report(_exceptionable, { path: _path + ".schemaNames", expected: "(Array<string> & MinItems<1>)", value: input.schemaNames })) && ((1 <= input.schemaNames.length || _report(_exceptionable, { path: _path + ".schemaNames", expected: "Array<> & MinItems<1>", value: input.schemaNames })) && input.schemaNames.map((elem, _index14) => "string" === typeof elem || _report(_exceptionable, { path: _path + ".schemaNames[" + _index14 + "]", expected: "string", value: elem })).every(flag => flag)) || _report(_exceptionable, { path: _path + ".schemaNames", expected: "(Array<string> & MinItems<1>)", value: input.schemaNames })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["getPreviousAnalysisSections" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"getPreviousAnalysisSections\"", value: input.type }), (Array.isArray(input.sectionIds) || _report(_exceptionable, { path: _path + ".sectionIds", expected: "(Array<number & Type<\"uint32\">> & MinItems<1>)", value: input.sectionIds })) && ((1 <= input.sectionIds.length || _report(_exceptionable, { path: _path + ".sectionIds", expected: "Array<> & MinItems<1>", value: input.sectionIds })) && input.sectionIds.map((elem, _index15) => "number" === typeof elem && (__typia_transform__isTypeUint32._isTypeUint32(elem) || _report(_exceptionable, { path: _path + ".sectionIds[" + _index15 + "]", expected: "number & Type<\"uint32\">", value: elem })) || _report(_exceptionable, { path: _path + ".sectionIds[" + _index15 + "]", expected: "(number & Type<\"uint32\">)", value: elem })).every(flag => flag)) || _report(_exceptionable, { path: _path + ".sectionIds", expected: "(Array<number & Type<\"uint32\">> & MinItems<1>)", value: input.sectionIds })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["getPreviousDatabaseSchemas" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"getPreviousDatabaseSchemas\"", value: input.type }), (Array.isArray(input.schemaNames) || _report(_exceptionable, { path: _path + ".schemaNames", expected: "(Array<string> & MinItems<1>)", value: input.schemaNames })) && ((1 <= input.schemaNames.length || _report(_exceptionable, { path: _path + ".schemaNames", expected: "Array<> & MinItems<1>", value: input.schemaNames })) && input.schemaNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, { path: _path + ".schemaNames[" + _index16 + "]", expected: "string", value: elem })).every(flag => flag)) || _report(_exceptionable, { path: _path + ".schemaNames", expected: "(Array<string> & MinItems<1>)", value: input.schemaNames })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["write" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"write\"", value: input.type }), "string" === typeof input.planning || _report(_exceptionable, { path: _path + ".planning", expected: "string", value: input.planning }), (Array.isArray(input.models) || _report(_exceptionable, { path: _path + ".models", expected: "Array<AutoBeDatabase.IModel>", value: input.models })) && input.models.map((elem, _index17) => ("object" === typeof elem && null !== elem || _report(_exceptionable, { path: _path + ".models[" + _index17 + "]", expected: "AutoBeDatabase.IModel", value: elem })) && _vo6(elem, _path + ".models[" + _index17 + "]", true && _exceptionable) || _report(_exceptionable, { path: _path + ".models[" + _index17 + "]", expected: "AutoBeDatabase.IModel", value: elem })).every(flag => flag) || _report(_exceptionable, { path: _path + ".models", expected: "Array<AutoBeDatabase.IModel>", value: input.models })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _re