UNPKG

@autobe/agent

Version:

AI backend server code generator

799 lines 132 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.orchestrateDatabaseSchema = orchestrateDatabaseSchema; 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 tstl_1 = require("tstl"); const typia_1 = __importDefault(require("typia")); const uuid_1 = require("uuid"); const executeCachedBatch_1 = require("../../utils/executeCachedBatch"); const AutoBePreliminaryController_1 = require("../common/AutoBePreliminaryController"); const transformDatabaseSchemaHistory_1 = require("./histories/transformDatabaseSchemaHistory"); const AutoBeDatabaseSchemaProgrammer_1 = require("./programmers/AutoBeDatabaseSchemaProgrammer"); function orchestrateDatabaseSchema(ctx, props) { return __awaiter(this, void 0, void 0, function* () { const start = new Date(); const total = props.components .map((c) => c.tables.filter((n) => props.written.has(n.name) === false).length) .reduce((x, y) => x + y, 0); props.progress.total += total; // Flatten component list into individual table tasks const designPairs = props.components.flatMap((component) => component.tables .filter((table) => props.written.has(table.name) === false) .map((table) => ({ component, design: table, }))); const events = yield (0, executeCachedBatch_1.executeCachedBatch)(ctx, designPairs.map((task) => (promptCacheKey) => __awaiter(this, void 0, void 0, function* () { const counter = new tstl_1.Singleton(() => ++props.progress.completed); try { const otherComponents = props.components.filter((c) => c !== task.component); const event = yield process(ctx, { instruction: props.instruction, progress: props.progress, counter, component: task.component, design: task.design, otherComponents, start, promptCacheKey, }); ctx.dispatch(event); return event; } catch (error) { counter.get(); console.log("database schema error", task.design.name, error); const count = props.failed.get(task.design.name); if (count === undefined) props.failed.set(task.design.name, 1); else if (count < 3) props.failed.set(task.design.name, count + 1); else throw error; return null; } }))); return events.filter((e) => e !== null); }); } function process(ctx, props) { 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: { "IAutoBeDatabaseSchemaApplication.IProps": { type: "object", properties: { thinking: { type: "string", description: "Think before you act.\n\nFor preliminary requests: what information is missing and why?\n\nFor write: what you're submitting and key design decisions.\n\nFor complete: why you consider the last write final." }, request: { oneOf: [ { $ref: "#/components/schemas/IAutoBePreliminaryComplete" }, { $ref: "#/components/schemas/IAutoBePreliminaryGetPreviousAnalysisSections" }, { $ref: "#/components/schemas/IAutoBePreliminaryGetAnalysisSections" }, { $ref: "#/components/schemas/IAutoBePreliminaryGetPreviousDatabaseSchemas" }, { $ref: "#/components/schemas/IAutoBeDatabaseSchemaApplication.IWrite" } ], discriminator: { propertyName: "type", mapping: { complete: "#/components/schemas/IAutoBePreliminaryComplete", getPreviousAnalysisSections: "#/components/schemas/IAutoBePreliminaryGetPreviousAnalysisSections", getAnalysisSections: "#/components/schemas/IAutoBePreliminaryGetAnalysisSections", getPreviousDatabaseSchemas: "#/components/schemas/IAutoBePreliminaryGetPreviousDatabaseSchemas", write: "#/components/schemas/IAutoBeDatabaseSchemaApplication.IWrite" } }, description: "Action to perform. Exhausted preliminary types are removed from the\nunion, physically preventing repeated calls." } }, required: [ "thinking", "request" ] }, IAutoBePreliminaryComplete: { type: "object", properties: { type: { "const": "complete", description: "Type discriminator for completion request." } }, required: [ "type" ], description: "Finalize the write loop by accepting your most recent `write` as-is.\n\nAfter submitting a `write`, review it yourself thoroughly against the review\nchecklist in your instructions. If you find issues worth fixing, submit\nanother `write` with corrections. When you are satisfied with the quality,\ncall `complete` to finalize.\n\nYou have a maximum of 3 write attempts, but this is a safety cap \u2014 not a\ntarget to fill.\n\nOnly valid after at least one `write` submission \u2014 rejected otherwise." }, 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." }, 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." }, 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." }, "IAutoBeDatabaseSchemaApplication.IWrite": { type: "object", properties: { type: { "const": "write", description: "Type discriminator for write submission." }, plan: { type: "string", description: "Database design plan for the target table and any child tables (1NF\ndecomposition).\n\nChild table naming: singular form of targetTable as prefix (e.g.,\n\"shopping_order_items\"). Never recreate existing tables from\notherComponents. Strict 1NF/2NF/3NF adherence. Junction tables:\n{table1}_{table2}. Materialized views: mv_ prefix." }, definition: { $ref: "#/components/schemas/AutoBeDatabaseSchemaDefinition", description: "Schema definition with exactly one\n{@link AutoBeDatabaseSchemaDefinition.model} (the target table).\nAdditional child tables go in\n{@link AutoBeDatabaseSchemaDefinition.newDesigns} as name + description\npairs.\n\nKey rules: UUID \"id\" primary keys, data types limited to\nuuid/string/int/double/ datetime/boolean/uri, no derived values, strict\n3NF, mv_ prefix for materialized views, consistent\ncreated_at/updated_at/deleted_at, PlainIndexes never single FK." } }, required: [ "type", "plan", "definition" ], description: "Submit production-ready database schema models." }, AutoBeDatabaseSchemaDefinition: { type: "object", properties: { model: { $ref: "#/components/schemas/AutoBeDatabase.IModel", description: "The single database table model produced by this call." }, newDesigns: { type: "array", items: { $ref: "#/components/schemas/AutoBeDatabaseComponentTableDesign" }, description: "Name+description pairs for child tables discovered during generation (1NF\ndecomposition, junction tables, etc.). Each feeds back into the pipeline as\na separate generation call." } }, required: [ "model", "newDesigns" ], description: "Output of a single schema generation or review call.\n\nOne target table model + lightweight designs for newly discovered child\ntables. Single-model constraint keeps output within LLM token budget." }, "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)." }, AutoBeDatabaseComponentTableDesign: { type: "object", properties: { description: { type: "string", description: "Business purpose of this table. One or two sentences maximum. MUST be\nwritten in English." }, name: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "Table name in snake_case with domain prefix (e.g., \"shopping_customers\")." } }, required: [ "description", "name" ], description: "Table design with name and description." } } }, functions: [ { name: "process", async: false, parameters: [ { name: "props", description: " Preliminary data request, write submission, or completion\nconfirmation", required: true, schema: { $ref: "#/components/schemas/IAutoBeDatabaseSchemaApplication.IProps" } } ], description: "Process schema generation task." } ] }, source: SOURCE, kinds: [ "analysisSections", "previousAnalysisSections", "previousDatabaseSchemas", "complete", ], state: ctx.state(), config: { database: "ast", }, }); return yield preliminary.orchestrate(ctx, (out) => __awaiter(this, void 0, void 0, function* () { var _a, _b; const pointer = { value: null, }; const result = yield ctx.conversate(Object.assign({ source: SOURCE, controller: createController({ preliminary, targetComponent: props.component, otherComponents: props.otherComponents, design: props.design, build: (next) => { pointer.value = next; }, dispatch: ctx.dispatch, }), enforceFunctionCall: true, promptCacheKey: props.promptCacheKey }, (0, transformDatabaseSchemaHistory_1.transformDatabaseSchemaHistory)({ component: props.component, design: props.design, otherComponents: props.otherComponents, instruction: props.instruction, preliminary, }))); if (pointer.value === null) return out(result)(null); return out(result)({ type: SOURCE, id: (0, uuid_1.v7)(), created_at: props.start.toISOString(), plan: pointer.value.plan, namespace: props.component.namespace, definition: pointer.value.definition, acquisition: preliminary.getAcquisition(), metric: result.metric, tokenUsage: result.tokenUsage, completed: props.counter.get(), total: props.progress.total, step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0, }); })); }); } 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 => "complete" === input.type; const _io2 = 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 _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.plan && ("object" === typeof input.definition && null !== input.definition && _io6(input.definition)); const _io6 = input => "object" === typeof input.model && null !== input.model && _io7(input.model) && (Array.isArray(input.newDesigns) && input.newDesigns.every(elem => "object" === typeof elem && null !== elem && _io15(elem))); const _io7 = 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 && _io8(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io9(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io11(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io12(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io13(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io14(elem))); const _io8 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io9 = 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 && _io10(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io10 = 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 _io11 = 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 _io12 = 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 _io13 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io14 = input => "string" === typeof input.fieldName; const _io15 = input => "string" === typeof input.description && ("string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name)); const _iu0 = input => (() => { if ("complete" === input.type) return _io1(input); else if ("getPreviousAnalysisSections" === input.type) return _io3(input); else if ("getAnalysisSections" === input.type) return _io2(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: "(IAutoBeDatabaseSchemaApplication.IWrite | IAutoBePreliminaryComplete | IAutoBePreliminaryGetAnalysisSections | IAutoBePreliminaryGetPreviousAnalysisSections | IAutoBePreliminaryGetPreviousDatabaseSchemas)", value: input.request })) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, { path: _path + ".request", expected: "(IAutoBeDatabaseSchemaApplication.IWrite | IAutoBePreliminaryComplete | IAutoBePreliminaryGetAnalysisSections | IAutoBePreliminaryGetPreviousAnalysisSections | IAutoBePreliminaryGetPreviousDatabaseSchemas)", value: input.request })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["complete" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"complete\"", value: input.type })].every(flag => flag); const _vo2 = (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, _index12) => "number" === typeof elem && (__typia_transform__isTypeUint32._isTypeUint32(elem) || _report(_exceptionable, { path: _path + ".sectionIds[" + _index12 + "]", expected: "number & Type<\"uint32\">", value: elem })) || _report(_exceptionable, { path: _path + ".sectionIds[" + _index12 + "]", 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 _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, _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>)", 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, _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 _vo5 = (input, _path, _exceptionable = true) => ["write" === input.type || _report(_exceptionable, { path: _path + ".type", expected: "\"write\"", value: input.type }), "string" === typeof input.plan || _report(_exceptionable, { path: _path + ".plan", expected: "string", value: input.plan }), ("object" === typeof input.definition && null !== input.definition || _report(_exceptionable, { path: _path + ".definition", expected: "AutoBeDatabaseSchemaDefinition", value: input.definition })) && _vo6(input.definition, _path + ".definition", true && _exceptionable) || _report(_exceptionable, { path: _path + ".definition", expected: "AutoBeDatabaseSchemaDefinition", value: input.definition })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [("object" === typeof input.model && null !== input.model || _report(_exceptionable, { path: _path + ".model", expected: "AutoBeDatabase.IModel", value: input.model })) && _vo7(input.model, _path + ".model", true && _exceptionable) || _report(_exceptionable, { path: _path + ".model", expected: "AutoBeDatabase.IModel", value: input.model }), (Array.isArray(input.newDesigns) || _report(_exceptionable, { path: _path + ".newDesigns", expected: "Array<AutoBeDatabaseComponentTableDesign>", value: input.newDesigns })) && input.newDesigns.map((elem, _index15) => ("object" === typeof elem && null !== elem || _report(_exceptionable, { path: _path + ".newDesigns[" + _index15 + "]", expected: "AutoBeDatabaseComponentTableDesign", value: elem })) && _vo15(elem, _path + ".newDesigns[" + _index15 + "]", true && _exceptionable) || _report(_exceptionable, { path: _path + ".newDesigns[" + _index15 + "]", expected: "AutoBeDatabaseComponentTableDesign", value: elem })).every(flag => flag) || _report(_exceptionable, { path: _path + ".newDesigns", expected: "Array<AutoBeDatabaseComponentTableDesign>", value: input.newDesigns })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => ["string"