@autobe/agent 0.0.0 → 0.3.6
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/LICENSE +21 -21
- package/lib/AutoBeAgent.d.ts +9 -7
- package/lib/AutoBeAgent.js +106 -14
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/analyze/AnalyzeAgent.d.ts +24 -0
- package/lib/analyze/AnalyzeAgent.js +817 -0
- package/lib/analyze/AnalyzeAgent.js.map +1 -0
- package/lib/analyze/CreateReviewerAgent.d.ts +16 -0
- package/lib/analyze/CreateReviewerAgent.js +97 -0
- package/lib/analyze/CreateReviewerAgent.js.map +1 -0
- package/lib/analyze/Planning.d.ts +63 -0
- package/lib/{orchestrate/orchestratePrisma.js → analyze/Planning.js} +28 -11
- package/lib/analyze/Planning.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +14 -0
- package/lib/constants/AutoBeSystemPromptConstant.js +4 -0
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -0
- package/lib/context/AutoBeContext.d.ts +7 -3
- package/lib/context/IAutoBeApplication.d.ts +72 -32
- package/lib/context/IAutoBeApplicationProps.d.ts +22 -2
- package/lib/context/IAutoBeApplicationResult.d.ts +0 -1
- package/lib/context/assertSchemaModel.d.ts +2 -0
- package/lib/context/assertSchemaModel.js +15 -0
- package/lib/context/assertSchemaModel.js.map +1 -0
- package/lib/{internal/transformAgenticaHistory.d.ts → factory/createAgenticaHistory.d.ts} +1 -1
- package/lib/{internal/transformAgenticaHistory.js → factory/createAgenticaHistory.js} +3 -4
- package/lib/factory/createAgenticaHistory.js.map +1 -0
- package/lib/factory/createAutoBeApplication.js +1195 -0
- package/lib/factory/createAutoBeApplication.js.map +1 -0
- package/lib/factory/createAutoBeState.js.map +1 -0
- package/lib/factory/index.d.ts +2 -0
- package/lib/factory/index.js +19 -0
- package/lib/factory/index.js.map +1 -0
- package/lib/factory/invertOpenApiDocument.d.ts +3 -0
- package/lib/factory/invertOpenApiDocument.js +51 -0
- package/lib/factory/invertOpenApiDocument.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +5455 -547
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.d.ts +2 -0
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +46 -0
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -0
- package/lib/orchestrate/index.d.ts +2 -2
- package/lib/orchestrate/index.js +2 -2
- package/lib/orchestrate/index.js.map +1 -1
- package/lib/orchestrate/interface/OpenApiEndpointComparator.d.ts +5 -0
- package/lib/orchestrate/interface/OpenApiEndpointComparator.js +16 -0
- package/lib/orchestrate/interface/OpenApiEndpointComparator.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.d.ts +5 -0
- package/lib/orchestrate/interface/orchestrateInterface.js +61 -0
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +702 -0
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +452 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +2065 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.d.ts +3 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js +94 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -0
- package/lib/orchestrate/orchestrateAnalyze.d.ts +1 -3
- package/lib/orchestrate/orchestrateAnalyze.js +60 -6
- package/lib/orchestrate/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/{orchestratePrisma.d.ts → prisma/orchestratePrisma.d.ts} +3 -6
- package/lib/orchestrate/prisma/orchestratePrisma.js +103 -0
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrismaCompiler.d.ts +6 -0
- package/lib/orchestrate/prisma/orchestratePrismaCompiler.js +436 -0
- package/lib/orchestrate/prisma/orchestratePrismaCompiler.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +5 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +437 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrismaSchema.d.ts +7 -0
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +369 -0
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -0
- package/lib/orchestrate/prisma/transformPrismaCompilerHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/transformPrismaCompilerHistories.js +44 -0
- package/lib/orchestrate/prisma/transformPrismaCompilerHistories.js.map +1 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +42 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -0
- package/lib/orchestrate/prisma/transformPrismaHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/transformPrismaHistories.js +46 -0
- package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +46 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -0
- package/lib/structures/IAutoBeConfig.d.ts +4 -4
- package/lib/utils/StringUtil.d.ts +4 -0
- package/lib/utils/StringUtil.js +43 -0
- package/lib/utils/StringUtil.js.map +1 -0
- package/lib/utils/divideArray.d.ts +4 -0
- package/lib/utils/divideArray.js +19 -0
- package/lib/utils/divideArray.js.map +1 -0
- package/lib/utils/emplaceMap.d.ts +1 -0
- package/lib/utils/emplaceMap.js +13 -0
- package/lib/utils/emplaceMap.js.map +1 -0
- package/package.json +29 -8
- package/src/AutoBeAgent.ts +227 -101
- package/src/analyze/AnalyzeAgent.ts +167 -0
- package/src/analyze/CreateReviewerAgent.ts +126 -0
- package/src/analyze/Planning.ts +75 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +15 -0
- package/src/context/AutoBeContext.ts +19 -15
- package/src/context/AutoBeState.ts +15 -15
- package/src/context/AutoBeTokenUsage.ts +3 -3
- package/src/context/IAutoBeApplication.ts +112 -72
- package/src/context/IAutoBeApplicationProps.ts +27 -6
- package/src/context/IAutoBeApplicationResult.ts +3 -4
- package/src/context/assertSchemaModel.ts +17 -0
- package/src/{internal/transformAgenticaHistory.ts → factory/createAgenticaHistory.ts} +51 -54
- package/src/{internal → factory}/createAutoBeApplication.ts +52 -47
- package/src/{internal → factory}/createAutoBeState.ts +14 -14
- package/src/factory/index.ts +2 -0
- package/src/factory/invertOpenApiDocument.ts +63 -0
- package/src/index.ts +13 -12
- package/src/orchestrate/facade/transformFacadeStateMessage.ts +58 -0
- package/src/orchestrate/index.ts +5 -5
- package/src/orchestrate/interface/OpenApiEndpointComparator.ts +15 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +66 -0
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +324 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +140 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +247 -0
- package/src/orchestrate/interface/transformInterfaceHistories.ts +98 -0
- package/src/orchestrate/orchestrateAnalyze.ts +86 -21
- package/src/orchestrate/orchestrateRealize.ts +18 -18
- package/src/orchestrate/orchestrateTest.ts +18 -18
- package/src/orchestrate/prisma/orchestratePrisma.ts +117 -0
- package/src/orchestrate/prisma/orchestratePrismaCompiler.ts +194 -0
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +176 -0
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +181 -0
- package/src/orchestrate/prisma/transformPrismaCompilerHistories.ts +49 -0
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +46 -0
- package/src/orchestrate/prisma/transformPrismaHistories.ts +50 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +50 -0
- package/src/structures/IAutoBeConfig.ts +25 -25
- package/src/structures/IAutoBeProps.ts +13 -13
- package/src/structures/IAutoBeVendor.ts +3 -3
- package/src/utils/StringUtil.ts +45 -0
- package/src/utils/divideArray.ts +16 -0
- package/src/utils/emplaceMap.ts +14 -0
- package/lib/factory/transformRouteDocument.d.ts +0 -3
- package/lib/factory/transformRouteDocument.js +0 -50
- package/lib/factory/transformRouteDocument.js.map +0 -1
- package/lib/internal/createAutoBeApplication.js +0 -1452
- package/lib/internal/createAutoBeApplication.js.map +0 -1
- package/lib/internal/createAutoBeState.js.map +0 -1
- package/lib/internal/transformAgenticaHistory.js.map +0 -1
- package/lib/orchestrate/interface/AutoBeInterfaceAgent.d.ts +0 -0
- package/lib/orchestrate/interface/AutoBeInterfaceAgent.js +0 -2
- package/lib/orchestrate/interface/AutoBeInterfaceAgent.js.map +0 -1
- package/lib/orchestrate/orchestrateInterface.d.ts +0 -8
- package/lib/orchestrate/orchestrateInterface.js +0 -22
- package/lib/orchestrate/orchestrateInterface.js.map +0 -1
- package/lib/orchestrate/orchestratePrisma.js.map +0 -1
- package/src/factory/transformRouteDocument.ts +0 -49
- package/src/orchestrate/interface/AutoBeInterfaceAgent.ts +0 -0
- package/src/orchestrate/orchestrateInterface.ts +0 -21
- package/src/orchestrate/orchestratePrisma.ts +0 -21
- /package/lib/{internal → factory}/createAutoBeApplication.d.ts +0 -0
- /package/lib/{internal → factory}/createAutoBeState.d.ts +0 -0
- /package/lib/{internal → factory}/createAutoBeState.js +0 -0
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.orchestrateInterfaceComponents = orchestrateInterfaceComponents;
|
|
49
|
+
const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString.js"));
|
|
50
|
+
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
51
|
+
const core_1 = require("@agentica/core");
|
|
52
|
+
const openapi_1 = require("@samchon/openapi");
|
|
53
|
+
const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
|
|
54
|
+
const typia_1 = __importDefault(require("typia"));
|
|
55
|
+
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
56
|
+
const divideArray_1 = require("../../utils/divideArray");
|
|
57
|
+
const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
|
|
58
|
+
function orchestrateInterfaceComponents(ctx_1, operations_1) {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (ctx, operations, capacity = 12) {
|
|
60
|
+
const typeNames = new Set();
|
|
61
|
+
for (const op of operations) {
|
|
62
|
+
if (op.requestBody !== null)
|
|
63
|
+
typeNames.add(op.requestBody.typeName);
|
|
64
|
+
if (op.responseBody !== null)
|
|
65
|
+
typeNames.add(op.responseBody.typeName);
|
|
66
|
+
}
|
|
67
|
+
const matrix = (0, divideArray_1.divideArray)({
|
|
68
|
+
array: Array.from(typeNames),
|
|
69
|
+
capacity,
|
|
70
|
+
});
|
|
71
|
+
let progress = 0;
|
|
72
|
+
const x = {
|
|
73
|
+
schemas: {},
|
|
74
|
+
};
|
|
75
|
+
for (const y of yield Promise.all(matrix.map((it) => __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
const row = yield divideAndConquer(ctx, operations, it, 3, (count) => {
|
|
78
|
+
progress += count;
|
|
79
|
+
});
|
|
80
|
+
ctx.dispatch({
|
|
81
|
+
type: "interfaceComponents",
|
|
82
|
+
components: row,
|
|
83
|
+
completed: progress,
|
|
84
|
+
total: typeNames.size,
|
|
85
|
+
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
86
|
+
created_at: new Date().toISOString(),
|
|
87
|
+
});
|
|
88
|
+
return row;
|
|
89
|
+
})))) {
|
|
90
|
+
Object.assign(x.schemas, y.schemas);
|
|
91
|
+
if (y.authorization)
|
|
92
|
+
x.authorization = y.authorization;
|
|
93
|
+
}
|
|
94
|
+
return x;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function divideAndConquer(ctx, operations, typeNames, retry, progress) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const remained = new Set(typeNames);
|
|
100
|
+
const components = {
|
|
101
|
+
schemas: {},
|
|
102
|
+
};
|
|
103
|
+
for (let i = 0; i < retry; ++i) {
|
|
104
|
+
if (remained.size === 0)
|
|
105
|
+
break;
|
|
106
|
+
const before = remained.size;
|
|
107
|
+
const newbie = yield process(ctx, operations, components, remained);
|
|
108
|
+
for (const key of Object.keys(newbie.schemas)) {
|
|
109
|
+
components.schemas[key] = newbie.schemas[key];
|
|
110
|
+
remained.delete(key);
|
|
111
|
+
}
|
|
112
|
+
if (before - remained.size !== 0)
|
|
113
|
+
progress(before - remained.size);
|
|
114
|
+
}
|
|
115
|
+
return components;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function process(ctx, operations, oldbie, remained) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
var _a;
|
|
121
|
+
const pointer = {
|
|
122
|
+
value: null,
|
|
123
|
+
};
|
|
124
|
+
const agentica = new core_1.MicroAgentica({
|
|
125
|
+
model: ctx.model,
|
|
126
|
+
vendor: ctx.vendor,
|
|
127
|
+
config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
|
|
128
|
+
describe: null,
|
|
129
|
+
} }),
|
|
130
|
+
histories: [
|
|
131
|
+
...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema components for OpenAPI specifications in the `AutoBeOpenApi.IDocument` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of component schemas that accurately represent all entities and their relationships in the system.\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive component schemas for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Components**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding component schemas\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema components\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the components.schemas section and referenced using $ref\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container (use the standard IPage structure)\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the components.schemas section\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination indformation.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - Define `.IUpdate` types with all fields made optional for updates\n - Build `.ISummary` types with essential fields for list views\n - Define `.IRequest` types with search/filter/sort parameters\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Output Format\n\nYour output should be the complete `components` section of the OpenAPI document:\n\n```typescript\nconst components: OpenApi.IComponents = {\n schemas: {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n // Variant types\n \"IEntityName.ICreate\": { ... },\n \"IEntityName.IUpdate\": { ... },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n }\n}\n```\n\n## 7. Critical Success Factors\n\n### 7.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema components.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 7.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 7.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the components.schemas section and referenced by name.\n\n## 8. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n\n2. **Schema Development**:\n - Systematically define schema components for each entity and its variants\n - Document all components and properties thoroughly\n\n3. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n\n4. **Output Generation**:\n - Produce the complete `components` section in the required format\n - Verify the output meets all quality and completeness requirements\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 9. Integration with Previous Phases\n\n- Ensure your schema components align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 10. Final Output Format\n\nYour final output should be the complete `components` section that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema components that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define components for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */),
|
|
132
|
+
{
|
|
133
|
+
type: "assistantMessage",
|
|
134
|
+
text: [
|
|
135
|
+
"Here is the OpenAPI operations generated by phase 2.",
|
|
136
|
+
"",
|
|
137
|
+
"```json",
|
|
138
|
+
JSON.stringify(operations),
|
|
139
|
+
"```",
|
|
140
|
+
].join("\n"),
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
tokenUsage: ctx.usage(),
|
|
144
|
+
controllers: [
|
|
145
|
+
createApplication({
|
|
146
|
+
model: ctx.model,
|
|
147
|
+
build: (components) => __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
pointer.value = components;
|
|
149
|
+
}),
|
|
150
|
+
pointer,
|
|
151
|
+
}),
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
event.body.tool_choice = "required";
|
|
156
|
+
}));
|
|
157
|
+
const already = Object.keys(oldbie.schemas);
|
|
158
|
+
yield agentica.conversate([
|
|
159
|
+
"Make type components please.",
|
|
160
|
+
"",
|
|
161
|
+
"Here is the list of request/response bodies' type names from",
|
|
162
|
+
"OpenAPI operations. Make type components of them. If more object",
|
|
163
|
+
"types are required during making the components, please make them",
|
|
164
|
+
"too.",
|
|
165
|
+
"",
|
|
166
|
+
...Array.from(remained).map((k) => `- \`${k}\``),
|
|
167
|
+
...(already.length !== 0
|
|
168
|
+
? [
|
|
169
|
+
"",
|
|
170
|
+
"> By the way, here is the list of components schemas what you've",
|
|
171
|
+
"> already made. So, you don't need to make them again.",
|
|
172
|
+
">",
|
|
173
|
+
...already.map((k) => `> - \`${k}\``),
|
|
174
|
+
]
|
|
175
|
+
: []),
|
|
176
|
+
].join("\n"));
|
|
177
|
+
if (pointer.value === null) {
|
|
178
|
+
// never be happened
|
|
179
|
+
throw new Error("Failed to create components.");
|
|
180
|
+
}
|
|
181
|
+
return OpenApiV3_1Emender_1.OpenApiV3_1Emender.convertComponents(pointer.value);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function createApplication(props) {
|
|
185
|
+
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
186
|
+
const application = collection[props.model];
|
|
187
|
+
const validate = (next) => {
|
|
188
|
+
const result = (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "header" === input.authorization); const _io2 = input => Object.keys(input).every(key => {
|
|
189
|
+
const value = input[key];
|
|
190
|
+
if (undefined === value)
|
|
191
|
+
return true;
|
|
192
|
+
return "object" === typeof value && null !== value && _io3(value);
|
|
193
|
+
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
194
|
+
path: _path + ".components",
|
|
195
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
196
|
+
value: input.components
|
|
197
|
+
})) && _vo1(input.components, _path + ".components", true && _exceptionable) || _report(_exceptionable, {
|
|
198
|
+
path: _path + ".components",
|
|
199
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
200
|
+
value: input.components
|
|
201
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) || _report(_exceptionable, {
|
|
202
|
+
path: _path + ".schemas",
|
|
203
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
204
|
+
value: input.schemas
|
|
205
|
+
})) && _vo2(input.schemas, _path + ".schemas", true && _exceptionable) || _report(_exceptionable, {
|
|
206
|
+
path: _path + ".schemas",
|
|
207
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
208
|
+
value: input.schemas
|
|
209
|
+
}), undefined === input.authorization || "header" === input.authorization || _report(_exceptionable, {
|
|
210
|
+
path: _path + ".authorization",
|
|
211
|
+
expected: "(\"header\" | undefined)",
|
|
212
|
+
value: input.authorization
|
|
213
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
214
|
+
const value = input[key];
|
|
215
|
+
if (undefined === value)
|
|
216
|
+
return true;
|
|
217
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
218
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
219
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
220
|
+
value: value
|
|
221
|
+
})) && _vo3(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
222
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
223
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
224
|
+
value: value
|
|
225
|
+
});
|
|
226
|
+
}).every(flag => flag)].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
227
|
+
path: _path + ".description",
|
|
228
|
+
expected: "string",
|
|
229
|
+
value: input.description
|
|
230
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
231
|
+
if (false === __is(input)) {
|
|
232
|
+
errors = [];
|
|
233
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
234
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
235
|
+
path: _path + "",
|
|
236
|
+
expected: "IMakeComponentsProps",
|
|
237
|
+
value: input
|
|
238
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
239
|
+
path: _path + "",
|
|
240
|
+
expected: "IMakeComponentsProps",
|
|
241
|
+
value: input
|
|
242
|
+
}))(input, "$input", true);
|
|
243
|
+
const success = 0 === errors.length;
|
|
244
|
+
return success ? {
|
|
245
|
+
success,
|
|
246
|
+
data: input
|
|
247
|
+
} : {
|
|
248
|
+
success,
|
|
249
|
+
errors,
|
|
250
|
+
data: input
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
success: true,
|
|
255
|
+
data: input
|
|
256
|
+
};
|
|
257
|
+
}; })()(next);
|
|
258
|
+
if (result.success === false)
|
|
259
|
+
return result;
|
|
260
|
+
props.pointer.value = result.data.components;
|
|
261
|
+
const errors = [];
|
|
262
|
+
for (const value of Object.values(result.data.components.schemas)) {
|
|
263
|
+
openapi_1.OpenApiTypeChecker.visit({
|
|
264
|
+
components: result.data.components,
|
|
265
|
+
schema: value,
|
|
266
|
+
closure: (v) => {
|
|
267
|
+
var _a;
|
|
268
|
+
if (openapi_1.OpenApiTypeChecker.isReference(v)) {
|
|
269
|
+
const key = v.$ref.split("/").at(-1);
|
|
270
|
+
if (((_a = result.data.components.schemas) === null || _a === void 0 ? void 0 : _a[key]) === undefined)
|
|
271
|
+
errors.push({
|
|
272
|
+
path: `components.schemas.${key}`,
|
|
273
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive",
|
|
274
|
+
value: "undefined",
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
if (errors.length !== 0)
|
|
281
|
+
return {
|
|
282
|
+
success: false,
|
|
283
|
+
data: result.data,
|
|
284
|
+
errors,
|
|
285
|
+
};
|
|
286
|
+
return result;
|
|
287
|
+
};
|
|
288
|
+
application.functions[0].validate = validate;
|
|
289
|
+
return {
|
|
290
|
+
protocol: "class",
|
|
291
|
+
name: "interface",
|
|
292
|
+
application,
|
|
293
|
+
execute: {
|
|
294
|
+
makeComponents: (next) => __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
yield props.build(next.components);
|
|
296
|
+
return {
|
|
297
|
+
success: true,
|
|
298
|
+
};
|
|
299
|
+
}),
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const claude = {
|
|
304
|
+
model: "claude",
|
|
305
|
+
options: {
|
|
306
|
+
reference: true,
|
|
307
|
+
separate: null
|
|
308
|
+
},
|
|
309
|
+
functions: [
|
|
310
|
+
{
|
|
311
|
+
name: "makeComponents",
|
|
312
|
+
parameters: {
|
|
313
|
+
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
314
|
+
type: "object",
|
|
315
|
+
properties: {
|
|
316
|
+
components: {
|
|
317
|
+
description: "Complete set of schema components for the OpenAPI specification.\n\nThis property contains comprehensive type definitions for all entities in\nthe system. It is the central repository of all named schema types that\nwill be used throughout the API specification.\n\nCRITICAL REQUIREMENT: All object types MUST be defined as named types in\nthe components.schemas section. Inline anonymous object definitions are\nstrictly prohibited.\n\nThis components object should include:\n\n- Main entity types (IEntityName)\n- Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)\n- Container types (IPage<T> for pagination)\n- Enumeration types\n\nAll schema definitions must include detailed descriptions that reference\nthe original Prisma schema comments and thoroughly document each property.\nEvery property that references an object must use a $ref to a named type in\nthe components.schemas section. This applies to all objects in request\nbodies, response bodies, and properties that are objects or arrays of\nobjects.\n\nExample structure:\n\n components: {\n schemas: {\n IUser: {\n type: \"object\",\n properties: {\n id: { type: \"string\", format: \"uuid\" },\n email: { type: \"string\", format: \"email\" },\n profile: { \"$ref\": \"#/components/schemas/IUserProfile\" }\n },\n required: [\"id\", \"email\"],\n description: \"User entity representing system account holders...\"\n },\n \"IUser.ICreate\": { ... },\n // Additional schemas\n }\n }\n\n------------------------------\n\nDescription of the current {@link AutoBeOpenApi.IComponents} type:\n\n> Reusable components in OpenAPI.\n> \n> A storage of reusable components in OpenAPI document.\n> \n> In other words, it is a storage of named DTO schemas and security schemes.",
|
|
318
|
+
type: "object",
|
|
319
|
+
properties: {
|
|
320
|
+
schemas: {
|
|
321
|
+
description: "An object to hold reusable DTO schemas.\n\nIn other words, a collection of named JSON schemas.\n\nIMPORTANT: For each schema in this collection:\n\n1. EVERY schema MUST have a detailed description that references and aligns\n with the description comments from the corresponding Prisma DB schema\n tables\n2. EACH property within the schema MUST have detailed descriptions that\n reference and align with the description comments from the\n corresponding DB schema columns\n3. All descriptions MUST be organized into MULTIPLE PARAGRAPHS (separated by\n line breaks) when appropriate\n4. Descriptions should be comprehensive enough that anyone reading them can\n understand the purpose, functionality, and constraints of each type\n and property without needing to reference other documentation\n\n------------------------------\n\nDescription of the current {@link RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Construct a type with a set of properties K of type T",
|
|
322
|
+
type: "object",
|
|
323
|
+
properties: {},
|
|
324
|
+
required: [],
|
|
325
|
+
additionalProperties: {
|
|
326
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Descriptive type schema info.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\n> Generative, but it has a `description` property which is required.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\n> specification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\n> and duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\n> and AI generation.\n> \n> CRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n> \n> When creating descriptions for components, types, and properties:\n> \n> 1. 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.\n> 2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n> line breaks. Single-paragraph descriptions should be avoided.\n> 3. 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\n> 4. 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\n> 5. 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",
|
|
327
|
+
type: "object",
|
|
328
|
+
properties: {
|
|
329
|
+
description: {
|
|
330
|
+
title: "Description about the type",
|
|
331
|
+
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.",
|
|
332
|
+
type: "string"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
required: [
|
|
336
|
+
"description"
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
authorization: {
|
|
341
|
+
title: "Whether includes `Authorization` header or not",
|
|
342
|
+
description: "Whether includes `Authorization` header or not.",
|
|
343
|
+
"const": "header"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
required: [
|
|
347
|
+
"schemas"
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
required: [
|
|
352
|
+
"components"
|
|
353
|
+
],
|
|
354
|
+
additionalProperties: false,
|
|
355
|
+
$defs: {}
|
|
356
|
+
},
|
|
357
|
+
description: "Generate OpenAPI components containing named schema types.\n\nThis method receives a complete set of schema components and integrates\nthem into the final OpenAPI specification. It processes all entity schemas,\ntheir variants, and related type definitions to ensure a comprehensive and\nconsistent API design.\n\nThe provided components should include schemas for all entities identified\nin the previous phases of API path/method definition and operation\ncreation. This ensures that the final OpenAPI document has complete type\ncoverage for all operations.\n\nCRITICAL: All schema definitions must follow the established naming\nconventions (IEntityName, IEntityName.ICreate, etc.) and must be thoroughly\ndocumented with descriptions that reference the original Prisma schema\ncomments.",
|
|
358
|
+
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "header" === input.authorization); const _io2 = input => Object.keys(input).every(key => {
|
|
359
|
+
const value = input[key];
|
|
360
|
+
if (undefined === value)
|
|
361
|
+
return true;
|
|
362
|
+
return "object" === typeof value && null !== value && _io3(value);
|
|
363
|
+
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
364
|
+
path: _path + ".components",
|
|
365
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
366
|
+
value: input.components
|
|
367
|
+
})) && _vo1(input.components, _path + ".components", true && _exceptionable) || _report(_exceptionable, {
|
|
368
|
+
path: _path + ".components",
|
|
369
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
370
|
+
value: input.components
|
|
371
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) || _report(_exceptionable, {
|
|
372
|
+
path: _path + ".schemas",
|
|
373
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
374
|
+
value: input.schemas
|
|
375
|
+
})) && _vo2(input.schemas, _path + ".schemas", true && _exceptionable) || _report(_exceptionable, {
|
|
376
|
+
path: _path + ".schemas",
|
|
377
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
378
|
+
value: input.schemas
|
|
379
|
+
}), undefined === input.authorization || "header" === input.authorization || _report(_exceptionable, {
|
|
380
|
+
path: _path + ".authorization",
|
|
381
|
+
expected: "(\"header\" | undefined)",
|
|
382
|
+
value: input.authorization
|
|
383
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
384
|
+
const value = input[key];
|
|
385
|
+
if (undefined === value)
|
|
386
|
+
return true;
|
|
387
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
388
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
389
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
390
|
+
value: value
|
|
391
|
+
})) && _vo3(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
392
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
393
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
394
|
+
value: value
|
|
395
|
+
});
|
|
396
|
+
}).every(flag => flag)].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
397
|
+
path: _path + ".description",
|
|
398
|
+
expected: "string",
|
|
399
|
+
value: input.description
|
|
400
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
401
|
+
if (false === __is(input)) {
|
|
402
|
+
errors = [];
|
|
403
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
404
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
405
|
+
path: _path + "",
|
|
406
|
+
expected: "IMakeComponentsProps",
|
|
407
|
+
value: input
|
|
408
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
409
|
+
path: _path + "",
|
|
410
|
+
expected: "IMakeComponentsProps",
|
|
411
|
+
value: input
|
|
412
|
+
}))(input, "$input", true);
|
|
413
|
+
const success = 0 === errors.length;
|
|
414
|
+
return success ? {
|
|
415
|
+
success,
|
|
416
|
+
data: input
|
|
417
|
+
} : {
|
|
418
|
+
success,
|
|
419
|
+
errors,
|
|
420
|
+
data: input
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
success: true,
|
|
425
|
+
data: input
|
|
426
|
+
};
|
|
427
|
+
}; })()
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
};
|
|
431
|
+
const collection = {
|
|
432
|
+
chatgpt: {
|
|
433
|
+
model: "chatgpt",
|
|
434
|
+
options: {
|
|
435
|
+
reference: true,
|
|
436
|
+
strict: false,
|
|
437
|
+
separate: null
|
|
438
|
+
},
|
|
439
|
+
functions: [
|
|
440
|
+
{
|
|
441
|
+
name: "makeComponents",
|
|
442
|
+
parameters: {
|
|
443
|
+
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
444
|
+
type: "object",
|
|
445
|
+
properties: {
|
|
446
|
+
components: {
|
|
447
|
+
description: "Complete set of schema components for the OpenAPI specification.\n\nThis property contains comprehensive type definitions for all entities in\nthe system. It is the central repository of all named schema types that\nwill be used throughout the API specification.\n\nCRITICAL REQUIREMENT: All object types MUST be defined as named types in\nthe components.schemas section. Inline anonymous object definitions are\nstrictly prohibited.\n\nThis components object should include:\n\n- Main entity types (IEntityName)\n- Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)\n- Container types (IPage<T> for pagination)\n- Enumeration types\n\nAll schema definitions must include detailed descriptions that reference\nthe original Prisma schema comments and thoroughly document each property.\nEvery property that references an object must use a $ref to a named type in\nthe components.schemas section. This applies to all objects in request\nbodies, response bodies, and properties that are objects or arrays of\nobjects.\n\nExample structure:\n\n components: {\n schemas: {\n IUser: {\n type: \"object\",\n properties: {\n id: { type: \"string\", format: \"uuid\" },\n email: { type: \"string\", format: \"email\" },\n profile: { \"$ref\": \"#/components/schemas/IUserProfile\" }\n },\n required: [\"id\", \"email\"],\n description: \"User entity representing system account holders...\"\n },\n \"IUser.ICreate\": { ... },\n // Additional schemas\n }\n }\n\n------------------------------\n\nDescription of the current {@link AutoBeOpenApi.IComponents} type:\n\n> Reusable components in OpenAPI.\n> \n> A storage of reusable components in OpenAPI document.\n> \n> In other words, it is a storage of named DTO schemas and security schemes.",
|
|
448
|
+
type: "object",
|
|
449
|
+
properties: {
|
|
450
|
+
schemas: {
|
|
451
|
+
description: "An object to hold reusable DTO schemas.\n\nIn other words, a collection of named JSON schemas.\n\nIMPORTANT: For each schema in this collection:\n\n1. EVERY schema MUST have a detailed description that references and aligns\n with the description comments from the corresponding Prisma DB schema\n tables\n2. EACH property within the schema MUST have detailed descriptions that\n reference and align with the description comments from the\n corresponding DB schema columns\n3. All descriptions MUST be organized into MULTIPLE PARAGRAPHS (separated by\n line breaks) when appropriate\n4. Descriptions should be comprehensive enough that anyone reading them can\n understand the purpose, functionality, and constraints of each type\n and property without needing to reference other documentation\n\n------------------------------\n\nDescription of the current {@link RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Construct a type with a set of properties K of type T",
|
|
452
|
+
type: "object",
|
|
453
|
+
properties: {},
|
|
454
|
+
required: [],
|
|
455
|
+
additionalProperties: {
|
|
456
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Descriptive type schema info.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\n> Generative, but it has a `description` property which is required.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\n> specification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\n> and duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\n> and AI generation.\n> \n> CRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n> \n> When creating descriptions for components, types, and properties:\n> \n> 1. 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.\n> 2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n> line breaks. Single-paragraph descriptions should be avoided.\n> 3. 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\n> 4. 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\n> 5. 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",
|
|
457
|
+
type: "object",
|
|
458
|
+
properties: {
|
|
459
|
+
description: {
|
|
460
|
+
title: "Description about the type",
|
|
461
|
+
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.",
|
|
462
|
+
type: "string"
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
required: [
|
|
466
|
+
"description"
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
authorization: {
|
|
471
|
+
title: "Whether includes `Authorization` header or not",
|
|
472
|
+
description: "Whether includes `Authorization` header or not.",
|
|
473
|
+
type: "string",
|
|
474
|
+
"enum": [
|
|
475
|
+
"header"
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
required: [
|
|
480
|
+
"schemas"
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
required: [
|
|
485
|
+
"components"
|
|
486
|
+
],
|
|
487
|
+
additionalProperties: false,
|
|
488
|
+
$defs: {}
|
|
489
|
+
},
|
|
490
|
+
description: "Generate OpenAPI components containing named schema types.\n\nThis method receives a complete set of schema components and integrates\nthem into the final OpenAPI specification. It processes all entity schemas,\ntheir variants, and related type definitions to ensure a comprehensive and\nconsistent API design.\n\nThe provided components should include schemas for all entities identified\nin the previous phases of API path/method definition and operation\ncreation. This ensures that the final OpenAPI document has complete type\ncoverage for all operations.\n\nCRITICAL: All schema definitions must follow the established naming\nconventions (IEntityName, IEntityName.ICreate, etc.) and must be thoroughly\ndocumented with descriptions that reference the original Prisma schema\ncomments.",
|
|
491
|
+
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "header" === input.authorization); const _io2 = input => Object.keys(input).every(key => {
|
|
492
|
+
const value = input[key];
|
|
493
|
+
if (undefined === value)
|
|
494
|
+
return true;
|
|
495
|
+
return "object" === typeof value && null !== value && _io3(value);
|
|
496
|
+
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
497
|
+
path: _path + ".components",
|
|
498
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
499
|
+
value: input.components
|
|
500
|
+
})) && _vo1(input.components, _path + ".components", true && _exceptionable) || _report(_exceptionable, {
|
|
501
|
+
path: _path + ".components",
|
|
502
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
503
|
+
value: input.components
|
|
504
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) || _report(_exceptionable, {
|
|
505
|
+
path: _path + ".schemas",
|
|
506
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
507
|
+
value: input.schemas
|
|
508
|
+
})) && _vo2(input.schemas, _path + ".schemas", true && _exceptionable) || _report(_exceptionable, {
|
|
509
|
+
path: _path + ".schemas",
|
|
510
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
511
|
+
value: input.schemas
|
|
512
|
+
}), undefined === input.authorization || "header" === input.authorization || _report(_exceptionable, {
|
|
513
|
+
path: _path + ".authorization",
|
|
514
|
+
expected: "(\"header\" | undefined)",
|
|
515
|
+
value: input.authorization
|
|
516
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
517
|
+
const value = input[key];
|
|
518
|
+
if (undefined === value)
|
|
519
|
+
return true;
|
|
520
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
521
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
522
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
523
|
+
value: value
|
|
524
|
+
})) && _vo3(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
525
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
526
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
527
|
+
value: value
|
|
528
|
+
});
|
|
529
|
+
}).every(flag => flag)].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
530
|
+
path: _path + ".description",
|
|
531
|
+
expected: "string",
|
|
532
|
+
value: input.description
|
|
533
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
534
|
+
if (false === __is(input)) {
|
|
535
|
+
errors = [];
|
|
536
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
537
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
538
|
+
path: _path + "",
|
|
539
|
+
expected: "IMakeComponentsProps",
|
|
540
|
+
value: input
|
|
541
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
542
|
+
path: _path + "",
|
|
543
|
+
expected: "IMakeComponentsProps",
|
|
544
|
+
value: input
|
|
545
|
+
}))(input, "$input", true);
|
|
546
|
+
const success = 0 === errors.length;
|
|
547
|
+
return success ? {
|
|
548
|
+
success,
|
|
549
|
+
data: input
|
|
550
|
+
} : {
|
|
551
|
+
success,
|
|
552
|
+
errors,
|
|
553
|
+
data: input
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
return {
|
|
557
|
+
success: true,
|
|
558
|
+
data: input
|
|
559
|
+
};
|
|
560
|
+
}; })()
|
|
561
|
+
}
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
claude,
|
|
565
|
+
llama: claude,
|
|
566
|
+
deepseek: claude,
|
|
567
|
+
"3.1": claude,
|
|
568
|
+
"3.0": {
|
|
569
|
+
model: "3.0",
|
|
570
|
+
options: {
|
|
571
|
+
constraint: true,
|
|
572
|
+
recursive: 3,
|
|
573
|
+
separate: null
|
|
574
|
+
},
|
|
575
|
+
functions: [
|
|
576
|
+
{
|
|
577
|
+
name: "makeComponents",
|
|
578
|
+
parameters: {
|
|
579
|
+
type: "object",
|
|
580
|
+
properties: {
|
|
581
|
+
components: {
|
|
582
|
+
type: "object",
|
|
583
|
+
properties: {
|
|
584
|
+
schemas: {
|
|
585
|
+
type: "object",
|
|
586
|
+
properties: {},
|
|
587
|
+
required: [],
|
|
588
|
+
description: "An object to hold reusable DTO schemas.\n\nIn other words, a collection of named JSON schemas.\n\nIMPORTANT: For each schema in this collection:\n\n1. EVERY schema MUST have a detailed description that references and aligns\n with the description comments from the corresponding Prisma DB schema\n tables\n2. EACH property within the schema MUST have detailed descriptions that\n reference and align with the description comments from the\n corresponding DB schema columns\n3. All descriptions MUST be organized into MULTIPLE PARAGRAPHS (separated by\n line breaks) when appropriate\n4. Descriptions should be comprehensive enough that anyone reading them can\n understand the purpose, functionality, and constraints of each type\n and property without needing to reference other documentation\n\n------------------------------\n\nDescription of the current {@link RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Construct a type with a set of properties K of type T",
|
|
589
|
+
additionalProperties: {
|
|
590
|
+
type: "object",
|
|
591
|
+
properties: {
|
|
592
|
+
description: {
|
|
593
|
+
type: "string",
|
|
594
|
+
title: "Description about the type",
|
|
595
|
+
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."
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
required: [
|
|
599
|
+
"description"
|
|
600
|
+
],
|
|
601
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Descriptive type schema info.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\n> Generative, but it has a `description` property which is required.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\n> specification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\n> and duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\n> and AI generation.\n> \n> CRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n> \n> When creating descriptions for components, types, and properties:\n> \n> 1. 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.\n> 2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n> line breaks. Single-paragraph descriptions should be avoided.\n> 3. 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\n> 4. 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\n> 5. 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",
|
|
602
|
+
additionalProperties: false
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
authorization: {
|
|
606
|
+
type: "string",
|
|
607
|
+
"enum": [
|
|
608
|
+
"header"
|
|
609
|
+
],
|
|
610
|
+
title: "Whether includes `Authorization` header or not",
|
|
611
|
+
description: "Whether includes `Authorization` header or not."
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
required: [
|
|
615
|
+
"schemas"
|
|
616
|
+
],
|
|
617
|
+
description: "Complete set of schema components for the OpenAPI specification.\n\nThis property contains comprehensive type definitions for all entities in\nthe system. It is the central repository of all named schema types that\nwill be used throughout the API specification.\n\nCRITICAL REQUIREMENT: All object types MUST be defined as named types in\nthe components.schemas section. Inline anonymous object definitions are\nstrictly prohibited.\n\nThis components object should include:\n\n- Main entity types (IEntityName)\n- Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)\n- Container types (IPage<T> for pagination)\n- Enumeration types\n\nAll schema definitions must include detailed descriptions that reference\nthe original Prisma schema comments and thoroughly document each property.\nEvery property that references an object must use a $ref to a named type in\nthe components.schemas section. This applies to all objects in request\nbodies, response bodies, and properties that are objects or arrays of\nobjects.\n\nExample structure:\n\n components: {\n schemas: {\n IUser: {\n type: \"object\",\n properties: {\n id: { type: \"string\", format: \"uuid\" },\n email: { type: \"string\", format: \"email\" },\n profile: { \"$ref\": \"#/components/schemas/IUserProfile\" }\n },\n required: [\"id\", \"email\"],\n description: \"User entity representing system account holders...\"\n },\n \"IUser.ICreate\": { ... },\n // Additional schemas\n }\n }\n\n------------------------------\n\nDescription of the current {@link AutoBeOpenApi.IComponents} type:\n\n> Reusable components in OpenAPI.\n> \n> A storage of reusable components in OpenAPI document.\n> \n> In other words, it is a storage of named DTO schemas and security schemes.",
|
|
618
|
+
additionalProperties: false
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
required: [
|
|
622
|
+
"components"
|
|
623
|
+
],
|
|
624
|
+
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
625
|
+
additionalProperties: false
|
|
626
|
+
},
|
|
627
|
+
description: "Generate OpenAPI components containing named schema types.\n\nThis method receives a complete set of schema components and integrates\nthem into the final OpenAPI specification. It processes all entity schemas,\ntheir variants, and related type definitions to ensure a comprehensive and\nconsistent API design.\n\nThe provided components should include schemas for all entities identified\nin the previous phases of API path/method definition and operation\ncreation. This ensures that the final OpenAPI document has complete type\ncoverage for all operations.\n\nCRITICAL: All schema definitions must follow the established naming\nconventions (IEntityName, IEntityName.ICreate, etc.) and must be thoroughly\ndocumented with descriptions that reference the original Prisma schema\ncomments.",
|
|
628
|
+
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "header" === input.authorization); const _io2 = input => Object.keys(input).every(key => {
|
|
629
|
+
const value = input[key];
|
|
630
|
+
if (undefined === value)
|
|
631
|
+
return true;
|
|
632
|
+
return "object" === typeof value && null !== value && _io3(value);
|
|
633
|
+
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
634
|
+
path: _path + ".components",
|
|
635
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
636
|
+
value: input.components
|
|
637
|
+
})) && _vo1(input.components, _path + ".components", true && _exceptionable) || _report(_exceptionable, {
|
|
638
|
+
path: _path + ".components",
|
|
639
|
+
expected: "AutoBeOpenApi.IComponents",
|
|
640
|
+
value: input.components
|
|
641
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) || _report(_exceptionable, {
|
|
642
|
+
path: _path + ".schemas",
|
|
643
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
644
|
+
value: input.schemas
|
|
645
|
+
})) && _vo2(input.schemas, _path + ".schemas", true && _exceptionable) || _report(_exceptionable, {
|
|
646
|
+
path: _path + ".schemas",
|
|
647
|
+
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
648
|
+
value: input.schemas
|
|
649
|
+
}), undefined === input.authorization || "header" === input.authorization || _report(_exceptionable, {
|
|
650
|
+
path: _path + ".authorization",
|
|
651
|
+
expected: "(\"header\" | undefined)",
|
|
652
|
+
value: input.authorization
|
|
653
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
654
|
+
const value = input[key];
|
|
655
|
+
if (undefined === value)
|
|
656
|
+
return true;
|
|
657
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
658
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
659
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
660
|
+
value: value
|
|
661
|
+
})) && _vo3(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
662
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
663
|
+
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
664
|
+
value: value
|
|
665
|
+
});
|
|
666
|
+
}).every(flag => flag)].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
667
|
+
path: _path + ".description",
|
|
668
|
+
expected: "string",
|
|
669
|
+
value: input.description
|
|
670
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
671
|
+
if (false === __is(input)) {
|
|
672
|
+
errors = [];
|
|
673
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
674
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
675
|
+
path: _path + "",
|
|
676
|
+
expected: "IMakeComponentsProps",
|
|
677
|
+
value: input
|
|
678
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
679
|
+
path: _path + "",
|
|
680
|
+
expected: "IMakeComponentsProps",
|
|
681
|
+
value: input
|
|
682
|
+
}))(input, "$input", true);
|
|
683
|
+
const success = 0 === errors.length;
|
|
684
|
+
return success ? {
|
|
685
|
+
success,
|
|
686
|
+
data: input
|
|
687
|
+
} : {
|
|
688
|
+
success,
|
|
689
|
+
errors,
|
|
690
|
+
data: input
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
return {
|
|
694
|
+
success: true,
|
|
695
|
+
data: input
|
|
696
|
+
};
|
|
697
|
+
}; })()
|
|
698
|
+
}
|
|
699
|
+
]
|
|
700
|
+
},
|
|
701
|
+
};
|
|
702
|
+
//# sourceMappingURL=orchestrateInterfaceComponents.js.map
|