@autobe/agent
Version:
AI backend server code generator
647 lines • 692 kB
JavaScript
"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.orchestrateInterfaceComplement = void 0;
const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString.js"));
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize.js"));
const utils_1 = require("@autobe/utils");
const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
const typia_1 = __importDefault(require("typia"));
const uuid_1 = require("uuid");
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
const divideArray_1 = require("../../utils/divideArray");
const AutoBePreliminaryController_1 = require("../common/AutoBePreliminaryController");
const transformInterfaceComplementHistory_1 = require("./histories/transformInterfaceComplementHistory");
const JsonSchemaFactory_1 = require("./utils/JsonSchemaFactory");
const JsonSchemaNamingConvention_1 = require("./utils/JsonSchemaNamingConvention");
const JsonSchemaValidator_1 = require("./utils/JsonSchemaValidator");
const fulfillJsonSchemaErrorMessages_1 = require("./utils/fulfillJsonSchemaErrorMessages");
const orchestrateInterfaceComplement = (ctx, props) => step(ctx, props, {
wasEmpty: false,
life: 10,
});
exports.orchestrateInterfaceComplement = orchestrateInterfaceComplement;
function step(ctx, props, state) {
return __awaiter(this, void 0, void 0, function* () {
const missed = (0, utils_1.missedOpenApiSchemas)(props.document);
if (missed.length === 0)
return props.document.components.schemas;
else if (state.life === 0)
return props.document.components.schemas;
props.progress.total += missed.length;
const newbie = yield divideAndConquer(ctx, {
instruction: props.instruction,
document: props.document,
progress: props.progress,
missed,
});
const schemas = Object.assign(Object.assign({}, newbie), props.document.components.schemas);
JsonSchemaNamingConvention_1.JsonSchemaNamingConvention.schemas(props.document.operations, schemas);
return yield step(ctx, {
instruction: props.instruction,
document: Object.assign(Object.assign({}, props.document), { components: Object.assign(Object.assign({}, props.document.components), { schemas }) }),
progress: props.progress,
}, {
wasEmpty: Object.keys(newbie).length === 0,
life: state.life - 1,
});
});
}
function divideAndConquer(ctx, props) {
return __awaiter(this, void 0, void 0, function* () {
const matrix = (0, divideArray_1.divideArray)({
array: props.missed,
capacity: 2 /* AutoBeConfigConstant.INTERFACE_CAPACITY */,
});
const x = {};
for (const missed of matrix) {
const row = yield process(ctx, {
instruction: props.instruction,
document: props.document,
progress: props.progress,
missed,
});
Object.assign(x, row);
}
return x;
});
}
function process(ctx, props) {
return __awaiter(this, void 0, void 0, function* () {
const preliminary = new AutoBePreliminaryController_1.AutoBePreliminaryController({
application: {
version: "3.1",
components: {
schemas: {
"IAutoBeInterfaceComplementApplication.IProps": {
type: "object",
properties: {
thinking: {
type: "string",
description: "Think before you act.\n\nBefore requesting preliminary data or completing your task, reflect on your\ncurrent state and explain your reasoning:\n\nFor preliminary requests (getAnalysisFiles, getPrismaSchemas, etc.):\n- What critical information is missing that you don't already have?\n- Why do you need it specifically right now?\n- Be brief - state the gap, don't list everything you have.\n\nFor completion (complete):\n- What key assets did you acquire?\n- What did you accomplish?\n- Why is it sufficient to complete?\n- Summarize - don't enumerate every single item.\n\nThis reflection helps you avoid duplicate requests and premature completion."
},
request: {
oneOf: [
{
$ref: "#/components/schemas/IAutoBePreliminaryGetAnalysisFiles"
},
{
$ref: "#/components/schemas/IAutoBePreliminaryGetInterfaceOperations"
},
{
$ref: "#/components/schemas/IAutoBePreliminaryGetInterfaceSchemas"
},
{
$ref: "#/components/schemas/IAutoBePreliminaryGetPrismaSchemas"
},
{
$ref: "#/components/schemas/IAutoBeInterfaceComplementApplication.IComplete"
}
],
discriminator: {
propertyName: "type",
mapping: {
getAnalysisFiles: "#/components/schemas/IAutoBePreliminaryGetAnalysisFiles",
getInterfaceOperations: "#/components/schemas/IAutoBePreliminaryGetInterfaceOperations",
getInterfaceSchemas: "#/components/schemas/IAutoBePreliminaryGetInterfaceSchemas",
getPrismaSchemas: "#/components/schemas/IAutoBePreliminaryGetPrismaSchemas",
complete: "#/components/schemas/IAutoBeInterfaceComplementApplication.IComplete"
}
},
description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval\n(getAnalysisFiles, getPrismaSchemas, getInterfaceOperations,\ngetInterfaceSchemas) or final schema complementation (complete). When\npreliminary returns empty array, that type is removed from the union,\nphysically preventing repeated calls."
}
},
required: [
"thinking",
"request"
]
},
IAutoBePreliminaryGetAnalysisFiles: {
type: "object",
properties: {
type: {
"const": "getAnalysisFiles",
description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"getAnalysisFiles\" indicates this is a preliminary\ndata request for analysis files."
},
fileNames: {
type: "array",
items: {
type: "string"
},
minItems: 1,
description: "List of analysis file names to retrieve.\n\nFile names from the analyze phase containing requirements, use cases, and\nbusiness logic documentation.\n\nCRITICAL: DO NOT request the same file names that you have already\nrequested in previous calls."
}
},
required: [
"type",
"fileNames"
],
description: "Request to retrieve requirements analysis files for context.\n\nThis type is used in the preliminary phase to request specific analysis files\nthat provide business requirements and domain context."
},
IAutoBePreliminaryGetInterfaceOperations: {
type: "object",
properties: {
type: {
"const": "getInterfaceOperations",
description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"getInterfaceOperations\" indicates this is a\npreliminary data request for interface operations."
},
endpoints: {
type: "array",
items: {
$ref: "#/components/schemas/AutoBeOpenApi.IEndpoint"
},
minItems: 1,
description: "List of existing API operation endpoints to retrieve.\n\nOperations that have been generated in previous phases, containing paths,\nmethods, parameters, and request/response bodies.\n\nCRITICAL: DO NOT request the same endpoints that you have already requested\nin previous calls."
}
},
required: [
"type",
"endpoints"
],
description: "Request to retrieve existing interface operations for context.\n\nThis type is used in the preliminary phase to request already-generated API\noperations for review, validation, or complementary generation tasks."
},
"AutoBeOpenApi.IEndpoint": {
type: "object",
properties: {
path: {
type: "string",
pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$",
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)"
},
method: {
oneOf: [
{
"const": "get"
},
{
"const": "post"
},
{
"const": "put"
},
{
"const": "delete"
},
{
"const": "patch"
}
],
description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\",\nnot \"GET\").\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record"
}
},
required: [
"path",
"method"
],
description: "API endpoint information."
},
IAutoBePreliminaryGetInterfaceSchemas: {
type: "object",
properties: {
type: {
"const": "getInterfaceSchemas",
description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"getInterfaceSchemas\" indicates this is a preliminary\ndata request for interface schemas."
},
typeNames: {
type: "array",
items: {
type: "string"
},
minItems: 1,
description: "List of schema type names to retrieve.\n\nSchema names from the OpenAPI components.schemas section (e.g., \"IUser\",\n\"IUser.ICreate\", \"IPost.IUpdate\").\n\nCRITICAL: DO NOT request the same type names that you have already\nrequested in previous calls."
}
},
required: [
"type",
"typeNames"
],
description: "Request to retrieve OpenAPI schema type definitions for context.\n\nThis type is used in the preliminary phase to request specific schema\ndefinitions from components.schemas for review or complementary generation."
},
IAutoBePreliminaryGetPrismaSchemas: {
type: "object",
properties: {
type: {
"const": "getPrismaSchemas",
description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"getPrismaSchemas\" indicates this is a preliminary\ndata request for Prisma schemas."
},
schemaNames: {
type: "array",
items: {
type: "string"
},
minItems: 1,
description: "List of Prisma table names to retrieve.\n\nTable names from the Prisma schema file representing database entities\n(e.g., \"user\", \"post\", \"comment\").\n\nCRITICAL: DO NOT request the same schema names that you have already\nrequested in previous calls."
}
},
required: [
"type",
"schemaNames"
],
description: "Request to retrieve Prisma database schema definitions for context.\n\nThis type is used in the preliminary phase to request specific Prisma table\nschemas needed for generating type-safe API operations."
},
"IAutoBeInterfaceComplementApplication.IComplete": {
type: "object",
properties: {
type: {
"const": "complete",
description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"complete\" indicates this is the final task\nexecution request."
},
schemas: {
$ref: "#/components/schemas/RecordstringAutoBeOpenApi.IJsonSchemaDescriptive",
description: "A collection of missing schema definitions that need to be added to the\nOpenAPI document's `components.schemas` section.\n\nThis object contains schema definitions for types that are referenced but\nnot yet defined:\n\n- Key: Schema name (`string`): The name of the schema type that will be\n referenced in $ref statements\n- Value: `AutoBeOpenApi.IJsonSchema` - The complete JSON Schema definition\n for that type\n\nExample structure:\n\n```typescript\n{\n \"UserProfile\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\" },\n \"name\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\", \"format\": \"email\" }\n },\n \"required\": [\"id\", \"name\", \"email\"]\n }\n}\n```\n\nEach schema definition follows the JSON Schema specification and will be\ndirectly inserted into the OpenAPI document's components.schemas section,\nmaking them available for $ref references throughout the API\nspecification."
}
},
required: [
"type",
"schemas"
],
description: "Request to add missing schema definitions.\n\nExecutes schema complementation to fill in referenced but undefined schema\ntypes in the OpenAPI document's components.schemas section. Ensures all\n$ref references resolve to valid schema definitions."
},
"RecordstringAutoBeOpenApi.IJsonSchemaDescriptive": {
type: "object",
properties: {},
required: [],
description: "Construct a type with a set of properties K of type T",
additionalProperties: {
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive"
}
},
"AutoBeOpenApi.IJsonSchemaDescriptive": {
oneOf: [
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IConstant"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IBoolean"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IInteger"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.INumber"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IString"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IArray"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IObject"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IReference"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.IOneOf"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchemaDescriptive.INull"
}
],
description: "Descriptive type schema info.\n\n`AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\nGenerative, but it has a `description` property which is required.\n\n`AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\nspecification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\nand duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\nand AI generation.\n\nCRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n\nWhen creating descriptions for components, types, and properties:\n\n1. ALWAYS refer to and incorporate the description comments from the\n corresponding Prisma DB schema tables and columns. The descriptions\n should match the style, level of detail, and terminology used in the\n Prisma schema.\n2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n line breaks. Single-paragraph descriptions should be avoided.\n3. Descriptions should comprehensively cover:\n\n - The purpose and business meaning of the type or property\n - Relationships to other entities\n - Validation rules, constraints, and edge cases\n - Usage context and examples when helpful\n4. For each property of an object type, ensure its description reflects the\n corresponding column description in the Prisma DB schema, maintaining\n the same level of detail and terminology\n5. Descriptions should be so detailed and clear that anyone reading them can\n fully understand the type or property without needing to reference any\n other documentation"
},
"AutoBeOpenApi.IJsonSchemaDescriptive.IConstant": {
type: "object",
properties: {
"const": {
oneOf: [
{
type: "string"
},
{
type: "number"
},
{
type: "boolean"
}
],
description: "The constant value."
},
description: {
type: "string",
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
}
},
required: [
"const",
"description"
],
description: "Constant value type."
},
"AutoBeOpenApi.IJsonSchemaDescriptive.IBoolean": {
type: "object",
properties: {
type: {
"const": "boolean",
description: "Discriminator value of the type.\n\nCRITICAL: This MUST be a SINGLE string value, NOT an array. The type\nfield identifies the JSON Schema type and must be exactly one of:\n\"boolean\", \"integer\", \"number\", \"string\", \"array\", \"object\", or\n\"null\".\n\n\u274C INCORRECT: type: [\"string\", \"null\"] // This is WRONG! \u2705 CORRECT:\ntype: \"string\" // For nullable string, use oneOf instead\n\nIf you need to express a nullable type (e.g., string | null), you MUST\nuse the `IOneOf` structure:\n\n```typescript\n{\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"null\" }]\n}\n```\n\nNEVER use array notation in the type field. The type field is a\ndiscriminator that accepts only a single string value."
},
description: {
type: "string",
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
}
},
required: [
"type",
"description"
],
description: "Boolean type info."
},
"AutoBeOpenApi.IJsonSchemaDescriptive.IInteger": {
type: "object",
properties: {
minimum: {
type: "integer",
description: "Minimum value restriction."
},
maximum: {
type: "integer",
description: "Maximum value restriction."
},
exclusiveMinimum: {
type: "number",
description: "Exclusive minimum value restriction."
},
exclusiveMaximum: {
type: "number",
description: "Exclusive maximum value restriction."
},
multipleOf: {
type: "integer",
exclusiveMinimum: 0,
description: "Multiple of value restriction."
},
type: {
"const": "integer",
description: "Discriminator value of the type.\n\nCRITICAL: This MUST be a SINGLE string value, NOT an array. The type\nfield identifies the JSON Schema type and must be exactly one of:\n\"boolean\", \"integer\", \"number\", \"string\", \"array\", \"object\", or\n\"null\".\n\n\u274C INCORRECT: type: [\"string\", \"null\"] // This is WRONG! \u2705 CORRECT:\ntype: \"string\" // For nullable string, use oneOf instead\n\nIf you need to express a nullable type (e.g., string | null), you MUST\nuse the `IOneOf` structure:\n\n```typescript\n{\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"null\" }]\n}\n```\n\nNEVER use array notation in the type field. The type field is a\ndiscriminator that accepts only a single string value."
},
description: {
type: "string",
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
}
},
required: [
"type",
"description"
],
description: "Integer type info."
},
"AutoBeOpenApi.IJsonSchemaDescriptive.INumber": {
type: "object",
properties: {
minimum: {
type: "number",
description: "Minimum value restriction."
},
maximum: {
type: "number",
description: "Maximum value restriction."
},
exclusiveMinimum: {
type: "number",
description: "Exclusive minimum value restriction."
},
exclusiveMaximum: {
type: "number",
description: "Exclusive maximum value restriction."
},
multipleOf: {
type: "number",
exclusiveMinimum: 0,
description: "Multiple of value restriction."
},
type: {
"const": "number",
description: "Discriminator value of the type.\n\nCRITICAL: This MUST be a SINGLE string value, NOT an array. The type\nfield identifies the JSON Schema type and must be exactly one of:\n\"boolean\", \"integer\", \"number\", \"string\", \"array\", \"object\", or\n\"null\".\n\n\u274C INCORRECT: type: [\"string\", \"null\"] // This is WRONG! \u2705 CORRECT:\ntype: \"string\" // For nullable string, use oneOf instead\n\nIf you need to express a nullable type (e.g., string | null), you MUST\nuse the `IOneOf` structure:\n\n```typescript\n{\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"null\" }]\n}\n```\n\nNEVER use array notation in the type field. The type field is a\ndiscriminator that accepts only a single string value."
},
description: {
type: "string",
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
}
},
required: [
"type",
"description"
],
description: "Number (double) type info."
},
"AutoBeOpenApi.IJsonSchemaDescriptive.IString": {
type: "object",
properties: {
format: {
oneOf: [
{
"const": "date-time"
},
{
"const": "password"
},
{
"const": "regex"
},
{
"const": "uuid"
},
{
"const": "email"
},
{
"const": "hostname"
},
{
"const": "idn-email"
},
{
"const": "idn-hostname"
},
{
"const": "iri"
},
{
"const": "iri-reference"
},
{
"const": "ipv4"
},
{
"const": "ipv6"
},
{
"const": "uri"
},
{
"const": "uri-reference"
},
{
"const": "uri-template"
},
{
"const": "url"
},
{
"const": "date"
},
{
"const": "time"
},
{
"const": "duration"
},
{
"const": "json-pointer"
},
{
"const": "relative-json-pointer"
}
],
description: "Format restriction."
},
pattern: {
type: "string",
description: "Pattern restriction."
},
contentMediaType: {
type: "string",
description: "Content media type restriction."
},
minLength: {
type: "integer",
minimum: 0,
description: "Minimum length restriction."
},
maxLength: {
type: "integer",
minimum: 0,
description: "Maximum length restriction."
},
type: {
"const": "string",
description: "Discriminator value of the type.\n\nCRITICAL: This MUST be a SINGLE string value, NOT an array. The type\nfield identifies the JSON Schema type and must be exactly one of:\n\"boolean\", \"integer\", \"number\", \"string\", \"array\", \"object\", or\n\"null\".\n\n\u274C INCORRECT: type: [\"string\", \"null\"] // This is WRONG! \u2705 CORRECT:\ntype: \"string\" // For nullable string, use oneOf instead\n\nIf you need to express a nullable type (e.g., string | null), you MUST\nuse the `IOneOf` structure:\n\n```typescript\n{\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"null\" }]\n}\n```\n\nNEVER use array notation in the type field. The type field is a\ndiscriminator that accepts only a single string value."
},
description: {
type: "string",
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
}
},
required: [
"type",
"description"
],
description: "String type info."
},
"AutoBeOpenApi.IJsonSchemaDescriptive.IArray": {
type: "object",
properties: {
items: {
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema",
description: "Items type info.\n\nThe `items` means the type of the array elements. In other words, it is\nthe type schema info of the `T` in the TypeScript array type\n`Array<T>`."
},
uniqueItems: {
type: "boolean",
description: "Unique items restriction.\n\nIf this property value is `true`, target array must have unique items."
},
minItems: {
type: "integer",
minimum: 0,
description: "Minimum items restriction.\n\nRestriction of minimum number of items in the array."
},
maxItems: {
type: "integer",
minimum: 0,
description: "Maximum items restriction.\n\nRestriction of maximum number of items in the array."
},
type: {
"const": "array",
description: "Discriminator value of the type.\n\nCRITICAL: This MUST be a SINGLE string value, NOT an array. The type\nfield identifies the JSON Schema type and must be exactly one of:\n\"boolean\", \"integer\", \"number\", \"string\", \"array\", \"object\", or\n\"null\".\n\n\u274C INCORRECT: type: [\"string\", \"null\"] // This is WRONG! \u2705 CORRECT:\ntype: \"string\" // For nullable string, use oneOf instead\n\nIf you need to express a nullable type (e.g., string | null), you MUST\nuse the `IOneOf` structure:\n\n```typescript\n{\n \"oneOf\": [{ \"type\": \"string\" }, { \"type\": \"null\" }]\n}\n```\n\nNEVER use array notation in the type field. The type field is a\ndiscriminator that accepts only a single string value."
},
description: {
type: "string",
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
}
},
required: [
"items",
"type",
"description"
],
description: "Array type info."
},
"AutoBeOpenApi.IJsonSchema": {
oneOf: [
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IInteger"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.INumber"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IString"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IConstant"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IBoolean"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IArray"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IObject"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IReference"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.IOneOf"
},
{
$ref: "#/components/schemas/AutoBeOpenApi.IJsonSchema.INull"
}
],
description: "Type schema info.\n\n`AutoBeOpenApi.IJsonSchema` is a type schema info of the OpenAPI\nGenerative.\n\n`AutoBeOpenApi.IJsonSchema` basically follows the JSO