@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,2065 @@
|
|
|
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.orchestrateInterfaceOperations = orchestrateInterfaceOperations;
|
|
49
|
+
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const core_1 = require("@agentica/core");
|
|
51
|
+
const tstl_1 = require("tstl");
|
|
52
|
+
const typia_1 = __importDefault(require("typia"));
|
|
53
|
+
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
|
+
const divideArray_1 = require("../../utils/divideArray");
|
|
55
|
+
const OpenApiEndpointComparator_1 = require("./OpenApiEndpointComparator");
|
|
56
|
+
const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
|
|
57
|
+
function orchestrateInterfaceOperations(ctx_1, endpoints_1) {
|
|
58
|
+
return __awaiter(this, arguments, void 0, function* (ctx, endpoints, capacity = 12) {
|
|
59
|
+
const matrix = (0, divideArray_1.divideArray)({
|
|
60
|
+
array: endpoints,
|
|
61
|
+
capacity,
|
|
62
|
+
});
|
|
63
|
+
let completed = 0;
|
|
64
|
+
const operations = yield Promise.all(matrix.map((it) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
const row = yield divideAndConquer(ctx, it, 3, (count) => {
|
|
67
|
+
completed += count;
|
|
68
|
+
});
|
|
69
|
+
ctx.dispatch({
|
|
70
|
+
type: "interfaceOperations",
|
|
71
|
+
operations: row,
|
|
72
|
+
completed,
|
|
73
|
+
total: endpoints.length,
|
|
74
|
+
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
75
|
+
created_at: new Date().toISOString(),
|
|
76
|
+
});
|
|
77
|
+
return row;
|
|
78
|
+
})));
|
|
79
|
+
return operations.flat();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function divideAndConquer(ctx, endpoints, retry, progress) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const remained = new tstl_1.HashSet(endpoints, OpenApiEndpointComparator_1.OpenApiEndpointComparator.hashCode, OpenApiEndpointComparator_1.OpenApiEndpointComparator.equals);
|
|
85
|
+
const operations = new tstl_1.HashMap(OpenApiEndpointComparator_1.OpenApiEndpointComparator.hashCode, OpenApiEndpointComparator_1.OpenApiEndpointComparator.equals);
|
|
86
|
+
for (let i = 0; i < retry; ++i) {
|
|
87
|
+
if (remained.empty() === true || operations.size() >= endpoints.length)
|
|
88
|
+
break;
|
|
89
|
+
const before = operations.size();
|
|
90
|
+
const newbie = yield process(ctx, Array.from(remained));
|
|
91
|
+
for (const item of newbie) {
|
|
92
|
+
operations.set(item, item);
|
|
93
|
+
remained.erase(item);
|
|
94
|
+
}
|
|
95
|
+
if (operations.size() - before !== 0)
|
|
96
|
+
progress(operations.size() - before);
|
|
97
|
+
}
|
|
98
|
+
return operations.toJSON().map((it) => it.second);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function process(ctx, endpoints) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
var _a;
|
|
104
|
+
const pointer = {
|
|
105
|
+
value: null,
|
|
106
|
+
};
|
|
107
|
+
const agentica = new core_1.MicroAgentica({
|
|
108
|
+
model: ctx.model,
|
|
109
|
+
vendor: ctx.vendor,
|
|
110
|
+
config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
|
|
111
|
+
describe: null,
|
|
112
|
+
} }),
|
|
113
|
+
histories: (0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# API Endpoint Generator System Prompt\n\n## 1. Overview\n\nYou are the API Endpoint Generator, specializing in creating comprehensive lists of REST API endpoints with their paths and HTTP methods based on requirements documents, Prisma schema files, and ERD diagrams. You must output your results by calling the `makeEndpoints()` function.\n\n## 2. Your Mission\n\nAnalyze the provided information and generate a complete array of API endpoints that includes EVERY entity from the Prisma schema and addresses ALL functional requirements. You will call the `makeEndpoints()` function with an array of endpoint definitions that contain ONLY path and method properties.\n\n## 3. Output Method\n\nYou MUST call the `makeEndpoints()` function with your results.\n\n```typescript\nmakeEndpoints({\n endpoints: [\n {\n \"path\": \"/resources\",\n \"method\": \"get\"\n },\n {\n \"path\": \"/resources/{resourceId}\",\n \"method\": \"get\"\n },\n // more endpoints...\n ],\n});\n```\n\n## 4. Endpoint Design Principles\n\n### 4.1. Follow REST principles\n\n- Resource-centric URL design (use nouns, not verbs)\n- Appropriate HTTP methods:\n - `put`: Retrieve a collection resources with searching information\n - `get`: Retrieve a single resource\n - `post`: Create new resources\n - `delete`: Remove resources\n - `patch`: Partial updates or complex queries with request bodies\n\n### 4.2. Path Formatting Rules\n\n1. **Use camelCase for all resource names in paths**\n - Example: Use `/attachmentFiles` instead of `/attachment-files`\n\n2. **Use domain prefixes with slashes**\n - Example: Use `/shopping/channels` instead of `/shopping-channels`\n - **Important**: If you identify any service-related prefix in the DB schema, use it as the global prefix for ALL API endpoints\n\n3. **Structure hierarchical relationships with slashes**\n - Example: For a child entity like \"sale-snapshots\" under \"sales\", use `/shopping/sales/snapshots` instead of `/shopping-sale-snapshots`\n\n### 4.3. Path patterns\n\n- Collection endpoints: `/domain/resources`\n- Single resource endpoints: `/domain/resources/{resourceId}`\n- Nested resources: `/domain/resources/{resourceId}/subsidiaries/{subsidiaryId}`\n\n### 4.4. Standard API operations per entity\n\nFor EACH independent entity identified in the requirements document, Prisma DB Schema, and ERD diagram, you MUST include these standard endpoints:\n\n1. `PATCH /entity-plural` - List entities with searching\n2. `GET /entity-plural/{id}` - Get specific entity\n3. `POST /entity-plural` - Create entity\n4. `PUT /entity-plural/{id}` - Update entity\n5. `DELETE /entity-plural/{id}` - Delete entity\n\n## 5. Critical Requirements\n\n- **Function Call Required**: You MUST use the `makeEndpoints()` function to submit your results\n- **Complete Coverage**: EVERY independent entity in the Prisma schema MUST have corresponding endpoints\n- **No Omissions**: Process ALL independent entities regardless of quantity\n- **Strict Output Format**: ONLY include objects with `path` and `method` properties in your function call\n- **No Additional Properties**: Do NOT include any properties beyond `path` and `method`\n\n## 6. Implementation Strategy\n\n1. Identify ALL independent entities from the Prisma schema, requirements document, and ERD\n2. Identify service-related prefixes in the DB schema to use as the global prefix for ALL API endpoints\n3. Identify domain prefixes and hierarchical relationships between entities\n4. For each independent entity:\n - Convert kebab-case names to camelCase (e.g., `attachment-files` \u2192 `attachmentFiles`)\n - Structure paths to reflect domain and hierarchical relationships\n - Generate the standard endpoints\n5. Add endpoints for relationships and complex operations\n6. Verify ALL independent entities and requirements are covered\n7. Call the `makeEndpoints()` function with your complete array\n\nYour implementation MUST be COMPLETE and EXHAUSTIVE, ensuring NO independent entity or requirement is missed, while strictly adhering to the `AutoBeOpenApi.IEndpoint` interface format. Calling the `makeEndpoints()` function is MANDATORY.\n\n## 7. Path Transformation Examples\n\n| Original Format | Improved Format | Explanation |\n|-----------------|-----------------|-------------|\n| `/attachment-files` | `/attachmentFiles` | Convert kebab-case to camelCase |\n| `/bbs-articles` | `/bbs/articles` | Separate domain prefix with slash |\n| `/bbs-article-snapshots` | `/bbs/articles/snapshots` | Reflect hierarchy in URL structure |\n| `/shopping-sale-snapshots` | `/shopping/sales/snapshots` | Both domain prefix and hierarchy properly formatted |\n\nYour implementation MUST be COMPLETE and EXHAUSTIVE, ensuring NO independent entity or requirement is missed, while strictly adhering to the `AutoBeOpenApi.IEndpoint` interface format. Calling the `makeEndpoints()` function is MANDATORY.\n\nYou're right - I removed too much of the original structure. Here's a better version that maintains the section structure while adding explanations:\n\n## 8. Example Cases\n\nBelow are example projects that demonstrate the proper endpoint formatting.\n\n### 8.1. BBS (Bulletin Board System)\n\n```json\n{\"endpoints\":[{\"path\":\"/bbs/articles\",\"method\":\"post\"},{\"path\":\"/bbs/articles\",\"method\":\"patch\"},{\"path\":\"/bbs/articles/abridges\",\"method\":\"patch\"},{\"path\":\"/bbs/articles/{id}\",\"method\":\"get\"},{\"path\":\"/bbs/articles/{id}\",\"method\":\"put\"},{\"path\":\"/bbs/articles/{id}\",\"method\":\"delete\"},{\"path\":\"/bbs/articles/{articleId}/comments\",\"method\":\"post\"},{\"path\":\"/bbs/articles/{articleId}/comments\",\"method\":\"patch\"},{\"path\":\"/bbs/articles/{articleId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/bbs/articles/{articleId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/bbs/articles/{articleId}/comments/{id}\",\"method\":\"delete\"},{\"path\":\"/monitors/health\",\"method\":\"get\"},{\"path\":\"/monitors/performance\",\"method\":\"get\"},{\"path\":\"/monitors/system\",\"method\":\"get\"}]}\n```\n\n**Key points**: Notice how the domain prefix \"bbs\" is separated with a slash, entities use camelCase, and hierarchical relationships are expressed (e.g., `/bbs/articles/{articleId}/comments`).\n\n### 8.2. Shopping Mall\n\n```json\n{\"endpoints\":[{\"path\":\"/monitors/health\",\"method\":\"get\"},{\"path\":\"/monitors/performance\",\"method\":\"get\"},{\"path\":\"/monitors/system\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/authenticate\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/authenticate\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/authenticate/login\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/coupons\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/coupons\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/coupons/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/coupons/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/deposits\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/deposits\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/deposits/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/deposits/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/deposits/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/mileages\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/mileages\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/mileages/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/mileages/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/mileages/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/mileages/donations\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/mileages/donations\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/mileages/donations/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/orders\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/orders/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/details\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/snapshots\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/snapshots/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/snapshots/{id}/flip\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/merge\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/{id}/invert\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/systematic/channels\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/channels/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/systematic/channels/merge\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/systematic/channels/hierarchical\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/channels/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/sections\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/systematic/sections\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/sections/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/sections/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/systematic/sections/merge\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/systematic/sections/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/authenticate/refresh\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/authenticate\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/authenticate\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/join\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/login\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/authenticate/activate\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/external\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/password/change\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/coupons\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/coupons/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/coupons/tickets\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/coupons/tickets\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/coupons/tickets/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/charges\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/deposits/charges\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/deposits/charges/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/charges/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/deposits/charges/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/deposits/charges/{chargeId}/publish/able\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/charges/{chargeId}/publish\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/deposits/histories\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/deposits/histories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/histories/balance\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/mileages/histories\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/mileages/histories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/mileages/histories/balance\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/carts/commodities\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/carts/commodities\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}/replica\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/carts/commodities/discountable\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/orders\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/orders\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/orders/direct\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/orders/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/orders/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/orders/{id}/price\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/orders/{id}/discountable\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/orders/{id}/discount\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/orders/{orderId}/goods/{id}/confirm\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/orders/{orderId}/publish/able\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/orders/{orderId}/publish\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/orders/{orderId}/publish\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/sales/details\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{id}\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{id}\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/snapshots\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/snapshots/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/snapshots/{id}/flip\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels/{channelCode}/categories\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels/{channelCode}/categories/{id}/invert\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/channels/hierarchical\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/channels/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/sections\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/sections/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/sections/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/authenticate\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/authenticate\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/authenticate/login\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/deliveries\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/deliveries\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/deliveries/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/deliveries/incompletes\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/journeys\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/journeys/{id}/complete\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/journeys/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/shippers\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/coupons\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/coupons\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/coupons/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/coupons/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/orders\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/orders/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{id}/open\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{id}/replica\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{id}/pause\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/sales/{id}/suspend\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/sales/{id}/restore\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/details\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{questionId}/answer\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{questionId}/answer\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{reviewId}/answer\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{reviewId}/answer\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots/{id}/replica\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots/{id}/flip\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/systematic/channels/{channelCode}/categories\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/channels/{channelCode}/categories/{id}/invert\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/channels\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/channels/hierarchical\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/channels/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/channels/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/sections\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/sections/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/sections/{code}/get\",\"method\":\"get\"}]}\n```\n\n**Key points**: Observe how `/shopping` is used as domain prefix, hierarchical relationships are reflected in paths (e.g., `/shopping/sales/{saleId}/reviews/{reviewId}`), and consistent HTTP methods are applied across similar operations." /* AutoBeSystemPromptConstant.INTERFACE_ENDPOINT */),
|
|
114
|
+
tokenUsage: ctx.usage(),
|
|
115
|
+
controllers: [
|
|
116
|
+
createApplication({
|
|
117
|
+
model: ctx.model,
|
|
118
|
+
build: (endpoints) => __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
pointer.value = endpoints;
|
|
120
|
+
}),
|
|
121
|
+
pointer,
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
});
|
|
125
|
+
agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
event.body.tool_choice = "required";
|
|
127
|
+
}));
|
|
128
|
+
yield agentica.conversate([
|
|
129
|
+
"Make API operations for below endpoints:",
|
|
130
|
+
"",
|
|
131
|
+
"```json",
|
|
132
|
+
JSON.stringify(Array.from(endpoints), null, 2),
|
|
133
|
+
"```",
|
|
134
|
+
].join("\n"));
|
|
135
|
+
if (pointer.value === null)
|
|
136
|
+
throw new Error("Failed to create operations."); // never be happened
|
|
137
|
+
return pointer.value;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function createApplication(props) {
|
|
141
|
+
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
142
|
+
const application = collection[props.model];
|
|
143
|
+
application.functions[0].validate = (next) => {
|
|
144
|
+
const result = (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.specification && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(input.responseBody)) && "string" === typeof input.path && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io2 = input => "string" === typeof input.name && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io3 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io5 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
145
|
+
if ("number" === input.type)
|
|
146
|
+
return _io4(input);
|
|
147
|
+
else if ("integer" === input.type)
|
|
148
|
+
return _io3(input);
|
|
149
|
+
else if ("string" === input.type)
|
|
150
|
+
return _io5(input);
|
|
151
|
+
else
|
|
152
|
+
return false;
|
|
153
|
+
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
154
|
+
path: _path + ".operations",
|
|
155
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
156
|
+
value: input.operations
|
|
157
|
+
})) && input.operations.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
158
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
159
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
160
|
+
value: elem
|
|
161
|
+
})) && _vo1(elem, _path + ".operations[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
162
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
163
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
164
|
+
value: elem
|
|
165
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
166
|
+
path: _path + ".operations",
|
|
167
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
168
|
+
value: input.operations
|
|
169
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.specification || _report(_exceptionable, {
|
|
170
|
+
path: _path + ".specification",
|
|
171
|
+
expected: "string",
|
|
172
|
+
value: input.specification
|
|
173
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
174
|
+
path: _path + ".description",
|
|
175
|
+
expected: "string",
|
|
176
|
+
value: input.description
|
|
177
|
+
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
178
|
+
path: _path + ".summary",
|
|
179
|
+
expected: "string",
|
|
180
|
+
value: input.summary
|
|
181
|
+
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
182
|
+
path: _path + ".parameters",
|
|
183
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
184
|
+
value: input.parameters
|
|
185
|
+
})) && input.parameters.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
186
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
187
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
188
|
+
value: elem
|
|
189
|
+
})) && _vo2(elem, _path + ".parameters[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
190
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
191
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
192
|
+
value: elem
|
|
193
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
194
|
+
path: _path + ".parameters",
|
|
195
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
196
|
+
value: input.parameters
|
|
197
|
+
}), null === input.requestBody || ("object" === typeof input.requestBody && null !== input.requestBody || _report(_exceptionable, {
|
|
198
|
+
path: _path + ".requestBody",
|
|
199
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
200
|
+
value: input.requestBody
|
|
201
|
+
})) && _vo6(input.requestBody, _path + ".requestBody", true && _exceptionable) || _report(_exceptionable, {
|
|
202
|
+
path: _path + ".requestBody",
|
|
203
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
204
|
+
value: input.requestBody
|
|
205
|
+
}), null === input.responseBody || ("object" === typeof input.responseBody && null !== input.responseBody || _report(_exceptionable, {
|
|
206
|
+
path: _path + ".responseBody",
|
|
207
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
208
|
+
value: input.responseBody
|
|
209
|
+
})) && _vo7(input.responseBody, _path + ".responseBody", true && _exceptionable) || _report(_exceptionable, {
|
|
210
|
+
path: _path + ".responseBody",
|
|
211
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
212
|
+
value: input.responseBody
|
|
213
|
+
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
214
|
+
path: _path + ".path",
|
|
215
|
+
expected: "string",
|
|
216
|
+
value: input.path
|
|
217
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
218
|
+
path: _path + ".method",
|
|
219
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
220
|
+
value: input.method
|
|
221
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
222
|
+
path: _path + ".name",
|
|
223
|
+
expected: "string",
|
|
224
|
+
value: input.name
|
|
225
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
226
|
+
path: _path + ".description",
|
|
227
|
+
expected: "string",
|
|
228
|
+
value: input.description
|
|
229
|
+
}), ("object" === typeof input.schema && null !== input.schema || _report(_exceptionable, {
|
|
230
|
+
path: _path + ".schema",
|
|
231
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
232
|
+
value: input.schema
|
|
233
|
+
})) && _vu0(input.schema, _path + ".schema", true && _exceptionable) || _report(_exceptionable, {
|
|
234
|
+
path: _path + ".schema",
|
|
235
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
236
|
+
value: input.schema
|
|
237
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000 || _report(_exceptionable, {
|
|
238
|
+
path: _path + ".minimum",
|
|
239
|
+
expected: "number & Type<\"int64\">",
|
|
240
|
+
value: input.minimum
|
|
241
|
+
})) || _report(_exceptionable, {
|
|
242
|
+
path: _path + ".minimum",
|
|
243
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
244
|
+
value: input.minimum
|
|
245
|
+
}), undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000 || _report(_exceptionable, {
|
|
246
|
+
path: _path + ".maximum",
|
|
247
|
+
expected: "number & Type<\"int64\">",
|
|
248
|
+
value: input.maximum
|
|
249
|
+
})) || _report(_exceptionable, {
|
|
250
|
+
path: _path + ".maximum",
|
|
251
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
252
|
+
value: input.maximum
|
|
253
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
254
|
+
path: _path + ".exclusiveMinimum",
|
|
255
|
+
expected: "(number | undefined)",
|
|
256
|
+
value: input.exclusiveMinimum
|
|
257
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
258
|
+
path: _path + ".exclusiveMaximum",
|
|
259
|
+
expected: "(number | undefined)",
|
|
260
|
+
value: input.exclusiveMaximum
|
|
261
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 || _report(_exceptionable, {
|
|
262
|
+
path: _path + ".multipleOf",
|
|
263
|
+
expected: "number & Type<\"uint64\">",
|
|
264
|
+
value: input.multipleOf
|
|
265
|
+
})) && (0 < input.multipleOf || _report(_exceptionable, {
|
|
266
|
+
path: _path + ".multipleOf",
|
|
267
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
268
|
+
value: input.multipleOf
|
|
269
|
+
})) || _report(_exceptionable, {
|
|
270
|
+
path: _path + ".multipleOf",
|
|
271
|
+
expected: "((number & Type<\"uint64\"> & ExclusiveMinimum<0>) | undefined)",
|
|
272
|
+
value: input.multipleOf
|
|
273
|
+
}), "integer" === input.type || _report(_exceptionable, {
|
|
274
|
+
path: _path + ".type",
|
|
275
|
+
expected: "\"integer\"",
|
|
276
|
+
value: input.type
|
|
277
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum || _report(_exceptionable, {
|
|
278
|
+
path: _path + ".minimum",
|
|
279
|
+
expected: "(number | undefined)",
|
|
280
|
+
value: input.minimum
|
|
281
|
+
}), undefined === input.maximum || "number" === typeof input.maximum || _report(_exceptionable, {
|
|
282
|
+
path: _path + ".maximum",
|
|
283
|
+
expected: "(number | undefined)",
|
|
284
|
+
value: input.maximum
|
|
285
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
286
|
+
path: _path + ".exclusiveMinimum",
|
|
287
|
+
expected: "(number | undefined)",
|
|
288
|
+
value: input.exclusiveMinimum
|
|
289
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
290
|
+
path: _path + ".exclusiveMaximum",
|
|
291
|
+
expected: "(number | undefined)",
|
|
292
|
+
value: input.exclusiveMaximum
|
|
293
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (0 < input.multipleOf || _report(_exceptionable, {
|
|
294
|
+
path: _path + ".multipleOf",
|
|
295
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
296
|
+
value: input.multipleOf
|
|
297
|
+
})) || _report(_exceptionable, {
|
|
298
|
+
path: _path + ".multipleOf",
|
|
299
|
+
expected: "((number & ExclusiveMinimum<0>) | undefined)",
|
|
300
|
+
value: input.multipleOf
|
|
301
|
+
}), "number" === input.type || _report(_exceptionable, {
|
|
302
|
+
path: _path + ".type",
|
|
303
|
+
expected: "\"number\"",
|
|
304
|
+
value: input.type
|
|
305
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => [undefined === input.format || "string" === typeof input.format || _report(_exceptionable, {
|
|
306
|
+
path: _path + ".format",
|
|
307
|
+
expected: "(string | undefined)",
|
|
308
|
+
value: input.format
|
|
309
|
+
}), undefined === input.pattern || "string" === typeof input.pattern || _report(_exceptionable, {
|
|
310
|
+
path: _path + ".pattern",
|
|
311
|
+
expected: "(string | undefined)",
|
|
312
|
+
value: input.pattern
|
|
313
|
+
}), undefined === input.contentMediaType || "string" === typeof input.contentMediaType || _report(_exceptionable, {
|
|
314
|
+
path: _path + ".contentMediaType",
|
|
315
|
+
expected: "(string | undefined)",
|
|
316
|
+
value: input.contentMediaType
|
|
317
|
+
}), undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
318
|
+
path: _path + ".minLength",
|
|
319
|
+
expected: "number & Type<\"uint64\">",
|
|
320
|
+
value: input.minLength
|
|
321
|
+
})) || _report(_exceptionable, {
|
|
322
|
+
path: _path + ".minLength",
|
|
323
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
324
|
+
value: input.minLength
|
|
325
|
+
}), undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
326
|
+
path: _path + ".maxLength",
|
|
327
|
+
expected: "number & Type<\"uint64\">",
|
|
328
|
+
value: input.maxLength
|
|
329
|
+
})) || _report(_exceptionable, {
|
|
330
|
+
path: _path + ".maxLength",
|
|
331
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
332
|
+
value: input.maxLength
|
|
333
|
+
}), "string" === input.type || _report(_exceptionable, {
|
|
334
|
+
path: _path + ".type",
|
|
335
|
+
expected: "\"string\"",
|
|
336
|
+
value: input.type
|
|
337
|
+
})].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
338
|
+
path: _path + ".description",
|
|
339
|
+
expected: "string",
|
|
340
|
+
value: input.description
|
|
341
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
342
|
+
path: _path + ".typeName",
|
|
343
|
+
expected: "string",
|
|
344
|
+
value: input.typeName
|
|
345
|
+
})].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
346
|
+
path: _path + ".description",
|
|
347
|
+
expected: "string",
|
|
348
|
+
value: input.description
|
|
349
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
350
|
+
path: _path + ".typeName",
|
|
351
|
+
expected: "string",
|
|
352
|
+
value: input.typeName
|
|
353
|
+
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
354
|
+
if ("number" === input.type)
|
|
355
|
+
return _vo4(input, _path, true && _exceptionable);
|
|
356
|
+
else if ("integer" === input.type)
|
|
357
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
358
|
+
else if ("string" === input.type)
|
|
359
|
+
return _vo5(input, _path, true && _exceptionable);
|
|
360
|
+
else
|
|
361
|
+
return _report(_exceptionable, {
|
|
362
|
+
path: _path,
|
|
363
|
+
expected: "(AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.IString)",
|
|
364
|
+
value: input
|
|
365
|
+
});
|
|
366
|
+
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
367
|
+
if (false === __is(input)) {
|
|
368
|
+
errors = [];
|
|
369
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
370
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
371
|
+
path: _path + "",
|
|
372
|
+
expected: "IMakeOperationProps",
|
|
373
|
+
value: input
|
|
374
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
375
|
+
path: _path + "",
|
|
376
|
+
expected: "IMakeOperationProps",
|
|
377
|
+
value: input
|
|
378
|
+
}))(input, "$input", true);
|
|
379
|
+
const success = 0 === errors.length;
|
|
380
|
+
return success ? {
|
|
381
|
+
success,
|
|
382
|
+
data: input
|
|
383
|
+
} : {
|
|
384
|
+
success,
|
|
385
|
+
errors,
|
|
386
|
+
data: input
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
success: true,
|
|
391
|
+
data: input
|
|
392
|
+
};
|
|
393
|
+
}; })()(next);
|
|
394
|
+
if (result.success === false)
|
|
395
|
+
return result;
|
|
396
|
+
props.pointer.value = result.data.operations;
|
|
397
|
+
const errors = [];
|
|
398
|
+
result.data.operations.forEach((op, i) => {
|
|
399
|
+
if (op.method === "get" && op.requestBody !== null)
|
|
400
|
+
errors.push({
|
|
401
|
+
path: `operations[${i}].requestBody`,
|
|
402
|
+
expected: "GET method should not have request body. Change method, or re-design the operation.",
|
|
403
|
+
value: op.requestBody,
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
if (errors.length !== 0)
|
|
407
|
+
return {
|
|
408
|
+
success: false,
|
|
409
|
+
errors,
|
|
410
|
+
data: next,
|
|
411
|
+
};
|
|
412
|
+
return result;
|
|
413
|
+
};
|
|
414
|
+
return {
|
|
415
|
+
protocol: "class",
|
|
416
|
+
name: "interface",
|
|
417
|
+
application,
|
|
418
|
+
execute: {
|
|
419
|
+
makeOperations: (next) => __awaiter(this, void 0, void 0, function* () {
|
|
420
|
+
yield props.build(next.operations);
|
|
421
|
+
return {
|
|
422
|
+
success: true,
|
|
423
|
+
};
|
|
424
|
+
}),
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
const claude = {
|
|
429
|
+
model: "claude",
|
|
430
|
+
options: {
|
|
431
|
+
reference: true,
|
|
432
|
+
separate: null
|
|
433
|
+
},
|
|
434
|
+
functions: [
|
|
435
|
+
{
|
|
436
|
+
name: "makeOperations",
|
|
437
|
+
parameters: {
|
|
438
|
+
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeOperationProps}",
|
|
439
|
+
type: "object",
|
|
440
|
+
properties: {
|
|
441
|
+
operations: {
|
|
442
|
+
title: "Array of API operations to generate",
|
|
443
|
+
description: "Array of API operations to generate.\n\nEach operation in this array must include:\n\n- Specification: Detailed API specification with clear purpose and\n functionality\n- Path: Resource-centric URL path (e.g., \"/resources/{resourceId}\")\n- Method: HTTP method (get, post, put, delete, patch)\n- Description: Extremely detailed multi-paragraph description referencing\n Prisma schema comments\n- Summary: Concise one-sentence summary of the endpoint\n- Parameters: Array of all necessary parameters with descriptions and schema\n definitions\n- RequestBody: For POST/PUT/PATCH methods, with typeName referencing\n components.schemas\n- ResponseBody: With typeName referencing appropriate response type\n\nAll operations must follow strict quality standards:\n\n1. Detailed descriptions referencing Prisma schema comments\n2. Accurate parameter definitions matching path parameters\n3. Appropriate request/response body type references\n4. Consistent patterns for CRUD operations\n\nFor list retrievals (typically PATCH), include pagination, search, and\nsorting. For detail retrieval (GET), return a single resource. For creation\n(POST), use .ICreate request body. For modification (PUT), use .IUpdate\nrequest body.",
|
|
444
|
+
type: "array",
|
|
445
|
+
items: {
|
|
446
|
+
description: "Description of the current {@link AutoBeOpenApi.IOperation} type:\n\n> Operation of the Restful API.\n> \n> This interface defines a single API endpoint with its HTTP {@link method},\n> {@link path}, {@link parameters path parameters},\n> {@link requestBody request body}, and {@link responseBody} structure. It\n> corresponds to an individual operation in the paths section of an OpenAPI\n> document.\n> \n> Each operation requires a detailed explanation of its purpose through the\n> reason and description fields, making it clear why the API was designed and\n> how it should be used.\n> \n> All request bodies and responses for this operation must be object types\n> and must reference named types defined in the components section. The\n> content-type is always `application/json`. For file upload/download\n> operations, use `string & tags.Format<\"uri\">` in the appropriate schema\n> instead of binary data formats.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"/shoppings/customers/orders\": {\n> \"post\": {\n> \"description\": \"Create a new order application from shopping cart...\",\n> \"parameters\": [...],\n> \"requestBody\": {...},\n> \"responses\": {...}\n> }\n> }\n> }\n> ```",
|
|
447
|
+
type: "object",
|
|
448
|
+
properties: {
|
|
449
|
+
specification: {
|
|
450
|
+
title: "Specification of the API operation",
|
|
451
|
+
description: "Specification of the API operation.\n\nBefore defining the API operation interface, please describe what you're\nplanning to write in this `specification` field.\n\nThe specification must be fully detailed and clear, so that anyone can\nunderstand the purpose and functionality of the API operation and its\nrelated components (e.g., {@link path}, {@link parameters},\n{@link requestBody}).\n\nIMPORTANT: The specification MUST identify which Prisma DB table this\noperation is associated with, helping ensure complete coverage of all\ndatabase entities.",
|
|
452
|
+
type: "string"
|
|
453
|
+
},
|
|
454
|
+
description: {
|
|
455
|
+
title: "Detailed description about the API operation",
|
|
456
|
+
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n> MUST be written in English. Never use other languages.",
|
|
457
|
+
type: "string"
|
|
458
|
+
},
|
|
459
|
+
summary: {
|
|
460
|
+
title: "Short summary of the API operation",
|
|
461
|
+
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n> MUST be written in English. Never use other languages",
|
|
462
|
+
type: "string"
|
|
463
|
+
},
|
|
464
|
+
parameters: {
|
|
465
|
+
title: "List of path parameters",
|
|
466
|
+
description: "List of path parameters.\n\nNote that, the {@link AutoBeOpenApi.IParameter.name identifier name} of\npath parameter must be corresponded to the\n{@link path API operation path}.\n\nFor example, if there's an API operation which has {@link path} of\n`/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}`,\nits list of {@link AutoBeOpenApi.IParameter.name path parameters} must be\nlike:\n\n- `saleId`\n- `questionId`\n- `commentId`",
|
|
467
|
+
type: "array",
|
|
468
|
+
items: {
|
|
469
|
+
description: "Description of the current {@link AutoBeOpenApi.IParameter} type:\n\n> Path parameter information for API routes.\n> \n> This interface defines a path parameter that appears in the URL of an API\n> endpoint. Path parameters are enclosed in curly braces in the\n> {@link AutoBeOpenApi.IOperation.path operation path} and must be defined\n> with their types and descriptions.\n> \n> For example, if API operation path is\n> `/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}`,\n> the path parameters should be like below:\n> \n> ```json\n> {\n> \"path\": \"/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}\",\n> \"method\": \"get\",\n> \"parameters\": [\n> {\n> \"name\": \"saleId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target sale's ID\"\n> },\n> {\n> \"name\": \"questionId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target question's ID\"\n> },\n> {\n> \"name\": \"commentId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target comment's ID\"\n> }\n> ]\n> }\n> ```",
|
|
470
|
+
type: "object",
|
|
471
|
+
properties: {
|
|
472
|
+
name: {
|
|
473
|
+
title: "Identifier name of the path parameter",
|
|
474
|
+
description: "Identifier name of the path parameter.\n\nThis name must match exactly with the parameter name in the route path.\nIt must be corresponded to the\n{@link AutoBeOpenApi.IOperation.path API operation path}.",
|
|
475
|
+
type: "string"
|
|
476
|
+
},
|
|
477
|
+
description: {
|
|
478
|
+
title: "Description about the path parameter",
|
|
479
|
+
description: "Description about the path parameter.\n\nMake short, concise and clear description about the path parameter.\n\n> MUST be written in English. Never use other languages.",
|
|
480
|
+
type: "string"
|
|
481
|
+
},
|
|
482
|
+
schema: {
|
|
483
|
+
title: "Type schema of the path parameter",
|
|
484
|
+
description: "Type schema of the path parameter.\n\nPath parameters are typically primitive types like\n{@link AutoBeOpenApi.IJsonSchema.IString strings},\n{@link AutoBeOpenApi.IJsonSchema.IInteger integers},\n{@link AutoBeOpenApi.IJsonSchema.INumber numbers}.\n\nIf you need other types, please use request body instead with object type\nencapsulation.",
|
|
485
|
+
oneOf: [
|
|
486
|
+
{
|
|
487
|
+
type: "object",
|
|
488
|
+
properties: {
|
|
489
|
+
minimum: {
|
|
490
|
+
title: "Minimum value restriction",
|
|
491
|
+
description: "Minimum value restriction.",
|
|
492
|
+
type: "number"
|
|
493
|
+
},
|
|
494
|
+
maximum: {
|
|
495
|
+
title: "Maximum value restriction",
|
|
496
|
+
description: "Maximum value restriction.",
|
|
497
|
+
type: "number"
|
|
498
|
+
},
|
|
499
|
+
exclusiveMinimum: {
|
|
500
|
+
title: "Exclusive minimum value restriction",
|
|
501
|
+
description: "Exclusive minimum value restriction.",
|
|
502
|
+
type: "number"
|
|
503
|
+
},
|
|
504
|
+
exclusiveMaximum: {
|
|
505
|
+
title: "Exclusive maximum value restriction",
|
|
506
|
+
description: "Exclusive maximum value restriction.",
|
|
507
|
+
type: "number"
|
|
508
|
+
},
|
|
509
|
+
multipleOf: {
|
|
510
|
+
title: "Multiple of value restriction",
|
|
511
|
+
description: "Multiple of value restriction.",
|
|
512
|
+
type: "number",
|
|
513
|
+
exclusiveMinimum: 0
|
|
514
|
+
},
|
|
515
|
+
type: {
|
|
516
|
+
title: "Discriminator value of the type",
|
|
517
|
+
description: "Discriminator value of the type.",
|
|
518
|
+
"const": "number"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
required: [
|
|
522
|
+
"type"
|
|
523
|
+
],
|
|
524
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.INumber} type:\n\n> Number (double) type info."
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
type: "object",
|
|
528
|
+
properties: {
|
|
529
|
+
minimum: {
|
|
530
|
+
title: "Minimum value restriction",
|
|
531
|
+
description: "Minimum value restriction.",
|
|
532
|
+
type: "integer"
|
|
533
|
+
},
|
|
534
|
+
maximum: {
|
|
535
|
+
title: "Maximum value restriction",
|
|
536
|
+
description: "Maximum value restriction.",
|
|
537
|
+
type: "integer"
|
|
538
|
+
},
|
|
539
|
+
exclusiveMinimum: {
|
|
540
|
+
title: "Exclusive minimum value restriction",
|
|
541
|
+
description: "Exclusive minimum value restriction.",
|
|
542
|
+
type: "number"
|
|
543
|
+
},
|
|
544
|
+
exclusiveMaximum: {
|
|
545
|
+
title: "Exclusive maximum value restriction",
|
|
546
|
+
description: "Exclusive maximum value restriction.",
|
|
547
|
+
type: "number"
|
|
548
|
+
},
|
|
549
|
+
multipleOf: {
|
|
550
|
+
title: "Multiple of value restriction",
|
|
551
|
+
description: "Multiple of value restriction.",
|
|
552
|
+
type: "integer",
|
|
553
|
+
exclusiveMinimum: 0
|
|
554
|
+
},
|
|
555
|
+
type: {
|
|
556
|
+
title: "Discriminator value of the type",
|
|
557
|
+
description: "Discriminator value of the type.",
|
|
558
|
+
"const": "integer"
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
required: [
|
|
562
|
+
"type"
|
|
563
|
+
],
|
|
564
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.IInteger} type:\n\n> Integer type info."
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
type: "object",
|
|
568
|
+
properties: {
|
|
569
|
+
format: {
|
|
570
|
+
title: "Format restriction",
|
|
571
|
+
description: "Format restriction.",
|
|
572
|
+
type: "string"
|
|
573
|
+
},
|
|
574
|
+
pattern: {
|
|
575
|
+
title: "Pattern restriction",
|
|
576
|
+
description: "Pattern restriction.",
|
|
577
|
+
type: "string"
|
|
578
|
+
},
|
|
579
|
+
contentMediaType: {
|
|
580
|
+
title: "Content media type restriction",
|
|
581
|
+
description: "Content media type restriction.",
|
|
582
|
+
type: "string"
|
|
583
|
+
},
|
|
584
|
+
minLength: {
|
|
585
|
+
title: "Minimum length restriction",
|
|
586
|
+
description: "Minimum length restriction.",
|
|
587
|
+
type: "integer",
|
|
588
|
+
minimum: 0
|
|
589
|
+
},
|
|
590
|
+
maxLength: {
|
|
591
|
+
title: "Maximum length restriction",
|
|
592
|
+
description: "Maximum length restriction.",
|
|
593
|
+
type: "integer",
|
|
594
|
+
minimum: 0
|
|
595
|
+
},
|
|
596
|
+
type: {
|
|
597
|
+
title: "Discriminator value of the type",
|
|
598
|
+
description: "Discriminator value of the type.",
|
|
599
|
+
"const": "string"
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
required: [
|
|
603
|
+
"type"
|
|
604
|
+
],
|
|
605
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.IString} type:\n\n> String type info."
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
required: [
|
|
611
|
+
"name",
|
|
612
|
+
"description",
|
|
613
|
+
"schema"
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
requestBody: {
|
|
618
|
+
title: "Request body of the API operation",
|
|
619
|
+
description: "Request body of the API operation.\n\nDefines the payload structure for the request. Contains a description and\nschema reference to define the expected input data.\n\nShould be `null` for operations that don't require a request body, such\nas most \"get\" operations.",
|
|
620
|
+
oneOf: [
|
|
621
|
+
{
|
|
622
|
+
type: "null"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
type: "object",
|
|
626
|
+
properties: {
|
|
627
|
+
description: {
|
|
628
|
+
title: "Description about the request body",
|
|
629
|
+
description: "Description about the request body.\n\nMake short, concise and clear description about the request body.\n\n> MUST be written in English. Never use other languages.",
|
|
630
|
+
type: "string"
|
|
631
|
+
},
|
|
632
|
+
typeName: {
|
|
633
|
+
title: "Request body type name",
|
|
634
|
+
description: "Request body type name.\n\nThis specifies the data structure expected in the request body, that will\nbe transformed to {@link AutoBeOpenApi.IJsonSchema.IReference reference}\ntype in the {@link AutoBeOpenApi.IComponents.schemas components section}\nas an {@link AutoBeOpenApi.IJsonSchema.Object object} type.\n\nHere is the naming convention for the request body type:\n\n- `IEntityName.ICreate`: Request body for creation operations (POST)\n- `IEntityName.IUpdate`: Request body for update operations (PUT)\n- `IEntityName.IRequest`: Request parameters for list operations (often\n with search/pagination)\n\nWhat you write:\n\n```json\n{\n \"typeName\": \"IShoppingOrder.ICreate\"\n}\n```\n\nTransformed to:\n\n```json\n{\n \"schema\": {\n \"$ref\": \"#/components/schemas/IShoppingOrder.ICreate\"\n }\n}\n```",
|
|
635
|
+
type: "string"
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
required: [
|
|
639
|
+
"description",
|
|
640
|
+
"typeName"
|
|
641
|
+
],
|
|
642
|
+
description: "Description of the current {@link AutoBeOpenApi.IRequestBody} type:\n\n> Request body information of OpenAPI operation.\n> \n> This interface defines the structure for request bodies in API routes. It\n> corresponds to the requestBody section in OpenAPI specifications, providing\n> both a description and schema reference for the request payload.\n> \n> The content-type for all request bodies is always `application/json`. Even\n> when file uploading is required, don't use `multipart/form-data` or\n> `application/x-www-form-urlencoded` content types. Instead, just define an\n> URI string property in the request body schema.\n> \n> Note that, all body schemas must be transformable to a\n> {@link AutoBeOpenApi.IJsonSchema.IReference reference} type defined in the\n> {@link AutoBeOpenApi.IComponents.schemas components section} as an\n> {@link AutoBeOpenApi.IJsonSchema.IObject object} type.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"requestBody\": {\n> \"description\": \"Creation info of the order\",\n> \"content\": {\n> \"application/json\": {\n> \"schema\": {\n> \"$ref\": \"#/components/schemas/IShoppingOrder.ICreate\"\n> }\n> }\n> }\n> }\n> }\n> ```"
|
|
643
|
+
}
|
|
644
|
+
]
|
|
645
|
+
},
|
|
646
|
+
responseBody: {
|
|
647
|
+
title: "Response body of the API operation",
|
|
648
|
+
description: "Response body of the API operation.\n\nDefines the structure of the successful response data. Contains a\ndescription and schema reference for the returned data.\n\nShould be null for operations that don't return any data.",
|
|
649
|
+
oneOf: [
|
|
650
|
+
{
|
|
651
|
+
type: "null"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
type: "object",
|
|
655
|
+
properties: {
|
|
656
|
+
description: {
|
|
657
|
+
title: "Description about the response body",
|
|
658
|
+
description: "Description about the response body.\n\nMake short, concise and clear description about the response body.\n\n> MUST be written in English. Never use other languages.",
|
|
659
|
+
type: "string"
|
|
660
|
+
},
|
|
661
|
+
typeName: {
|
|
662
|
+
title: "Response body's data type",
|
|
663
|
+
description: "Response body's data type.\n\nSpecifies the structure of the returned data (response body), that will\nbe transformed to {@link AutoBeOpenApi.IJsonSchema.IReference} type in the\n{@link AutoBeOpenApi.IComponents.schemas components section} as an\n{@link AutoBeOpenApi.IJsonSchema.IObject object} type.\n\nHere is the naming convention for the response body type:\n\n- `IEntityName`: Main entity with detailed information (e.g.,\n `IShoppingSale`)\n- `IEntityName.ISummary`: Simplified response version with essential\n properties\n- `IEntityName.IInvert`: Alternative view of an entity from a different\n perspective\n- `IPageIEntityName`: Paginated results container with `pagination` and\n `data` properties\n\nWhat you write:\n\n```json\n{\n \"typeName\": \"IShoppingOrder\"\n}\n```\n\nTransformed to:\n\n```json\n{\n \"schema\": {\n \"$ref\": \"#/components/schemas/IShoppingOrder\"\n }\n}\n```",
|
|
664
|
+
type: "string"
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
required: [
|
|
668
|
+
"description",
|
|
669
|
+
"typeName"
|
|
670
|
+
],
|
|
671
|
+
description: "Description of the current {@link AutoBeOpenApi.IResponseBody} type:\n\n> Response body information for OpenAPI operation.\n> \n> This interface defines the structure of a successful response from an API\n> operation. It provides a description of the response and a schema reference\n> to define the returned data structure.\n> \n> The content-type for all responses is always `application/json`. Even when\n> file downloading is required, don't use `application/octet-stream` or\n> `multipart/form-data` content types. Instead, just define an URI string\n> property in the response body schema.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"responses\": {\n> \"200\": {\n> \"description\": \"Order information\",\n> \"content\": {\n> \"application/json\": {\n> \"schema\": { \"$ref\": \"#/components/schemas/IShoppingOrder\" }\n> }\n> }\n> }\n> }\n> }\n> ```"
|
|
672
|
+
}
|
|
673
|
+
]
|
|
674
|
+
},
|
|
675
|
+
path: {
|
|
676
|
+
title: "HTTP path of the API operation",
|
|
677
|
+
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.",
|
|
678
|
+
type: "string"
|
|
679
|
+
},
|
|
680
|
+
method: {
|
|
681
|
+
title: "HTTP method of the API operation",
|
|
682
|
+
description: "HTTP method of the API operation.\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",
|
|
683
|
+
oneOf: [
|
|
684
|
+
{
|
|
685
|
+
"const": "get"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"const": "post"
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"const": "put"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"const": "delete"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"const": "patch"
|
|
698
|
+
}
|
|
699
|
+
]
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
required: [
|
|
703
|
+
"specification",
|
|
704
|
+
"description",
|
|
705
|
+
"summary",
|
|
706
|
+
"parameters",
|
|
707
|
+
"requestBody",
|
|
708
|
+
"responseBody",
|
|
709
|
+
"path",
|
|
710
|
+
"method"
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
required: [
|
|
716
|
+
"operations"
|
|
717
|
+
],
|
|
718
|
+
additionalProperties: false,
|
|
719
|
+
$defs: {}
|
|
720
|
+
},
|
|
721
|
+
description: "Generate detailed API operations from path/method combinations.\n\nThis function creates complete API operations following REST principles and\nquality standards. Each generated operation includes specification, path,\nmethod, detailed multi-paragraph description, concise summary, parameters,\nand appropriate request/response bodies.\n\nThe function processes as many operations as possible in a single call,\nwith progress tracking to ensure iterative completion of all required\nendpoints.",
|
|
722
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.specification && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(input.responseBody)) && "string" === typeof input.path && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io2 = input => "string" === typeof input.name && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io3 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io5 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
723
|
+
if ("number" === input.type)
|
|
724
|
+
return _io4(input);
|
|
725
|
+
else if ("integer" === input.type)
|
|
726
|
+
return _io3(input);
|
|
727
|
+
else if ("string" === input.type)
|
|
728
|
+
return _io5(input);
|
|
729
|
+
else
|
|
730
|
+
return false;
|
|
731
|
+
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
732
|
+
path: _path + ".operations",
|
|
733
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
734
|
+
value: input.operations
|
|
735
|
+
})) && input.operations.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
736
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
737
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
738
|
+
value: elem
|
|
739
|
+
})) && _vo1(elem, _path + ".operations[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
740
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
741
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
742
|
+
value: elem
|
|
743
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
744
|
+
path: _path + ".operations",
|
|
745
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
746
|
+
value: input.operations
|
|
747
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.specification || _report(_exceptionable, {
|
|
748
|
+
path: _path + ".specification",
|
|
749
|
+
expected: "string",
|
|
750
|
+
value: input.specification
|
|
751
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
752
|
+
path: _path + ".description",
|
|
753
|
+
expected: "string",
|
|
754
|
+
value: input.description
|
|
755
|
+
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
756
|
+
path: _path + ".summary",
|
|
757
|
+
expected: "string",
|
|
758
|
+
value: input.summary
|
|
759
|
+
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
760
|
+
path: _path + ".parameters",
|
|
761
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
762
|
+
value: input.parameters
|
|
763
|
+
})) && input.parameters.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
764
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
765
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
766
|
+
value: elem
|
|
767
|
+
})) && _vo2(elem, _path + ".parameters[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
768
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
769
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
770
|
+
value: elem
|
|
771
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
772
|
+
path: _path + ".parameters",
|
|
773
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
774
|
+
value: input.parameters
|
|
775
|
+
}), null === input.requestBody || ("object" === typeof input.requestBody && null !== input.requestBody || _report(_exceptionable, {
|
|
776
|
+
path: _path + ".requestBody",
|
|
777
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
778
|
+
value: input.requestBody
|
|
779
|
+
})) && _vo6(input.requestBody, _path + ".requestBody", true && _exceptionable) || _report(_exceptionable, {
|
|
780
|
+
path: _path + ".requestBody",
|
|
781
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
782
|
+
value: input.requestBody
|
|
783
|
+
}), null === input.responseBody || ("object" === typeof input.responseBody && null !== input.responseBody || _report(_exceptionable, {
|
|
784
|
+
path: _path + ".responseBody",
|
|
785
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
786
|
+
value: input.responseBody
|
|
787
|
+
})) && _vo7(input.responseBody, _path + ".responseBody", true && _exceptionable) || _report(_exceptionable, {
|
|
788
|
+
path: _path + ".responseBody",
|
|
789
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
790
|
+
value: input.responseBody
|
|
791
|
+
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
792
|
+
path: _path + ".path",
|
|
793
|
+
expected: "string",
|
|
794
|
+
value: input.path
|
|
795
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
796
|
+
path: _path + ".method",
|
|
797
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
798
|
+
value: input.method
|
|
799
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
800
|
+
path: _path + ".name",
|
|
801
|
+
expected: "string",
|
|
802
|
+
value: input.name
|
|
803
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
804
|
+
path: _path + ".description",
|
|
805
|
+
expected: "string",
|
|
806
|
+
value: input.description
|
|
807
|
+
}), ("object" === typeof input.schema && null !== input.schema || _report(_exceptionable, {
|
|
808
|
+
path: _path + ".schema",
|
|
809
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
810
|
+
value: input.schema
|
|
811
|
+
})) && _vu0(input.schema, _path + ".schema", true && _exceptionable) || _report(_exceptionable, {
|
|
812
|
+
path: _path + ".schema",
|
|
813
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
814
|
+
value: input.schema
|
|
815
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000 || _report(_exceptionable, {
|
|
816
|
+
path: _path + ".minimum",
|
|
817
|
+
expected: "number & Type<\"int64\">",
|
|
818
|
+
value: input.minimum
|
|
819
|
+
})) || _report(_exceptionable, {
|
|
820
|
+
path: _path + ".minimum",
|
|
821
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
822
|
+
value: input.minimum
|
|
823
|
+
}), undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000 || _report(_exceptionable, {
|
|
824
|
+
path: _path + ".maximum",
|
|
825
|
+
expected: "number & Type<\"int64\">",
|
|
826
|
+
value: input.maximum
|
|
827
|
+
})) || _report(_exceptionable, {
|
|
828
|
+
path: _path + ".maximum",
|
|
829
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
830
|
+
value: input.maximum
|
|
831
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
832
|
+
path: _path + ".exclusiveMinimum",
|
|
833
|
+
expected: "(number | undefined)",
|
|
834
|
+
value: input.exclusiveMinimum
|
|
835
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
836
|
+
path: _path + ".exclusiveMaximum",
|
|
837
|
+
expected: "(number | undefined)",
|
|
838
|
+
value: input.exclusiveMaximum
|
|
839
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 || _report(_exceptionable, {
|
|
840
|
+
path: _path + ".multipleOf",
|
|
841
|
+
expected: "number & Type<\"uint64\">",
|
|
842
|
+
value: input.multipleOf
|
|
843
|
+
})) && (0 < input.multipleOf || _report(_exceptionable, {
|
|
844
|
+
path: _path + ".multipleOf",
|
|
845
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
846
|
+
value: input.multipleOf
|
|
847
|
+
})) || _report(_exceptionable, {
|
|
848
|
+
path: _path + ".multipleOf",
|
|
849
|
+
expected: "((number & Type<\"uint64\"> & ExclusiveMinimum<0>) | undefined)",
|
|
850
|
+
value: input.multipleOf
|
|
851
|
+
}), "integer" === input.type || _report(_exceptionable, {
|
|
852
|
+
path: _path + ".type",
|
|
853
|
+
expected: "\"integer\"",
|
|
854
|
+
value: input.type
|
|
855
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum || _report(_exceptionable, {
|
|
856
|
+
path: _path + ".minimum",
|
|
857
|
+
expected: "(number | undefined)",
|
|
858
|
+
value: input.minimum
|
|
859
|
+
}), undefined === input.maximum || "number" === typeof input.maximum || _report(_exceptionable, {
|
|
860
|
+
path: _path + ".maximum",
|
|
861
|
+
expected: "(number | undefined)",
|
|
862
|
+
value: input.maximum
|
|
863
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
864
|
+
path: _path + ".exclusiveMinimum",
|
|
865
|
+
expected: "(number | undefined)",
|
|
866
|
+
value: input.exclusiveMinimum
|
|
867
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
868
|
+
path: _path + ".exclusiveMaximum",
|
|
869
|
+
expected: "(number | undefined)",
|
|
870
|
+
value: input.exclusiveMaximum
|
|
871
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (0 < input.multipleOf || _report(_exceptionable, {
|
|
872
|
+
path: _path + ".multipleOf",
|
|
873
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
874
|
+
value: input.multipleOf
|
|
875
|
+
})) || _report(_exceptionable, {
|
|
876
|
+
path: _path + ".multipleOf",
|
|
877
|
+
expected: "((number & ExclusiveMinimum<0>) | undefined)",
|
|
878
|
+
value: input.multipleOf
|
|
879
|
+
}), "number" === input.type || _report(_exceptionable, {
|
|
880
|
+
path: _path + ".type",
|
|
881
|
+
expected: "\"number\"",
|
|
882
|
+
value: input.type
|
|
883
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => [undefined === input.format || "string" === typeof input.format || _report(_exceptionable, {
|
|
884
|
+
path: _path + ".format",
|
|
885
|
+
expected: "(string | undefined)",
|
|
886
|
+
value: input.format
|
|
887
|
+
}), undefined === input.pattern || "string" === typeof input.pattern || _report(_exceptionable, {
|
|
888
|
+
path: _path + ".pattern",
|
|
889
|
+
expected: "(string | undefined)",
|
|
890
|
+
value: input.pattern
|
|
891
|
+
}), undefined === input.contentMediaType || "string" === typeof input.contentMediaType || _report(_exceptionable, {
|
|
892
|
+
path: _path + ".contentMediaType",
|
|
893
|
+
expected: "(string | undefined)",
|
|
894
|
+
value: input.contentMediaType
|
|
895
|
+
}), undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
896
|
+
path: _path + ".minLength",
|
|
897
|
+
expected: "number & Type<\"uint64\">",
|
|
898
|
+
value: input.minLength
|
|
899
|
+
})) || _report(_exceptionable, {
|
|
900
|
+
path: _path + ".minLength",
|
|
901
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
902
|
+
value: input.minLength
|
|
903
|
+
}), undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
904
|
+
path: _path + ".maxLength",
|
|
905
|
+
expected: "number & Type<\"uint64\">",
|
|
906
|
+
value: input.maxLength
|
|
907
|
+
})) || _report(_exceptionable, {
|
|
908
|
+
path: _path + ".maxLength",
|
|
909
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
910
|
+
value: input.maxLength
|
|
911
|
+
}), "string" === input.type || _report(_exceptionable, {
|
|
912
|
+
path: _path + ".type",
|
|
913
|
+
expected: "\"string\"",
|
|
914
|
+
value: input.type
|
|
915
|
+
})].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
916
|
+
path: _path + ".description",
|
|
917
|
+
expected: "string",
|
|
918
|
+
value: input.description
|
|
919
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
920
|
+
path: _path + ".typeName",
|
|
921
|
+
expected: "string",
|
|
922
|
+
value: input.typeName
|
|
923
|
+
})].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
924
|
+
path: _path + ".description",
|
|
925
|
+
expected: "string",
|
|
926
|
+
value: input.description
|
|
927
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
928
|
+
path: _path + ".typeName",
|
|
929
|
+
expected: "string",
|
|
930
|
+
value: input.typeName
|
|
931
|
+
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
932
|
+
if ("number" === input.type)
|
|
933
|
+
return _vo4(input, _path, true && _exceptionable);
|
|
934
|
+
else if ("integer" === input.type)
|
|
935
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
936
|
+
else if ("string" === input.type)
|
|
937
|
+
return _vo5(input, _path, true && _exceptionable);
|
|
938
|
+
else
|
|
939
|
+
return _report(_exceptionable, {
|
|
940
|
+
path: _path,
|
|
941
|
+
expected: "(AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.IString)",
|
|
942
|
+
value: input
|
|
943
|
+
});
|
|
944
|
+
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
945
|
+
if (false === __is(input)) {
|
|
946
|
+
errors = [];
|
|
947
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
948
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
949
|
+
path: _path + "",
|
|
950
|
+
expected: "IMakeOperationProps",
|
|
951
|
+
value: input
|
|
952
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
953
|
+
path: _path + "",
|
|
954
|
+
expected: "IMakeOperationProps",
|
|
955
|
+
value: input
|
|
956
|
+
}))(input, "$input", true);
|
|
957
|
+
const success = 0 === errors.length;
|
|
958
|
+
return success ? {
|
|
959
|
+
success,
|
|
960
|
+
data: input
|
|
961
|
+
} : {
|
|
962
|
+
success,
|
|
963
|
+
errors,
|
|
964
|
+
data: input
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
return {
|
|
968
|
+
success: true,
|
|
969
|
+
data: input
|
|
970
|
+
};
|
|
971
|
+
}; })()
|
|
972
|
+
}
|
|
973
|
+
]
|
|
974
|
+
};
|
|
975
|
+
const collection = {
|
|
976
|
+
chatgpt: {
|
|
977
|
+
model: "chatgpt",
|
|
978
|
+
options: {
|
|
979
|
+
reference: true,
|
|
980
|
+
strict: false,
|
|
981
|
+
separate: null
|
|
982
|
+
},
|
|
983
|
+
functions: [
|
|
984
|
+
{
|
|
985
|
+
name: "makeOperations",
|
|
986
|
+
parameters: {
|
|
987
|
+
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeOperationProps}",
|
|
988
|
+
type: "object",
|
|
989
|
+
properties: {
|
|
990
|
+
operations: {
|
|
991
|
+
title: "Array of API operations to generate",
|
|
992
|
+
description: "Array of API operations to generate.\n\nEach operation in this array must include:\n\n- Specification: Detailed API specification with clear purpose and\n functionality\n- Path: Resource-centric URL path (e.g., \"/resources/{resourceId}\")\n- Method: HTTP method (get, post, put, delete, patch)\n- Description: Extremely detailed multi-paragraph description referencing\n Prisma schema comments\n- Summary: Concise one-sentence summary of the endpoint\n- Parameters: Array of all necessary parameters with descriptions and schema\n definitions\n- RequestBody: For POST/PUT/PATCH methods, with typeName referencing\n components.schemas\n- ResponseBody: With typeName referencing appropriate response type\n\nAll operations must follow strict quality standards:\n\n1. Detailed descriptions referencing Prisma schema comments\n2. Accurate parameter definitions matching path parameters\n3. Appropriate request/response body type references\n4. Consistent patterns for CRUD operations\n\nFor list retrievals (typically PATCH), include pagination, search, and\nsorting. For detail retrieval (GET), return a single resource. For creation\n(POST), use .ICreate request body. For modification (PUT), use .IUpdate\nrequest body.",
|
|
993
|
+
type: "array",
|
|
994
|
+
items: {
|
|
995
|
+
description: "Description of the current {@link AutoBeOpenApi.IOperation} type:\n\n> Operation of the Restful API.\n> \n> This interface defines a single API endpoint with its HTTP {@link method},\n> {@link path}, {@link parameters path parameters},\n> {@link requestBody request body}, and {@link responseBody} structure. It\n> corresponds to an individual operation in the paths section of an OpenAPI\n> document.\n> \n> Each operation requires a detailed explanation of its purpose through the\n> reason and description fields, making it clear why the API was designed and\n> how it should be used.\n> \n> All request bodies and responses for this operation must be object types\n> and must reference named types defined in the components section. The\n> content-type is always `application/json`. For file upload/download\n> operations, use `string & tags.Format<\"uri\">` in the appropriate schema\n> instead of binary data formats.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"/shoppings/customers/orders\": {\n> \"post\": {\n> \"description\": \"Create a new order application from shopping cart...\",\n> \"parameters\": [...],\n> \"requestBody\": {...},\n> \"responses\": {...}\n> }\n> }\n> }\n> ```",
|
|
996
|
+
type: "object",
|
|
997
|
+
properties: {
|
|
998
|
+
specification: {
|
|
999
|
+
title: "Specification of the API operation",
|
|
1000
|
+
description: "Specification of the API operation.\n\nBefore defining the API operation interface, please describe what you're\nplanning to write in this `specification` field.\n\nThe specification must be fully detailed and clear, so that anyone can\nunderstand the purpose and functionality of the API operation and its\nrelated components (e.g., {@link path}, {@link parameters},\n{@link requestBody}).\n\nIMPORTANT: The specification MUST identify which Prisma DB table this\noperation is associated with, helping ensure complete coverage of all\ndatabase entities.",
|
|
1001
|
+
type: "string"
|
|
1002
|
+
},
|
|
1003
|
+
description: {
|
|
1004
|
+
title: "Detailed description about the API operation",
|
|
1005
|
+
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n> MUST be written in English. Never use other languages.",
|
|
1006
|
+
type: "string"
|
|
1007
|
+
},
|
|
1008
|
+
summary: {
|
|
1009
|
+
title: "Short summary of the API operation",
|
|
1010
|
+
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n> MUST be written in English. Never use other languages",
|
|
1011
|
+
type: "string"
|
|
1012
|
+
},
|
|
1013
|
+
parameters: {
|
|
1014
|
+
title: "List of path parameters",
|
|
1015
|
+
description: "List of path parameters.\n\nNote that, the {@link AutoBeOpenApi.IParameter.name identifier name} of\npath parameter must be corresponded to the\n{@link path API operation path}.\n\nFor example, if there's an API operation which has {@link path} of\n`/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}`,\nits list of {@link AutoBeOpenApi.IParameter.name path parameters} must be\nlike:\n\n- `saleId`\n- `questionId`\n- `commentId`",
|
|
1016
|
+
type: "array",
|
|
1017
|
+
items: {
|
|
1018
|
+
description: "Description of the current {@link AutoBeOpenApi.IParameter} type:\n\n> Path parameter information for API routes.\n> \n> This interface defines a path parameter that appears in the URL of an API\n> endpoint. Path parameters are enclosed in curly braces in the\n> {@link AutoBeOpenApi.IOperation.path operation path} and must be defined\n> with their types and descriptions.\n> \n> For example, if API operation path is\n> `/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}`,\n> the path parameters should be like below:\n> \n> ```json\n> {\n> \"path\": \"/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}\",\n> \"method\": \"get\",\n> \"parameters\": [\n> {\n> \"name\": \"saleId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target sale's ID\"\n> },\n> {\n> \"name\": \"questionId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target question's ID\"\n> },\n> {\n> \"name\": \"commentId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target comment's ID\"\n> }\n> ]\n> }\n> ```",
|
|
1019
|
+
type: "object",
|
|
1020
|
+
properties: {
|
|
1021
|
+
name: {
|
|
1022
|
+
title: "Identifier name of the path parameter",
|
|
1023
|
+
description: "Identifier name of the path parameter.\n\nThis name must match exactly with the parameter name in the route path.\nIt must be corresponded to the\n{@link AutoBeOpenApi.IOperation.path API operation path}.",
|
|
1024
|
+
type: "string"
|
|
1025
|
+
},
|
|
1026
|
+
description: {
|
|
1027
|
+
title: "Description about the path parameter",
|
|
1028
|
+
description: "Description about the path parameter.\n\nMake short, concise and clear description about the path parameter.\n\n> MUST be written in English. Never use other languages.",
|
|
1029
|
+
type: "string"
|
|
1030
|
+
},
|
|
1031
|
+
schema: {
|
|
1032
|
+
title: "Type schema of the path parameter",
|
|
1033
|
+
description: "Type schema of the path parameter.\n\nPath parameters are typically primitive types like\n{@link AutoBeOpenApi.IJsonSchema.IString strings},\n{@link AutoBeOpenApi.IJsonSchema.IInteger integers},\n{@link AutoBeOpenApi.IJsonSchema.INumber numbers}.\n\nIf you need other types, please use request body instead with object type\nencapsulation.",
|
|
1034
|
+
anyOf: [
|
|
1035
|
+
{
|
|
1036
|
+
type: "object",
|
|
1037
|
+
properties: {
|
|
1038
|
+
minimum: {
|
|
1039
|
+
title: "Minimum value restriction",
|
|
1040
|
+
description: "Minimum value restriction.",
|
|
1041
|
+
type: "number"
|
|
1042
|
+
},
|
|
1043
|
+
maximum: {
|
|
1044
|
+
title: "Maximum value restriction",
|
|
1045
|
+
description: "Maximum value restriction.",
|
|
1046
|
+
type: "number"
|
|
1047
|
+
},
|
|
1048
|
+
exclusiveMinimum: {
|
|
1049
|
+
title: "Exclusive minimum value restriction",
|
|
1050
|
+
description: "Exclusive minimum value restriction.",
|
|
1051
|
+
type: "number"
|
|
1052
|
+
},
|
|
1053
|
+
exclusiveMaximum: {
|
|
1054
|
+
title: "Exclusive maximum value restriction",
|
|
1055
|
+
description: "Exclusive maximum value restriction.",
|
|
1056
|
+
type: "number"
|
|
1057
|
+
},
|
|
1058
|
+
multipleOf: {
|
|
1059
|
+
title: "Multiple of value restriction",
|
|
1060
|
+
description: "Multiple of value restriction.\n\n\n@exclusiveMinimum 0",
|
|
1061
|
+
type: "number"
|
|
1062
|
+
},
|
|
1063
|
+
type: {
|
|
1064
|
+
title: "Discriminator value of the type",
|
|
1065
|
+
description: "Discriminator value of the type.",
|
|
1066
|
+
type: "string",
|
|
1067
|
+
"enum": [
|
|
1068
|
+
"number"
|
|
1069
|
+
]
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
required: [
|
|
1073
|
+
"type"
|
|
1074
|
+
],
|
|
1075
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.INumber} type:\n\n> Number (double) type info."
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
type: "object",
|
|
1079
|
+
properties: {
|
|
1080
|
+
minimum: {
|
|
1081
|
+
title: "Minimum value restriction",
|
|
1082
|
+
description: "Minimum value restriction.",
|
|
1083
|
+
type: "integer"
|
|
1084
|
+
},
|
|
1085
|
+
maximum: {
|
|
1086
|
+
title: "Maximum value restriction",
|
|
1087
|
+
description: "Maximum value restriction.",
|
|
1088
|
+
type: "integer"
|
|
1089
|
+
},
|
|
1090
|
+
exclusiveMinimum: {
|
|
1091
|
+
title: "Exclusive minimum value restriction",
|
|
1092
|
+
description: "Exclusive minimum value restriction.",
|
|
1093
|
+
type: "number"
|
|
1094
|
+
},
|
|
1095
|
+
exclusiveMaximum: {
|
|
1096
|
+
title: "Exclusive maximum value restriction",
|
|
1097
|
+
description: "Exclusive maximum value restriction.",
|
|
1098
|
+
type: "number"
|
|
1099
|
+
},
|
|
1100
|
+
multipleOf: {
|
|
1101
|
+
title: "Multiple of value restriction",
|
|
1102
|
+
description: "Multiple of value restriction.\n\n\n@exclusiveMinimum 0",
|
|
1103
|
+
type: "integer"
|
|
1104
|
+
},
|
|
1105
|
+
type: {
|
|
1106
|
+
title: "Discriminator value of the type",
|
|
1107
|
+
description: "Discriminator value of the type.",
|
|
1108
|
+
type: "string",
|
|
1109
|
+
"enum": [
|
|
1110
|
+
"integer"
|
|
1111
|
+
]
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
required: [
|
|
1115
|
+
"type"
|
|
1116
|
+
],
|
|
1117
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.IInteger} type:\n\n> Integer type info."
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
type: "object",
|
|
1121
|
+
properties: {
|
|
1122
|
+
format: {
|
|
1123
|
+
title: "Format restriction",
|
|
1124
|
+
description: "Format restriction.",
|
|
1125
|
+
type: "string"
|
|
1126
|
+
},
|
|
1127
|
+
pattern: {
|
|
1128
|
+
title: "Pattern restriction",
|
|
1129
|
+
description: "Pattern restriction.",
|
|
1130
|
+
type: "string"
|
|
1131
|
+
},
|
|
1132
|
+
contentMediaType: {
|
|
1133
|
+
title: "Content media type restriction",
|
|
1134
|
+
description: "Content media type restriction.",
|
|
1135
|
+
type: "string"
|
|
1136
|
+
},
|
|
1137
|
+
minLength: {
|
|
1138
|
+
title: "Minimum length restriction",
|
|
1139
|
+
description: "Minimum length restriction.\n\n\n@minimum 0",
|
|
1140
|
+
type: "integer"
|
|
1141
|
+
},
|
|
1142
|
+
maxLength: {
|
|
1143
|
+
title: "Maximum length restriction",
|
|
1144
|
+
description: "Maximum length restriction.\n\n\n@minimum 0",
|
|
1145
|
+
type: "integer"
|
|
1146
|
+
},
|
|
1147
|
+
type: {
|
|
1148
|
+
title: "Discriminator value of the type",
|
|
1149
|
+
description: "Discriminator value of the type.",
|
|
1150
|
+
type: "string",
|
|
1151
|
+
"enum": [
|
|
1152
|
+
"string"
|
|
1153
|
+
]
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
required: [
|
|
1157
|
+
"type"
|
|
1158
|
+
],
|
|
1159
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.IString} type:\n\n> String type info."
|
|
1160
|
+
}
|
|
1161
|
+
]
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
required: [
|
|
1165
|
+
"name",
|
|
1166
|
+
"description",
|
|
1167
|
+
"schema"
|
|
1168
|
+
]
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
requestBody: {
|
|
1172
|
+
title: "Request body of the API operation",
|
|
1173
|
+
description: "Request body of the API operation.\n\nDefines the payload structure for the request. Contains a description and\nschema reference to define the expected input data.\n\nShould be `null` for operations that don't require a request body, such\nas most \"get\" operations.",
|
|
1174
|
+
anyOf: [
|
|
1175
|
+
{
|
|
1176
|
+
type: "null"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
type: "object",
|
|
1180
|
+
properties: {
|
|
1181
|
+
description: {
|
|
1182
|
+
title: "Description about the request body",
|
|
1183
|
+
description: "Description about the request body.\n\nMake short, concise and clear description about the request body.\n\n> MUST be written in English. Never use other languages.",
|
|
1184
|
+
type: "string"
|
|
1185
|
+
},
|
|
1186
|
+
typeName: {
|
|
1187
|
+
title: "Request body type name",
|
|
1188
|
+
description: "Request body type name.\n\nThis specifies the data structure expected in the request body, that will\nbe transformed to {@link AutoBeOpenApi.IJsonSchema.IReference reference}\ntype in the {@link AutoBeOpenApi.IComponents.schemas components section}\nas an {@link AutoBeOpenApi.IJsonSchema.Object object} type.\n\nHere is the naming convention for the request body type:\n\n- `IEntityName.ICreate`: Request body for creation operations (POST)\n- `IEntityName.IUpdate`: Request body for update operations (PUT)\n- `IEntityName.IRequest`: Request parameters for list operations (often\n with search/pagination)\n\nWhat you write:\n\n```json\n{\n \"typeName\": \"IShoppingOrder.ICreate\"\n}\n```\n\nTransformed to:\n\n```json\n{\n \"schema\": {\n \"$ref\": \"#/components/schemas/IShoppingOrder.ICreate\"\n }\n}\n```",
|
|
1189
|
+
type: "string"
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
required: [
|
|
1193
|
+
"description",
|
|
1194
|
+
"typeName"
|
|
1195
|
+
],
|
|
1196
|
+
description: "Description of the current {@link AutoBeOpenApi.IRequestBody} type:\n\n> Request body information of OpenAPI operation.\n> \n> This interface defines the structure for request bodies in API routes. It\n> corresponds to the requestBody section in OpenAPI specifications, providing\n> both a description and schema reference for the request payload.\n> \n> The content-type for all request bodies is always `application/json`. Even\n> when file uploading is required, don't use `multipart/form-data` or\n> `application/x-www-form-urlencoded` content types. Instead, just define an\n> URI string property in the request body schema.\n> \n> Note that, all body schemas must be transformable to a\n> {@link AutoBeOpenApi.IJsonSchema.IReference reference} type defined in the\n> {@link AutoBeOpenApi.IComponents.schemas components section} as an\n> {@link AutoBeOpenApi.IJsonSchema.IObject object} type.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"requestBody\": {\n> \"description\": \"Creation info of the order\",\n> \"content\": {\n> \"application/json\": {\n> \"schema\": {\n> \"$ref\": \"#/components/schemas/IShoppingOrder.ICreate\"\n> }\n> }\n> }\n> }\n> }\n> ```"
|
|
1197
|
+
}
|
|
1198
|
+
]
|
|
1199
|
+
},
|
|
1200
|
+
responseBody: {
|
|
1201
|
+
title: "Response body of the API operation",
|
|
1202
|
+
description: "Response body of the API operation.\n\nDefines the structure of the successful response data. Contains a\ndescription and schema reference for the returned data.\n\nShould be null for operations that don't return any data.",
|
|
1203
|
+
anyOf: [
|
|
1204
|
+
{
|
|
1205
|
+
type: "null"
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
type: "object",
|
|
1209
|
+
properties: {
|
|
1210
|
+
description: {
|
|
1211
|
+
title: "Description about the response body",
|
|
1212
|
+
description: "Description about the response body.\n\nMake short, concise and clear description about the response body.\n\n> MUST be written in English. Never use other languages.",
|
|
1213
|
+
type: "string"
|
|
1214
|
+
},
|
|
1215
|
+
typeName: {
|
|
1216
|
+
title: "Response body's data type",
|
|
1217
|
+
description: "Response body's data type.\n\nSpecifies the structure of the returned data (response body), that will\nbe transformed to {@link AutoBeOpenApi.IJsonSchema.IReference} type in the\n{@link AutoBeOpenApi.IComponents.schemas components section} as an\n{@link AutoBeOpenApi.IJsonSchema.IObject object} type.\n\nHere is the naming convention for the response body type:\n\n- `IEntityName`: Main entity with detailed information (e.g.,\n `IShoppingSale`)\n- `IEntityName.ISummary`: Simplified response version with essential\n properties\n- `IEntityName.IInvert`: Alternative view of an entity from a different\n perspective\n- `IPageIEntityName`: Paginated results container with `pagination` and\n `data` properties\n\nWhat you write:\n\n```json\n{\n \"typeName\": \"IShoppingOrder\"\n}\n```\n\nTransformed to:\n\n```json\n{\n \"schema\": {\n \"$ref\": \"#/components/schemas/IShoppingOrder\"\n }\n}\n```",
|
|
1218
|
+
type: "string"
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
required: [
|
|
1222
|
+
"description",
|
|
1223
|
+
"typeName"
|
|
1224
|
+
],
|
|
1225
|
+
description: "Description of the current {@link AutoBeOpenApi.IResponseBody} type:\n\n> Response body information for OpenAPI operation.\n> \n> This interface defines the structure of a successful response from an API\n> operation. It provides a description of the response and a schema reference\n> to define the returned data structure.\n> \n> The content-type for all responses is always `application/json`. Even when\n> file downloading is required, don't use `application/octet-stream` or\n> `multipart/form-data` content types. Instead, just define an URI string\n> property in the response body schema.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"responses\": {\n> \"200\": {\n> \"description\": \"Order information\",\n> \"content\": {\n> \"application/json\": {\n> \"schema\": { \"$ref\": \"#/components/schemas/IShoppingOrder\" }\n> }\n> }\n> }\n> }\n> }\n> ```"
|
|
1226
|
+
}
|
|
1227
|
+
]
|
|
1228
|
+
},
|
|
1229
|
+
path: {
|
|
1230
|
+
title: "HTTP path of the API operation",
|
|
1231
|
+
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.",
|
|
1232
|
+
type: "string"
|
|
1233
|
+
},
|
|
1234
|
+
method: {
|
|
1235
|
+
title: "HTTP method of the API operation",
|
|
1236
|
+
description: "HTTP method of the API operation.\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",
|
|
1237
|
+
type: "string",
|
|
1238
|
+
"enum": [
|
|
1239
|
+
"get",
|
|
1240
|
+
"post",
|
|
1241
|
+
"put",
|
|
1242
|
+
"delete",
|
|
1243
|
+
"patch"
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
required: [
|
|
1248
|
+
"specification",
|
|
1249
|
+
"description",
|
|
1250
|
+
"summary",
|
|
1251
|
+
"parameters",
|
|
1252
|
+
"requestBody",
|
|
1253
|
+
"responseBody",
|
|
1254
|
+
"path",
|
|
1255
|
+
"method"
|
|
1256
|
+
]
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
required: [
|
|
1261
|
+
"operations"
|
|
1262
|
+
],
|
|
1263
|
+
additionalProperties: false,
|
|
1264
|
+
$defs: {}
|
|
1265
|
+
},
|
|
1266
|
+
description: "Generate detailed API operations from path/method combinations.\n\nThis function creates complete API operations following REST principles and\nquality standards. Each generated operation includes specification, path,\nmethod, detailed multi-paragraph description, concise summary, parameters,\nand appropriate request/response bodies.\n\nThe function processes as many operations as possible in a single call,\nwith progress tracking to ensure iterative completion of all required\nendpoints.",
|
|
1267
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.specification && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(input.responseBody)) && "string" === typeof input.path && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io2 = input => "string" === typeof input.name && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io3 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io5 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
1268
|
+
if ("number" === input.type)
|
|
1269
|
+
return _io4(input);
|
|
1270
|
+
else if ("integer" === input.type)
|
|
1271
|
+
return _io3(input);
|
|
1272
|
+
else if ("string" === input.type)
|
|
1273
|
+
return _io5(input);
|
|
1274
|
+
else
|
|
1275
|
+
return false;
|
|
1276
|
+
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
1277
|
+
path: _path + ".operations",
|
|
1278
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
1279
|
+
value: input.operations
|
|
1280
|
+
})) && input.operations.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1281
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
1282
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
1283
|
+
value: elem
|
|
1284
|
+
})) && _vo1(elem, _path + ".operations[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1285
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
1286
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
1287
|
+
value: elem
|
|
1288
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1289
|
+
path: _path + ".operations",
|
|
1290
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
1291
|
+
value: input.operations
|
|
1292
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.specification || _report(_exceptionable, {
|
|
1293
|
+
path: _path + ".specification",
|
|
1294
|
+
expected: "string",
|
|
1295
|
+
value: input.specification
|
|
1296
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1297
|
+
path: _path + ".description",
|
|
1298
|
+
expected: "string",
|
|
1299
|
+
value: input.description
|
|
1300
|
+
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
1301
|
+
path: _path + ".summary",
|
|
1302
|
+
expected: "string",
|
|
1303
|
+
value: input.summary
|
|
1304
|
+
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
1305
|
+
path: _path + ".parameters",
|
|
1306
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1307
|
+
value: input.parameters
|
|
1308
|
+
})) && input.parameters.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1309
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
1310
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
1311
|
+
value: elem
|
|
1312
|
+
})) && _vo2(elem, _path + ".parameters[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1313
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
1314
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
1315
|
+
value: elem
|
|
1316
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1317
|
+
path: _path + ".parameters",
|
|
1318
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1319
|
+
value: input.parameters
|
|
1320
|
+
}), null === input.requestBody || ("object" === typeof input.requestBody && null !== input.requestBody || _report(_exceptionable, {
|
|
1321
|
+
path: _path + ".requestBody",
|
|
1322
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
1323
|
+
value: input.requestBody
|
|
1324
|
+
})) && _vo6(input.requestBody, _path + ".requestBody", true && _exceptionable) || _report(_exceptionable, {
|
|
1325
|
+
path: _path + ".requestBody",
|
|
1326
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
1327
|
+
value: input.requestBody
|
|
1328
|
+
}), null === input.responseBody || ("object" === typeof input.responseBody && null !== input.responseBody || _report(_exceptionable, {
|
|
1329
|
+
path: _path + ".responseBody",
|
|
1330
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
1331
|
+
value: input.responseBody
|
|
1332
|
+
})) && _vo7(input.responseBody, _path + ".responseBody", true && _exceptionable) || _report(_exceptionable, {
|
|
1333
|
+
path: _path + ".responseBody",
|
|
1334
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
1335
|
+
value: input.responseBody
|
|
1336
|
+
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
1337
|
+
path: _path + ".path",
|
|
1338
|
+
expected: "string",
|
|
1339
|
+
value: input.path
|
|
1340
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1341
|
+
path: _path + ".method",
|
|
1342
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
1343
|
+
value: input.method
|
|
1344
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
1345
|
+
path: _path + ".name",
|
|
1346
|
+
expected: "string",
|
|
1347
|
+
value: input.name
|
|
1348
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1349
|
+
path: _path + ".description",
|
|
1350
|
+
expected: "string",
|
|
1351
|
+
value: input.description
|
|
1352
|
+
}), ("object" === typeof input.schema && null !== input.schema || _report(_exceptionable, {
|
|
1353
|
+
path: _path + ".schema",
|
|
1354
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1355
|
+
value: input.schema
|
|
1356
|
+
})) && _vu0(input.schema, _path + ".schema", true && _exceptionable) || _report(_exceptionable, {
|
|
1357
|
+
path: _path + ".schema",
|
|
1358
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1359
|
+
value: input.schema
|
|
1360
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000 || _report(_exceptionable, {
|
|
1361
|
+
path: _path + ".minimum",
|
|
1362
|
+
expected: "number & Type<\"int64\">",
|
|
1363
|
+
value: input.minimum
|
|
1364
|
+
})) || _report(_exceptionable, {
|
|
1365
|
+
path: _path + ".minimum",
|
|
1366
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
1367
|
+
value: input.minimum
|
|
1368
|
+
}), undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000 || _report(_exceptionable, {
|
|
1369
|
+
path: _path + ".maximum",
|
|
1370
|
+
expected: "number & Type<\"int64\">",
|
|
1371
|
+
value: input.maximum
|
|
1372
|
+
})) || _report(_exceptionable, {
|
|
1373
|
+
path: _path + ".maximum",
|
|
1374
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
1375
|
+
value: input.maximum
|
|
1376
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
1377
|
+
path: _path + ".exclusiveMinimum",
|
|
1378
|
+
expected: "(number | undefined)",
|
|
1379
|
+
value: input.exclusiveMinimum
|
|
1380
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
1381
|
+
path: _path + ".exclusiveMaximum",
|
|
1382
|
+
expected: "(number | undefined)",
|
|
1383
|
+
value: input.exclusiveMaximum
|
|
1384
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 || _report(_exceptionable, {
|
|
1385
|
+
path: _path + ".multipleOf",
|
|
1386
|
+
expected: "number & Type<\"uint64\">",
|
|
1387
|
+
value: input.multipleOf
|
|
1388
|
+
})) && (0 < input.multipleOf || _report(_exceptionable, {
|
|
1389
|
+
path: _path + ".multipleOf",
|
|
1390
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
1391
|
+
value: input.multipleOf
|
|
1392
|
+
})) || _report(_exceptionable, {
|
|
1393
|
+
path: _path + ".multipleOf",
|
|
1394
|
+
expected: "((number & Type<\"uint64\"> & ExclusiveMinimum<0>) | undefined)",
|
|
1395
|
+
value: input.multipleOf
|
|
1396
|
+
}), "integer" === input.type || _report(_exceptionable, {
|
|
1397
|
+
path: _path + ".type",
|
|
1398
|
+
expected: "\"integer\"",
|
|
1399
|
+
value: input.type
|
|
1400
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum || _report(_exceptionable, {
|
|
1401
|
+
path: _path + ".minimum",
|
|
1402
|
+
expected: "(number | undefined)",
|
|
1403
|
+
value: input.minimum
|
|
1404
|
+
}), undefined === input.maximum || "number" === typeof input.maximum || _report(_exceptionable, {
|
|
1405
|
+
path: _path + ".maximum",
|
|
1406
|
+
expected: "(number | undefined)",
|
|
1407
|
+
value: input.maximum
|
|
1408
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
1409
|
+
path: _path + ".exclusiveMinimum",
|
|
1410
|
+
expected: "(number | undefined)",
|
|
1411
|
+
value: input.exclusiveMinimum
|
|
1412
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
1413
|
+
path: _path + ".exclusiveMaximum",
|
|
1414
|
+
expected: "(number | undefined)",
|
|
1415
|
+
value: input.exclusiveMaximum
|
|
1416
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (0 < input.multipleOf || _report(_exceptionable, {
|
|
1417
|
+
path: _path + ".multipleOf",
|
|
1418
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
1419
|
+
value: input.multipleOf
|
|
1420
|
+
})) || _report(_exceptionable, {
|
|
1421
|
+
path: _path + ".multipleOf",
|
|
1422
|
+
expected: "((number & ExclusiveMinimum<0>) | undefined)",
|
|
1423
|
+
value: input.multipleOf
|
|
1424
|
+
}), "number" === input.type || _report(_exceptionable, {
|
|
1425
|
+
path: _path + ".type",
|
|
1426
|
+
expected: "\"number\"",
|
|
1427
|
+
value: input.type
|
|
1428
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => [undefined === input.format || "string" === typeof input.format || _report(_exceptionable, {
|
|
1429
|
+
path: _path + ".format",
|
|
1430
|
+
expected: "(string | undefined)",
|
|
1431
|
+
value: input.format
|
|
1432
|
+
}), undefined === input.pattern || "string" === typeof input.pattern || _report(_exceptionable, {
|
|
1433
|
+
path: _path + ".pattern",
|
|
1434
|
+
expected: "(string | undefined)",
|
|
1435
|
+
value: input.pattern
|
|
1436
|
+
}), undefined === input.contentMediaType || "string" === typeof input.contentMediaType || _report(_exceptionable, {
|
|
1437
|
+
path: _path + ".contentMediaType",
|
|
1438
|
+
expected: "(string | undefined)",
|
|
1439
|
+
value: input.contentMediaType
|
|
1440
|
+
}), undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
1441
|
+
path: _path + ".minLength",
|
|
1442
|
+
expected: "number & Type<\"uint64\">",
|
|
1443
|
+
value: input.minLength
|
|
1444
|
+
})) || _report(_exceptionable, {
|
|
1445
|
+
path: _path + ".minLength",
|
|
1446
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
1447
|
+
value: input.minLength
|
|
1448
|
+
}), undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
1449
|
+
path: _path + ".maxLength",
|
|
1450
|
+
expected: "number & Type<\"uint64\">",
|
|
1451
|
+
value: input.maxLength
|
|
1452
|
+
})) || _report(_exceptionable, {
|
|
1453
|
+
path: _path + ".maxLength",
|
|
1454
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
1455
|
+
value: input.maxLength
|
|
1456
|
+
}), "string" === input.type || _report(_exceptionable, {
|
|
1457
|
+
path: _path + ".type",
|
|
1458
|
+
expected: "\"string\"",
|
|
1459
|
+
value: input.type
|
|
1460
|
+
})].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
1461
|
+
path: _path + ".description",
|
|
1462
|
+
expected: "string",
|
|
1463
|
+
value: input.description
|
|
1464
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
1465
|
+
path: _path + ".typeName",
|
|
1466
|
+
expected: "string",
|
|
1467
|
+
value: input.typeName
|
|
1468
|
+
})].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
1469
|
+
path: _path + ".description",
|
|
1470
|
+
expected: "string",
|
|
1471
|
+
value: input.description
|
|
1472
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
1473
|
+
path: _path + ".typeName",
|
|
1474
|
+
expected: "string",
|
|
1475
|
+
value: input.typeName
|
|
1476
|
+
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1477
|
+
if ("number" === input.type)
|
|
1478
|
+
return _vo4(input, _path, true && _exceptionable);
|
|
1479
|
+
else if ("integer" === input.type)
|
|
1480
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
1481
|
+
else if ("string" === input.type)
|
|
1482
|
+
return _vo5(input, _path, true && _exceptionable);
|
|
1483
|
+
else
|
|
1484
|
+
return _report(_exceptionable, {
|
|
1485
|
+
path: _path,
|
|
1486
|
+
expected: "(AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1487
|
+
value: input
|
|
1488
|
+
});
|
|
1489
|
+
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
1490
|
+
if (false === __is(input)) {
|
|
1491
|
+
errors = [];
|
|
1492
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
1493
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
1494
|
+
path: _path + "",
|
|
1495
|
+
expected: "IMakeOperationProps",
|
|
1496
|
+
value: input
|
|
1497
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
1498
|
+
path: _path + "",
|
|
1499
|
+
expected: "IMakeOperationProps",
|
|
1500
|
+
value: input
|
|
1501
|
+
}))(input, "$input", true);
|
|
1502
|
+
const success = 0 === errors.length;
|
|
1503
|
+
return success ? {
|
|
1504
|
+
success,
|
|
1505
|
+
data: input
|
|
1506
|
+
} : {
|
|
1507
|
+
success,
|
|
1508
|
+
errors,
|
|
1509
|
+
data: input
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
return {
|
|
1513
|
+
success: true,
|
|
1514
|
+
data: input
|
|
1515
|
+
};
|
|
1516
|
+
}; })()
|
|
1517
|
+
}
|
|
1518
|
+
]
|
|
1519
|
+
},
|
|
1520
|
+
claude,
|
|
1521
|
+
llama: claude,
|
|
1522
|
+
deepseek: claude,
|
|
1523
|
+
"3.1": claude,
|
|
1524
|
+
"3.0": {
|
|
1525
|
+
model: "3.0",
|
|
1526
|
+
options: {
|
|
1527
|
+
constraint: true,
|
|
1528
|
+
recursive: 3,
|
|
1529
|
+
separate: null
|
|
1530
|
+
},
|
|
1531
|
+
functions: [
|
|
1532
|
+
{
|
|
1533
|
+
name: "makeOperations",
|
|
1534
|
+
parameters: {
|
|
1535
|
+
type: "object",
|
|
1536
|
+
properties: {
|
|
1537
|
+
operations: {
|
|
1538
|
+
type: "array",
|
|
1539
|
+
items: {
|
|
1540
|
+
type: "object",
|
|
1541
|
+
properties: {
|
|
1542
|
+
specification: {
|
|
1543
|
+
type: "string",
|
|
1544
|
+
title: "Specification of the API operation",
|
|
1545
|
+
description: "Specification of the API operation.\n\nBefore defining the API operation interface, please describe what you're\nplanning to write in this `specification` field.\n\nThe specification must be fully detailed and clear, so that anyone can\nunderstand the purpose and functionality of the API operation and its\nrelated components (e.g., {@link path}, {@link parameters},\n{@link requestBody}).\n\nIMPORTANT: The specification MUST identify which Prisma DB table this\noperation is associated with, helping ensure complete coverage of all\ndatabase entities."
|
|
1546
|
+
},
|
|
1547
|
+
description: {
|
|
1548
|
+
type: "string",
|
|
1549
|
+
title: "Detailed description about the API operation",
|
|
1550
|
+
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n> MUST be written in English. Never use other languages."
|
|
1551
|
+
},
|
|
1552
|
+
summary: {
|
|
1553
|
+
type: "string",
|
|
1554
|
+
title: "Short summary of the API operation",
|
|
1555
|
+
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n> MUST be written in English. Never use other languages"
|
|
1556
|
+
},
|
|
1557
|
+
parameters: {
|
|
1558
|
+
type: "array",
|
|
1559
|
+
items: {
|
|
1560
|
+
type: "object",
|
|
1561
|
+
properties: {
|
|
1562
|
+
name: {
|
|
1563
|
+
type: "string",
|
|
1564
|
+
title: "Identifier name of the path parameter",
|
|
1565
|
+
description: "Identifier name of the path parameter.\n\nThis name must match exactly with the parameter name in the route path.\nIt must be corresponded to the\n{@link AutoBeOpenApi.IOperation.path API operation path}."
|
|
1566
|
+
},
|
|
1567
|
+
description: {
|
|
1568
|
+
type: "string",
|
|
1569
|
+
title: "Description about the path parameter",
|
|
1570
|
+
description: "Description about the path parameter.\n\nMake short, concise and clear description about the path parameter.\n\n> MUST be written in English. Never use other languages."
|
|
1571
|
+
},
|
|
1572
|
+
schema: {
|
|
1573
|
+
oneOf: [
|
|
1574
|
+
{
|
|
1575
|
+
type: "object",
|
|
1576
|
+
properties: {
|
|
1577
|
+
minimum: {
|
|
1578
|
+
type: "number",
|
|
1579
|
+
title: "Minimum value restriction",
|
|
1580
|
+
description: "Minimum value restriction."
|
|
1581
|
+
},
|
|
1582
|
+
maximum: {
|
|
1583
|
+
type: "number",
|
|
1584
|
+
title: "Maximum value restriction",
|
|
1585
|
+
description: "Maximum value restriction."
|
|
1586
|
+
},
|
|
1587
|
+
exclusiveMinimum: {
|
|
1588
|
+
type: "number",
|
|
1589
|
+
title: "Exclusive minimum value restriction",
|
|
1590
|
+
description: "Exclusive minimum value restriction."
|
|
1591
|
+
},
|
|
1592
|
+
exclusiveMaximum: {
|
|
1593
|
+
type: "number",
|
|
1594
|
+
title: "Exclusive maximum value restriction",
|
|
1595
|
+
description: "Exclusive maximum value restriction."
|
|
1596
|
+
},
|
|
1597
|
+
multipleOf: {
|
|
1598
|
+
type: "number",
|
|
1599
|
+
exclusiveMinimum: 0,
|
|
1600
|
+
title: "Multiple of value restriction",
|
|
1601
|
+
description: "Multiple of value restriction."
|
|
1602
|
+
},
|
|
1603
|
+
type: {
|
|
1604
|
+
type: "string",
|
|
1605
|
+
"enum": [
|
|
1606
|
+
"number"
|
|
1607
|
+
],
|
|
1608
|
+
title: "Discriminator value of the type",
|
|
1609
|
+
description: "Discriminator value of the type."
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1612
|
+
required: [
|
|
1613
|
+
"type"
|
|
1614
|
+
],
|
|
1615
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.INumber} type:\n\n> Number (double) type info.",
|
|
1616
|
+
additionalProperties: false
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
type: "object",
|
|
1620
|
+
properties: {
|
|
1621
|
+
minimum: {
|
|
1622
|
+
type: "integer",
|
|
1623
|
+
title: "Minimum value restriction",
|
|
1624
|
+
description: "Minimum value restriction."
|
|
1625
|
+
},
|
|
1626
|
+
maximum: {
|
|
1627
|
+
type: "integer",
|
|
1628
|
+
title: "Maximum value restriction",
|
|
1629
|
+
description: "Maximum value restriction."
|
|
1630
|
+
},
|
|
1631
|
+
exclusiveMinimum: {
|
|
1632
|
+
type: "number",
|
|
1633
|
+
title: "Exclusive minimum value restriction",
|
|
1634
|
+
description: "Exclusive minimum value restriction."
|
|
1635
|
+
},
|
|
1636
|
+
exclusiveMaximum: {
|
|
1637
|
+
type: "number",
|
|
1638
|
+
title: "Exclusive maximum value restriction",
|
|
1639
|
+
description: "Exclusive maximum value restriction."
|
|
1640
|
+
},
|
|
1641
|
+
multipleOf: {
|
|
1642
|
+
type: "integer",
|
|
1643
|
+
exclusiveMinimum: 0,
|
|
1644
|
+
title: "Multiple of value restriction",
|
|
1645
|
+
description: "Multiple of value restriction."
|
|
1646
|
+
},
|
|
1647
|
+
type: {
|
|
1648
|
+
type: "string",
|
|
1649
|
+
"enum": [
|
|
1650
|
+
"integer"
|
|
1651
|
+
],
|
|
1652
|
+
title: "Discriminator value of the type",
|
|
1653
|
+
description: "Discriminator value of the type."
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
required: [
|
|
1657
|
+
"type"
|
|
1658
|
+
],
|
|
1659
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.IInteger} type:\n\n> Integer type info.",
|
|
1660
|
+
additionalProperties: false
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
type: "object",
|
|
1664
|
+
properties: {
|
|
1665
|
+
format: {
|
|
1666
|
+
type: "string",
|
|
1667
|
+
title: "Format restriction",
|
|
1668
|
+
description: "Format restriction."
|
|
1669
|
+
},
|
|
1670
|
+
pattern: {
|
|
1671
|
+
type: "string",
|
|
1672
|
+
title: "Pattern restriction",
|
|
1673
|
+
description: "Pattern restriction."
|
|
1674
|
+
},
|
|
1675
|
+
contentMediaType: {
|
|
1676
|
+
type: "string",
|
|
1677
|
+
title: "Content media type restriction",
|
|
1678
|
+
description: "Content media type restriction."
|
|
1679
|
+
},
|
|
1680
|
+
minLength: {
|
|
1681
|
+
type: "integer",
|
|
1682
|
+
minimum: 0,
|
|
1683
|
+
title: "Minimum length restriction",
|
|
1684
|
+
description: "Minimum length restriction."
|
|
1685
|
+
},
|
|
1686
|
+
maxLength: {
|
|
1687
|
+
type: "integer",
|
|
1688
|
+
minimum: 0,
|
|
1689
|
+
title: "Maximum length restriction",
|
|
1690
|
+
description: "Maximum length restriction."
|
|
1691
|
+
},
|
|
1692
|
+
type: {
|
|
1693
|
+
type: "string",
|
|
1694
|
+
"enum": [
|
|
1695
|
+
"string"
|
|
1696
|
+
],
|
|
1697
|
+
title: "Discriminator value of the type",
|
|
1698
|
+
description: "Discriminator value of the type."
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1701
|
+
required: [
|
|
1702
|
+
"type"
|
|
1703
|
+
],
|
|
1704
|
+
description: "Description of the current {@link AutoBeOpenApi.IJsonSchema.IString} type:\n\n> String type info.",
|
|
1705
|
+
additionalProperties: false
|
|
1706
|
+
}
|
|
1707
|
+
],
|
|
1708
|
+
title: "Type schema of the path parameter",
|
|
1709
|
+
description: "Type schema of the path parameter.\n\nPath parameters are typically primitive types like\n{@link AutoBeOpenApi.IJsonSchema.IString strings},\n{@link AutoBeOpenApi.IJsonSchema.IInteger integers},\n{@link AutoBeOpenApi.IJsonSchema.INumber numbers}.\n\nIf you need other types, please use request body instead with object type\nencapsulation."
|
|
1710
|
+
}
|
|
1711
|
+
},
|
|
1712
|
+
required: [
|
|
1713
|
+
"name",
|
|
1714
|
+
"description",
|
|
1715
|
+
"schema"
|
|
1716
|
+
],
|
|
1717
|
+
description: "Description of the current {@link AutoBeOpenApi.IParameter} type:\n\n> Path parameter information for API routes.\n> \n> This interface defines a path parameter that appears in the URL of an API\n> endpoint. Path parameters are enclosed in curly braces in the\n> {@link AutoBeOpenApi.IOperation.path operation path} and must be defined\n> with their types and descriptions.\n> \n> For example, if API operation path is\n> `/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}`,\n> the path parameters should be like below:\n> \n> ```json\n> {\n> \"path\": \"/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}\",\n> \"method\": \"get\",\n> \"parameters\": [\n> {\n> \"name\": \"saleId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target sale's ID\"\n> },\n> {\n> \"name\": \"questionId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target question's ID\"\n> },\n> {\n> \"name\": \"commentId\",\n> \"in\": \"path\",\n> \"schema\": { \"type\": \"string\", \"format\": \"uuid\" },\n> \"description\": \"Target comment's ID\"\n> }\n> ]\n> }\n> ```",
|
|
1718
|
+
additionalProperties: false
|
|
1719
|
+
},
|
|
1720
|
+
title: "List of path parameters",
|
|
1721
|
+
description: "List of path parameters.\n\nNote that, the {@link AutoBeOpenApi.IParameter.name identifier name} of\npath parameter must be corresponded to the\n{@link path API operation path}.\n\nFor example, if there's an API operation which has {@link path} of\n`/shoppings/customers/sales/{saleId}/questions/${questionId}/comments/${commentId}`,\nits list of {@link AutoBeOpenApi.IParameter.name path parameters} must be\nlike:\n\n- `saleId`\n- `questionId`\n- `commentId`"
|
|
1722
|
+
},
|
|
1723
|
+
requestBody: {
|
|
1724
|
+
type: "object",
|
|
1725
|
+
properties: {
|
|
1726
|
+
description: {
|
|
1727
|
+
type: "string",
|
|
1728
|
+
title: "Description about the request body",
|
|
1729
|
+
description: "Description about the request body.\n\nMake short, concise and clear description about the request body.\n\n> MUST be written in English. Never use other languages."
|
|
1730
|
+
},
|
|
1731
|
+
typeName: {
|
|
1732
|
+
type: "string",
|
|
1733
|
+
title: "Request body type name",
|
|
1734
|
+
description: "Request body type name.\n\nThis specifies the data structure expected in the request body, that will\nbe transformed to {@link AutoBeOpenApi.IJsonSchema.IReference reference}\ntype in the {@link AutoBeOpenApi.IComponents.schemas components section}\nas an {@link AutoBeOpenApi.IJsonSchema.Object object} type.\n\nHere is the naming convention for the request body type:\n\n- `IEntityName.ICreate`: Request body for creation operations (POST)\n- `IEntityName.IUpdate`: Request body for update operations (PUT)\n- `IEntityName.IRequest`: Request parameters for list operations (often\n with search/pagination)\n\nWhat you write:\n\n```json\n{\n \"typeName\": \"IShoppingOrder.ICreate\"\n}\n```\n\nTransformed to:\n\n```json\n{\n \"schema\": {\n \"$ref\": \"#/components/schemas/IShoppingOrder.ICreate\"\n }\n}\n```"
|
|
1735
|
+
}
|
|
1736
|
+
},
|
|
1737
|
+
required: [
|
|
1738
|
+
"description",
|
|
1739
|
+
"typeName"
|
|
1740
|
+
],
|
|
1741
|
+
title: "Request body of the API operation",
|
|
1742
|
+
description: "Request body of the API operation.\n\nDefines the payload structure for the request. Contains a description and\nschema reference to define the expected input data.\n\nShould be `null` for operations that don't require a request body, such\nas most \"get\" operations.",
|
|
1743
|
+
additionalProperties: false,
|
|
1744
|
+
nullable: true
|
|
1745
|
+
},
|
|
1746
|
+
responseBody: {
|
|
1747
|
+
type: "object",
|
|
1748
|
+
properties: {
|
|
1749
|
+
description: {
|
|
1750
|
+
type: "string",
|
|
1751
|
+
title: "Description about the response body",
|
|
1752
|
+
description: "Description about the response body.\n\nMake short, concise and clear description about the response body.\n\n> MUST be written in English. Never use other languages."
|
|
1753
|
+
},
|
|
1754
|
+
typeName: {
|
|
1755
|
+
type: "string",
|
|
1756
|
+
title: "Response body's data type",
|
|
1757
|
+
description: "Response body's data type.\n\nSpecifies the structure of the returned data (response body), that will\nbe transformed to {@link AutoBeOpenApi.IJsonSchema.IReference} type in the\n{@link AutoBeOpenApi.IComponents.schemas components section} as an\n{@link AutoBeOpenApi.IJsonSchema.IObject object} type.\n\nHere is the naming convention for the response body type:\n\n- `IEntityName`: Main entity with detailed information (e.g.,\n `IShoppingSale`)\n- `IEntityName.ISummary`: Simplified response version with essential\n properties\n- `IEntityName.IInvert`: Alternative view of an entity from a different\n perspective\n- `IPageIEntityName`: Paginated results container with `pagination` and\n `data` properties\n\nWhat you write:\n\n```json\n{\n \"typeName\": \"IShoppingOrder\"\n}\n```\n\nTransformed to:\n\n```json\n{\n \"schema\": {\n \"$ref\": \"#/components/schemas/IShoppingOrder\"\n }\n}\n```"
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
required: [
|
|
1761
|
+
"description",
|
|
1762
|
+
"typeName"
|
|
1763
|
+
],
|
|
1764
|
+
title: "Response body of the API operation",
|
|
1765
|
+
description: "Response body of the API operation.\n\nDefines the structure of the successful response data. Contains a\ndescription and schema reference for the returned data.\n\nShould be null for operations that don't return any data.",
|
|
1766
|
+
additionalProperties: false,
|
|
1767
|
+
nullable: true
|
|
1768
|
+
},
|
|
1769
|
+
path: {
|
|
1770
|
+
type: "string",
|
|
1771
|
+
title: "HTTP path of the API operation",
|
|
1772
|
+
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."
|
|
1773
|
+
},
|
|
1774
|
+
method: {
|
|
1775
|
+
type: "string",
|
|
1776
|
+
"enum": [
|
|
1777
|
+
"get",
|
|
1778
|
+
"post",
|
|
1779
|
+
"put",
|
|
1780
|
+
"delete",
|
|
1781
|
+
"patch"
|
|
1782
|
+
],
|
|
1783
|
+
title: "HTTP method of the API operation",
|
|
1784
|
+
description: "HTTP method of the API operation.\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"
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
required: [
|
|
1788
|
+
"specification",
|
|
1789
|
+
"description",
|
|
1790
|
+
"summary",
|
|
1791
|
+
"parameters",
|
|
1792
|
+
"requestBody",
|
|
1793
|
+
"responseBody",
|
|
1794
|
+
"path",
|
|
1795
|
+
"method"
|
|
1796
|
+
],
|
|
1797
|
+
description: "Description of the current {@link AutoBeOpenApi.IOperation} type:\n\n> Operation of the Restful API.\n> \n> This interface defines a single API endpoint with its HTTP {@link method},\n> {@link path}, {@link parameters path parameters},\n> {@link requestBody request body}, and {@link responseBody} structure. It\n> corresponds to an individual operation in the paths section of an OpenAPI\n> document.\n> \n> Each operation requires a detailed explanation of its purpose through the\n> reason and description fields, making it clear why the API was designed and\n> how it should be used.\n> \n> All request bodies and responses for this operation must be object types\n> and must reference named types defined in the components section. The\n> content-type is always `application/json`. For file upload/download\n> operations, use `string & tags.Format<\"uri\">` in the appropriate schema\n> instead of binary data formats.\n> \n> In OpenAPI, this might represent:\n> \n> ```json\n> {\n> \"/shoppings/customers/orders\": {\n> \"post\": {\n> \"description\": \"Create a new order application from shopping cart...\",\n> \"parameters\": [...],\n> \"requestBody\": {...},\n> \"responses\": {...}\n> }\n> }\n> }\n> ```",
|
|
1798
|
+
additionalProperties: false
|
|
1799
|
+
},
|
|
1800
|
+
title: "Array of API operations to generate",
|
|
1801
|
+
description: "Array of API operations to generate.\n\nEach operation in this array must include:\n\n- Specification: Detailed API specification with clear purpose and\n functionality\n- Path: Resource-centric URL path (e.g., \"/resources/{resourceId}\")\n- Method: HTTP method (get, post, put, delete, patch)\n- Description: Extremely detailed multi-paragraph description referencing\n Prisma schema comments\n- Summary: Concise one-sentence summary of the endpoint\n- Parameters: Array of all necessary parameters with descriptions and schema\n definitions\n- RequestBody: For POST/PUT/PATCH methods, with typeName referencing\n components.schemas\n- ResponseBody: With typeName referencing appropriate response type\n\nAll operations must follow strict quality standards:\n\n1. Detailed descriptions referencing Prisma schema comments\n2. Accurate parameter definitions matching path parameters\n3. Appropriate request/response body type references\n4. Consistent patterns for CRUD operations\n\nFor list retrievals (typically PATCH), include pagination, search, and\nsorting. For detail retrieval (GET), return a single resource. For creation\n(POST), use .ICreate request body. For modification (PUT), use .IUpdate\nrequest body."
|
|
1802
|
+
}
|
|
1803
|
+
},
|
|
1804
|
+
required: [
|
|
1805
|
+
"operations"
|
|
1806
|
+
],
|
|
1807
|
+
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeOperationProps}",
|
|
1808
|
+
additionalProperties: false
|
|
1809
|
+
},
|
|
1810
|
+
description: "Generate detailed API operations from path/method combinations.\n\nThis function creates complete API operations following REST principles and\nquality standards. Each generated operation includes specification, path,\nmethod, detailed multi-paragraph description, concise summary, parameters,\nand appropriate request/response bodies.\n\nThe function processes as many operations as possible in a single call,\nwith progress tracking to ensure iterative completion of all required\nendpoints.",
|
|
1811
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.specification && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(input.responseBody)) && "string" === typeof input.path && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io2 = input => "string" === typeof input.name && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io3 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io5 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
1812
|
+
if ("number" === input.type)
|
|
1813
|
+
return _io4(input);
|
|
1814
|
+
else if ("integer" === input.type)
|
|
1815
|
+
return _io3(input);
|
|
1816
|
+
else if ("string" === input.type)
|
|
1817
|
+
return _io5(input);
|
|
1818
|
+
else
|
|
1819
|
+
return false;
|
|
1820
|
+
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
1821
|
+
path: _path + ".operations",
|
|
1822
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
1823
|
+
value: input.operations
|
|
1824
|
+
})) && input.operations.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1825
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
1826
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
1827
|
+
value: elem
|
|
1828
|
+
})) && _vo1(elem, _path + ".operations[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1829
|
+
path: _path + ".operations[" + _index3 + "]",
|
|
1830
|
+
expected: "AutoBeOpenApi.IOperation",
|
|
1831
|
+
value: elem
|
|
1832
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1833
|
+
path: _path + ".operations",
|
|
1834
|
+
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
1835
|
+
value: input.operations
|
|
1836
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.specification || _report(_exceptionable, {
|
|
1837
|
+
path: _path + ".specification",
|
|
1838
|
+
expected: "string",
|
|
1839
|
+
value: input.specification
|
|
1840
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1841
|
+
path: _path + ".description",
|
|
1842
|
+
expected: "string",
|
|
1843
|
+
value: input.description
|
|
1844
|
+
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
1845
|
+
path: _path + ".summary",
|
|
1846
|
+
expected: "string",
|
|
1847
|
+
value: input.summary
|
|
1848
|
+
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
1849
|
+
path: _path + ".parameters",
|
|
1850
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1851
|
+
value: input.parameters
|
|
1852
|
+
})) && input.parameters.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1853
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
1854
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
1855
|
+
value: elem
|
|
1856
|
+
})) && _vo2(elem, _path + ".parameters[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1857
|
+
path: _path + ".parameters[" + _index4 + "]",
|
|
1858
|
+
expected: "AutoBeOpenApi.IParameter",
|
|
1859
|
+
value: elem
|
|
1860
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1861
|
+
path: _path + ".parameters",
|
|
1862
|
+
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1863
|
+
value: input.parameters
|
|
1864
|
+
}), null === input.requestBody || ("object" === typeof input.requestBody && null !== input.requestBody || _report(_exceptionable, {
|
|
1865
|
+
path: _path + ".requestBody",
|
|
1866
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
1867
|
+
value: input.requestBody
|
|
1868
|
+
})) && _vo6(input.requestBody, _path + ".requestBody", true && _exceptionable) || _report(_exceptionable, {
|
|
1869
|
+
path: _path + ".requestBody",
|
|
1870
|
+
expected: "(AutoBeOpenApi.IRequestBody | null)",
|
|
1871
|
+
value: input.requestBody
|
|
1872
|
+
}), null === input.responseBody || ("object" === typeof input.responseBody && null !== input.responseBody || _report(_exceptionable, {
|
|
1873
|
+
path: _path + ".responseBody",
|
|
1874
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
1875
|
+
value: input.responseBody
|
|
1876
|
+
})) && _vo7(input.responseBody, _path + ".responseBody", true && _exceptionable) || _report(_exceptionable, {
|
|
1877
|
+
path: _path + ".responseBody",
|
|
1878
|
+
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
1879
|
+
value: input.responseBody
|
|
1880
|
+
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
1881
|
+
path: _path + ".path",
|
|
1882
|
+
expected: "string",
|
|
1883
|
+
value: input.path
|
|
1884
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1885
|
+
path: _path + ".method",
|
|
1886
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
1887
|
+
value: input.method
|
|
1888
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
1889
|
+
path: _path + ".name",
|
|
1890
|
+
expected: "string",
|
|
1891
|
+
value: input.name
|
|
1892
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1893
|
+
path: _path + ".description",
|
|
1894
|
+
expected: "string",
|
|
1895
|
+
value: input.description
|
|
1896
|
+
}), ("object" === typeof input.schema && null !== input.schema || _report(_exceptionable, {
|
|
1897
|
+
path: _path + ".schema",
|
|
1898
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1899
|
+
value: input.schema
|
|
1900
|
+
})) && _vu0(input.schema, _path + ".schema", true && _exceptionable) || _report(_exceptionable, {
|
|
1901
|
+
path: _path + ".schema",
|
|
1902
|
+
expected: "(AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1903
|
+
value: input.schema
|
|
1904
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000 || _report(_exceptionable, {
|
|
1905
|
+
path: _path + ".minimum",
|
|
1906
|
+
expected: "number & Type<\"int64\">",
|
|
1907
|
+
value: input.minimum
|
|
1908
|
+
})) || _report(_exceptionable, {
|
|
1909
|
+
path: _path + ".minimum",
|
|
1910
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
1911
|
+
value: input.minimum
|
|
1912
|
+
}), undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000 || _report(_exceptionable, {
|
|
1913
|
+
path: _path + ".maximum",
|
|
1914
|
+
expected: "number & Type<\"int64\">",
|
|
1915
|
+
value: input.maximum
|
|
1916
|
+
})) || _report(_exceptionable, {
|
|
1917
|
+
path: _path + ".maximum",
|
|
1918
|
+
expected: "((number & Type<\"int64\">) | undefined)",
|
|
1919
|
+
value: input.maximum
|
|
1920
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
1921
|
+
path: _path + ".exclusiveMinimum",
|
|
1922
|
+
expected: "(number | undefined)",
|
|
1923
|
+
value: input.exclusiveMinimum
|
|
1924
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
1925
|
+
path: _path + ".exclusiveMaximum",
|
|
1926
|
+
expected: "(number | undefined)",
|
|
1927
|
+
value: input.exclusiveMaximum
|
|
1928
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 || _report(_exceptionable, {
|
|
1929
|
+
path: _path + ".multipleOf",
|
|
1930
|
+
expected: "number & Type<\"uint64\">",
|
|
1931
|
+
value: input.multipleOf
|
|
1932
|
+
})) && (0 < input.multipleOf || _report(_exceptionable, {
|
|
1933
|
+
path: _path + ".multipleOf",
|
|
1934
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
1935
|
+
value: input.multipleOf
|
|
1936
|
+
})) || _report(_exceptionable, {
|
|
1937
|
+
path: _path + ".multipleOf",
|
|
1938
|
+
expected: "((number & Type<\"uint64\"> & ExclusiveMinimum<0>) | undefined)",
|
|
1939
|
+
value: input.multipleOf
|
|
1940
|
+
}), "integer" === input.type || _report(_exceptionable, {
|
|
1941
|
+
path: _path + ".type",
|
|
1942
|
+
expected: "\"integer\"",
|
|
1943
|
+
value: input.type
|
|
1944
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [undefined === input.minimum || "number" === typeof input.minimum || _report(_exceptionable, {
|
|
1945
|
+
path: _path + ".minimum",
|
|
1946
|
+
expected: "(number | undefined)",
|
|
1947
|
+
value: input.minimum
|
|
1948
|
+
}), undefined === input.maximum || "number" === typeof input.maximum || _report(_exceptionable, {
|
|
1949
|
+
path: _path + ".maximum",
|
|
1950
|
+
expected: "(number | undefined)",
|
|
1951
|
+
value: input.maximum
|
|
1952
|
+
}), undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum || _report(_exceptionable, {
|
|
1953
|
+
path: _path + ".exclusiveMinimum",
|
|
1954
|
+
expected: "(number | undefined)",
|
|
1955
|
+
value: input.exclusiveMinimum
|
|
1956
|
+
}), undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum || _report(_exceptionable, {
|
|
1957
|
+
path: _path + ".exclusiveMaximum",
|
|
1958
|
+
expected: "(number | undefined)",
|
|
1959
|
+
value: input.exclusiveMaximum
|
|
1960
|
+
}), undefined === input.multipleOf || "number" === typeof input.multipleOf && (0 < input.multipleOf || _report(_exceptionable, {
|
|
1961
|
+
path: _path + ".multipleOf",
|
|
1962
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
1963
|
+
value: input.multipleOf
|
|
1964
|
+
})) || _report(_exceptionable, {
|
|
1965
|
+
path: _path + ".multipleOf",
|
|
1966
|
+
expected: "((number & ExclusiveMinimum<0>) | undefined)",
|
|
1967
|
+
value: input.multipleOf
|
|
1968
|
+
}), "number" === input.type || _report(_exceptionable, {
|
|
1969
|
+
path: _path + ".type",
|
|
1970
|
+
expected: "\"number\"",
|
|
1971
|
+
value: input.type
|
|
1972
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => [undefined === input.format || "string" === typeof input.format || _report(_exceptionable, {
|
|
1973
|
+
path: _path + ".format",
|
|
1974
|
+
expected: "(string | undefined)",
|
|
1975
|
+
value: input.format
|
|
1976
|
+
}), undefined === input.pattern || "string" === typeof input.pattern || _report(_exceptionable, {
|
|
1977
|
+
path: _path + ".pattern",
|
|
1978
|
+
expected: "(string | undefined)",
|
|
1979
|
+
value: input.pattern
|
|
1980
|
+
}), undefined === input.contentMediaType || "string" === typeof input.contentMediaType || _report(_exceptionable, {
|
|
1981
|
+
path: _path + ".contentMediaType",
|
|
1982
|
+
expected: "(string | undefined)",
|
|
1983
|
+
value: input.contentMediaType
|
|
1984
|
+
}), undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
1985
|
+
path: _path + ".minLength",
|
|
1986
|
+
expected: "number & Type<\"uint64\">",
|
|
1987
|
+
value: input.minLength
|
|
1988
|
+
})) || _report(_exceptionable, {
|
|
1989
|
+
path: _path + ".minLength",
|
|
1990
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
1991
|
+
value: input.minLength
|
|
1992
|
+
}), undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000 || _report(_exceptionable, {
|
|
1993
|
+
path: _path + ".maxLength",
|
|
1994
|
+
expected: "number & Type<\"uint64\">",
|
|
1995
|
+
value: input.maxLength
|
|
1996
|
+
})) || _report(_exceptionable, {
|
|
1997
|
+
path: _path + ".maxLength",
|
|
1998
|
+
expected: "((number & Type<\"uint64\">) | undefined)",
|
|
1999
|
+
value: input.maxLength
|
|
2000
|
+
}), "string" === input.type || _report(_exceptionable, {
|
|
2001
|
+
path: _path + ".type",
|
|
2002
|
+
expected: "\"string\"",
|
|
2003
|
+
value: input.type
|
|
2004
|
+
})].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
2005
|
+
path: _path + ".description",
|
|
2006
|
+
expected: "string",
|
|
2007
|
+
value: input.description
|
|
2008
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
2009
|
+
path: _path + ".typeName",
|
|
2010
|
+
expected: "string",
|
|
2011
|
+
value: input.typeName
|
|
2012
|
+
})].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
2013
|
+
path: _path + ".description",
|
|
2014
|
+
expected: "string",
|
|
2015
|
+
value: input.description
|
|
2016
|
+
}), "string" === typeof input.typeName || _report(_exceptionable, {
|
|
2017
|
+
path: _path + ".typeName",
|
|
2018
|
+
expected: "string",
|
|
2019
|
+
value: input.typeName
|
|
2020
|
+
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
2021
|
+
if ("number" === input.type)
|
|
2022
|
+
return _vo4(input, _path, true && _exceptionable);
|
|
2023
|
+
else if ("integer" === input.type)
|
|
2024
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
2025
|
+
else if ("string" === input.type)
|
|
2026
|
+
return _vo5(input, _path, true && _exceptionable);
|
|
2027
|
+
else
|
|
2028
|
+
return _report(_exceptionable, {
|
|
2029
|
+
path: _path,
|
|
2030
|
+
expected: "(AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.IString)",
|
|
2031
|
+
value: input
|
|
2032
|
+
});
|
|
2033
|
+
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
2034
|
+
if (false === __is(input)) {
|
|
2035
|
+
errors = [];
|
|
2036
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
2037
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
2038
|
+
path: _path + "",
|
|
2039
|
+
expected: "IMakeOperationProps",
|
|
2040
|
+
value: input
|
|
2041
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
2042
|
+
path: _path + "",
|
|
2043
|
+
expected: "IMakeOperationProps",
|
|
2044
|
+
value: input
|
|
2045
|
+
}))(input, "$input", true);
|
|
2046
|
+
const success = 0 === errors.length;
|
|
2047
|
+
return success ? {
|
|
2048
|
+
success,
|
|
2049
|
+
data: input
|
|
2050
|
+
} : {
|
|
2051
|
+
success,
|
|
2052
|
+
errors,
|
|
2053
|
+
data: input
|
|
2054
|
+
};
|
|
2055
|
+
}
|
|
2056
|
+
return {
|
|
2057
|
+
success: true,
|
|
2058
|
+
data: input
|
|
2059
|
+
};
|
|
2060
|
+
}; })()
|
|
2061
|
+
}
|
|
2062
|
+
]
|
|
2063
|
+
},
|
|
2064
|
+
};
|
|
2065
|
+
//# sourceMappingURL=orchestrateInterfaceOperations.js.map
|