@autobe/agent 0.14.5 → 0.15.0
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/lib/AutoBeMockAgent.js +1 -1
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -9
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/index.mjs +3557 -2635
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +4 -9
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -8
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +65 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +62 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +63 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.js +14 -9
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +13 -40
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +3 -2
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +52 -32
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +350 -0
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +252 -226
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +411 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +55 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +23 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +108 -0
- package/lib/orchestrate/{realize/structures/IAutoBeRealizeDecoratorApplication.js → interface/structures/IAutoBeInterfaceGroupApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +122 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +75 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js.map +1 -0
- package/lib/orchestrate/interface/{OpenApiEndpointComparator.d.ts → utils/OpenApiEndpointComparator.d.ts} +1 -0
- package/lib/orchestrate/interface/{OpenApiEndpointComparator.js → utils/OpenApiEndpointComparator.js} +6 -0
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +17 -3
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +81 -88
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +4 -0
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +513 -0
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +3 -2
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.d.ts → IAutoBeRealizeAuthorizationApplication.d.ts} +9 -9
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +33 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +34 -13
- package/lib/orchestrate/realize/transformRealizeAuthorization.d.ts +4 -0
- package/lib/orchestrate/realize/transformRealizeAuthorization.js +43 -0
- package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.d.ts +5 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +71 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +5 -5
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.d.ts +8 -0
- package/lib/orchestrate/realize/utils/InternalFileSystem.js +17 -0
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.d.ts +3 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.js +8 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +2 -2
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +36 -36
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +2 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +29 -13
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +2 -0
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.js +3 -2
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/lib/utils/arrayToRecord.d.ts +17 -0
- package/lib/utils/arrayToRecord.js +19 -0
- package/lib/utils/arrayToRecord.js.map +1 -0
- package/lib/utils/backoffRetry.js +0 -1
- package/lib/utils/backoffRetry.js.map +1 -1
- package/package.json +6 -5
- package/src/AutoBeMockAgent.ts +1 -1
- package/src/constants/AutoBeSystemPromptConstant.ts +11 -9
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +1 -3
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +1 -3
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +75 -0
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +69 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +34 -0
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +32 -0
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +34 -0
- package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +66 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +34 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +17 -8
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +22 -97
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +48 -55
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +109 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +83 -120
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +197 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +58 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.ts +24 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +112 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +125 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +76 -0
- package/src/orchestrate/interface/{OpenApiEndpointComparator.ts → utils/OpenApiEndpointComparator.ts} +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +25 -3
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +45 -54
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +179 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +3 -6
- package/src/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.ts → IAutoBeRealizeAuthorizationApplication.ts} +11 -9
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +40 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +42 -24
- package/src/orchestrate/realize/{transformRealizeDecorator.ts → transformRealizeAuthorization.ts} +13 -2
- package/src/orchestrate/realize/{transformRealizeDecoratorCorrectHistories.ts → transformRealizeAuthorizationCorrectHistories.ts} +15 -7
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +4 -4
- package/src/orchestrate/realize/utils/InternalFileSystem.ts +12 -0
- package/src/orchestrate/realize/utils/ProviderFileSystem.ts +4 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +2 -2
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +59 -53
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +3 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +4 -2
- package/src/orchestrate/test/orchestrateTestWrite.ts +8 -1
- package/src/utils/arrayToRecord.ts +49 -0
- package/src/utils/backoffRetry.ts +0 -1
- package/lib/orchestrate/interface/OpenApiEndpointComparator.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.d.ts +0 -4
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +0 -473
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +0 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.d.ts +0 -3
- package/lib/orchestrate/interface/transformInterfaceHistories.js +0 -149
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeDecorator.d.ts +0 -4
- package/lib/orchestrate/realize/transformRealizeDecorator.js +0 -32
- package/lib/orchestrate/realize/transformRealizeDecorator.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.d.ts +0 -5
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js +0 -62
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js.map +0 -1
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +0 -292
- package/src/orchestrate/interface/transformInterfaceHistories.ts +0 -152
|
@@ -50,32 +50,27 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
50
50
|
const core_1 = require("@agentica/core");
|
|
51
51
|
const tstl_1 = require("tstl");
|
|
52
52
|
const typia_1 = __importDefault(require("typia"));
|
|
53
|
+
const NamingConvention_1 = require("typia/lib/utils/NamingConvention");
|
|
53
54
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
55
|
const divideArray_1 = require("../../utils/divideArray");
|
|
55
56
|
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
56
57
|
const forceRetry_1 = require("../../utils/forceRetry");
|
|
57
|
-
const
|
|
58
|
-
const
|
|
58
|
+
const transformInterfaceOperationHistories_1 = require("./histories/transformInterfaceOperationHistories");
|
|
59
|
+
const OpenApiEndpointComparator_1 = require("./utils/OpenApiEndpointComparator");
|
|
59
60
|
function orchestrateInterfaceOperations(ctx_1, endpoints_1) {
|
|
60
61
|
return __awaiter(this, arguments, void 0, function* (ctx, endpoints, capacity = 12) {
|
|
61
62
|
const matrix = (0, divideArray_1.divideArray)({
|
|
62
63
|
array: endpoints,
|
|
63
64
|
capacity,
|
|
64
65
|
});
|
|
65
|
-
|
|
66
|
+
const progress = {
|
|
67
|
+
total: endpoints.length,
|
|
68
|
+
completed: 0,
|
|
69
|
+
};
|
|
66
70
|
const operations = yield Promise.all(matrix.map((it) => __awaiter(this, void 0, void 0, function* () {
|
|
67
71
|
var _a, _b;
|
|
68
|
-
const row = yield divideAndConquer(ctx, it, 3,
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
ctx.dispatch({
|
|
72
|
-
type: "interfaceOperations",
|
|
73
|
-
operations: row,
|
|
74
|
-
completed,
|
|
75
|
-
total: endpoints.length,
|
|
76
|
-
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
77
|
-
created_at: new Date().toISOString(),
|
|
78
|
-
});
|
|
72
|
+
const row = yield divideAndConquer(ctx, it, 3, progress);
|
|
73
|
+
ctx.dispatch(Object.assign(Object.assign({ type: "interfaceOperations", operations: row }, progress), { step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0, created_at: new Date().toISOString() }));
|
|
79
74
|
return row;
|
|
80
75
|
})));
|
|
81
76
|
return operations.flat();
|
|
@@ -88,21 +83,19 @@ function divideAndConquer(ctx, endpoints, retry, progress) {
|
|
|
88
83
|
for (let i = 0; i < retry; ++i) {
|
|
89
84
|
if (remained.empty() === true || operations.size() >= endpoints.length)
|
|
90
85
|
break;
|
|
91
|
-
const
|
|
92
|
-
const newbie = yield (0, forceRetry_1.forceRetry)(() => process(ctx, Array.from(remained)));
|
|
86
|
+
const newbie = yield (0, forceRetry_1.forceRetry)(() => process(ctx, Array.from(remained), progress));
|
|
93
87
|
for (const item of newbie) {
|
|
94
88
|
operations.set(item, item);
|
|
95
89
|
remained.erase(item);
|
|
96
90
|
}
|
|
97
|
-
if (operations.size() - before !== 0)
|
|
98
|
-
progress(operations.size() - before);
|
|
99
91
|
}
|
|
100
92
|
return operations.toJSON().map((it) => it.second);
|
|
101
93
|
});
|
|
102
94
|
}
|
|
103
|
-
function process(ctx, endpoints) {
|
|
95
|
+
function process(ctx, endpoints, progress) {
|
|
104
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
97
|
var _a, _b, _c;
|
|
98
|
+
const prefix = NamingConvention_1.NamingConvention.camel(ctx.state().analyze.prefix);
|
|
106
99
|
const pointer = {
|
|
107
100
|
value: null,
|
|
108
101
|
};
|
|
@@ -112,38 +105,39 @@ function process(ctx, endpoints) {
|
|
|
112
105
|
config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
|
|
113
106
|
describe: null,
|
|
114
107
|
} }),
|
|
115
|
-
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## 2.1. Critical Schema Verification Rule\n\n**IMPORTANT**: When designing endpoints and their operations, you MUST:\n- Base ALL endpoint designs strictly on the ACTUAL fields present in the Prisma schema\n- NEVER assume common fields like `deleted_at`, `created_by`, `updated_by`, `is_deleted` exist unless explicitly defined in the schema\n- If the Prisma schema lacks soft delete fields, the DELETE endpoint will perform hard delete\n- Verify every field reference against the provided Prisma schema JSON\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\n4. **Use role-based path prefixes for access control**\n - **Role-specific endpoints**: Prefix with `/{role}/` where role matches the actual roles in your system\n - **Owner-specific endpoints**: Always use `/my/` prefix for resources owned by the authenticated user\n - **Public endpoints**: No special prefix\n \n **Dynamic role mapping** (adapt to your actual roles):\n - If your system has `admin` role \u2192 use `/admin/`\n - If your system has `administrator` role \u2192 use `/administrator/`\n - If your system has `moderator` role \u2192 use `/moderator/`\n - If your system has `seller` role \u2192 use `/seller/`\n - If your system has `buyer` role \u2192 use `/buyer/`\n - If your system has custom roles \u2192 use `/{customRole}/`\n \n **Standard patterns**:\n - `/my/` - ALWAYS means \"resources owned by the authenticated user\"\n - `/{role}/` - Role-specific access (e.g., `/admin/`, `/seller/`, `/moderator/`)\n - No prefix - Public or general authenticated access\n \n Examples:\n - `DELETE /admin/users/{userId}` - If system has 'admin' role\n - `DELETE /administrator/users/{userId}` - If system has 'administrator' role\n - `GET /my/posts` - Any authenticated user gets their own posts\n - `GET /seller/products` - Seller-specific product management\n - `PUT /moderator/posts/{postId}` - Moderator can edit posts\n - `GET /buyer/orders` - Buyer sees their purchase history\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- Role-based collection endpoints: `/role/domain/resources`\n- Role-based single resource endpoints: `/role/domain/resources/{resourceId}`\n\nCombined examples (adapt role names to your system):\n- `/{adminRole}/bbs/articles` - Admin/Administrator access to all articles\n- `/my/bbs/articles` - User's own articles\n- `/bbs/articles` - Public articles list\n- `/{adminRole}/shopping/orders/{orderId}` - Admin access to any order\n- `/my/shopping/orders/{orderId}` - User access to their own order\n- `/seller/shopping/products` - Seller's product management\n- `/buyer/shopping/wishlists` - Buyer's wishlist management\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\n#### Public endpoints (RARE - only for truly public data):\n1. `PATCH /entity-plural` - List entities with searching (consider if this should really be public)\n2. `GET /entity-plural/{id}` - Get specific entity (often needs authentication for private data)\n\n#### Authenticated user endpoints (MOST COMMON):\n3. `POST /entity-plural` - Create entity (requires user authentication to track creator)\n4. `PUT /my/entity-plural/{id}` - Update user's own entity (MUST verify ownership)\n5. `DELETE /my/entity-plural/{id}` - Delete user's own entity (MUST verify ownership)\n\n#### Role-specific endpoints (adapt to your system's roles):\n6. `PUT /{role}/entity-plural/{id}` - Role-specific update (e.g., /admin/, /moderator/, /seller/)\n7. `DELETE /{role}/entity-plural/{id}` - Role-specific delete\n8. `PATCH /{role}/entity-plural` - Role-specific list with special permissions\n\n**\uD83D\uDD34 AUTHORIZATION IS ALMOST ALWAYS REQUIRED**:\n- Even \"reading my own data\" requires authentication to know who \"my\" refers to\n- Creating any resource requires authentication to set the creator/owner\n- Updating/deleting requires authentication to verify ownership or permissions\n- Public endpoints should be the exception, not the rule\n\n**Role-based endpoint strategy**:\n- Use `/my/` prefix when users can only access their own resources\n- Use `/{role}/` prefix based on actual roles in your system (admin, administrator, moderator, seller, buyer, etc.)\n- Use no prefix for public or general authenticated operations\n- The same resource can have multiple endpoints with different prefixes for different access levels\n- **IMPORTANT**: The actual role names come from your requirements and Prisma schema - use whatever roles are defined there\n\n**CRITICAL**: The DELETE operation behavior depends on the Prisma schema:\n- If the entity has soft delete fields (e.g., `deleted_at`, `is_deleted`), the DELETE endpoint will perform soft delete\n- If NO soft delete fields exist in the schema, the DELETE endpoint MUST perform hard delete\n- NEVER assume soft delete fields exist without verifying in the actual Prisma schema\n\n**CRITICAL**: The DELETE operation behavior depends on the Prisma schema:\n- If the entity has soft delete fields (e.g., `deleted_at`, `is_deleted`), the DELETE endpoint will perform soft delete\n- If NO soft delete fields exist in the schema, the DELETE endpoint MUST perform hard delete\n- NEVER assume soft delete fields exist without verifying in the actual Prisma schema\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- **Role-Based Endpoints**: When an entity requires authentication, create appropriate role-prefixed endpoints\n- **Clear Access Intent**: The path itself should indicate who can access the endpoint (admin, user, public)\n\n### \uD83D\uDD34 CRITICAL: Authorization Role Assignment\n\n**IMPORTANT**: Endpoints without authorization roles are RARE. Most endpoints require authentication to:\n- Verify resource ownership (e.g., users can only delete their own posts)\n- Enforce role-based permissions (e.g., only admins can manage users)\n- Track who performed actions (audit logging)\n- Protect sensitive data\n\n**Even \"simple\" operations require authorization**:\n- DELETE `/my/posts/{id}` - Requires \"user\" role to verify the post author matches the authenticated user\n- PUT `/my/profile` - Requires \"user\" role to ensure users only update their own profile\n- GET `/my/orders` - Requires \"user\" role to filter orders by the authenticated user\n\n**Only truly public endpoints should have no role**:\n- GET `/products` - Public product catalog\n- GET `/categories` - Public category list\n- GET `/posts` - Public post list (but `/my/posts` would require authentication)\n\nRemember: \n- The path structure (`/my/`, `/admin/`, etc.) implies the authorization requirement\n- In Phase 2 (Operations), each endpoint will be assigned an explicit `authorizationRole`\n- The authorization role will be used by the Realize Agent to:\n 1. Generate appropriate authentication decorators\n 2. Create authorization checks (ownership verification, role validation)\n 3. Ensure proper access control implementation\n\n**Path Convention as Authorization Hint**:\n- `/my/*` paths \u2192 Will need user authentication in Phase 2\n- `/{role}/*` paths \u2192 Will need specific role authentication in Phase 2\n- Plain paths without prefix \u2192 Might be public, but consider carefully\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| `/users` (DELETE) | `/{adminRole}/users/{id}` | Only admin/administrator can delete users |\n| `/posts` (DELETE by owner) | `/my/posts/{id}` | Users can only delete their own posts |\n| `/posts` (UPDATE by moderator) | `/moderator/posts/{id}` | Moderator can update any post |\n| `/products` (MANAGE by seller) | `/seller/products` | Seller manages their products |\n| `/orders` (GET by buyer) | `/buyer/orders` | Buyer sees their purchase orders |\n| `/orders` (GET by seller) | `/seller/orders` | Seller sees orders for their products |\n| Note: | Use actual role names from your system | admin, administrator, moderator, seller, buyer, etc. |\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**: \n- Domain prefix \"bbs\" is separated with a slash\n- Entities use camelCase\n- Hierarchical relationships are expressed (e.g., `/bbs/articles/{articleId}/comments`)\n- Role-based access: `/my/bbs/articles` for user's own articles, `/{actualAdminRole}/bbs/articles` for admin operations (use the actual role name from your system)\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**: \n- `/shopping` is used as domain prefix\n- Hierarchical relationships are reflected in paths (e.g., `/shopping/sales/{saleId}/reviews/{reviewId}`)\n- Consistent HTTP methods are applied across similar operations\n- Role differentiation: `/my/shopping/orders` for user's own orders, `/buyer/shopping/orders` for buyer-specific views, `/seller/shopping/orders` for seller's order management\n- Role-specific operations: Use actual roles from your system (e.g., `/administrator/shopping/products`, `/seller/shopping/products`)" /* AutoBeSystemPromptConstant.INTERFACE_ENDPOINT */),
|
|
108
|
+
histories: (0, transformInterfaceOperationHistories_1.transformInterfaceOperationHistories)(ctx.state(), endpoints),
|
|
116
109
|
controllers: [
|
|
117
110
|
createApplication({
|
|
118
111
|
model: ctx.model,
|
|
119
|
-
roles: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.roles.map((it) => it.name)) !== null && _c !== void 0 ? _c :
|
|
120
|
-
build: (
|
|
112
|
+
roles: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.roles.map((it) => it.name)) !== null && _c !== void 0 ? _c : [],
|
|
113
|
+
build: (operations) => {
|
|
121
114
|
var _a;
|
|
122
115
|
(_a = pointer.value) !== null && _a !== void 0 ? _a : (pointer.value = []);
|
|
123
|
-
|
|
116
|
+
const matrix = operations.map((op) => {
|
|
117
|
+
if (op.authorizationRoles.length === 0)
|
|
118
|
+
return [
|
|
119
|
+
Object.assign(Object.assign({}, op), { path: "/" +
|
|
120
|
+
[prefix, ...op.path.split("/")]
|
|
121
|
+
.filter((it) => it !== "")
|
|
122
|
+
.join("/"), authorizationRole: null }),
|
|
123
|
+
];
|
|
124
|
+
return op.authorizationRoles.map((role) => (Object.assign(Object.assign({}, op), { path: "/" +
|
|
125
|
+
[prefix, role, ...op.path.split("/")]
|
|
126
|
+
.filter((it) => it !== "")
|
|
127
|
+
.join("/"), authorizationRole: role })));
|
|
128
|
+
});
|
|
129
|
+
progress.completed += matrix.flat().length;
|
|
130
|
+
progress.total += matrix
|
|
131
|
+
.filter((it) => it.length > 1)
|
|
132
|
+
.map((it) => it.length - 1)
|
|
133
|
+
.reduce((a, b) => a + b, 0);
|
|
134
|
+
pointer.value.push(...matrix.flat());
|
|
124
135
|
},
|
|
125
136
|
}),
|
|
126
137
|
],
|
|
127
138
|
});
|
|
128
139
|
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
129
|
-
yield agentica
|
|
130
|
-
.conversate([
|
|
131
|
-
"Make API operations for below endpoints:",
|
|
132
|
-
"",
|
|
133
|
-
"**CRITICAL INSTRUCTIONS**:",
|
|
134
|
-
"1. Base ALL operation descriptions on ACTUAL fields in the Prisma schema",
|
|
135
|
-
"2. NEVER reference fields that don't exist (e.g., deleted_at, created_by, updated_by)",
|
|
136
|
-
"3. For DELETE operations:",
|
|
137
|
-
" - Check if the entity has soft delete fields in the schema",
|
|
138
|
-
" - If YES: Describe soft delete behavior using those fields",
|
|
139
|
-
" - If NO: Describe hard delete behavior (permanent removal)",
|
|
140
|
-
"4. Every field mentioned in descriptions MUST exist in the Prisma schema",
|
|
141
|
-
"",
|
|
142
|
-
"```json",
|
|
143
|
-
JSON.stringify(Array.from(endpoints), null, 2),
|
|
144
|
-
"```",
|
|
145
|
-
].join("\n"))
|
|
146
|
-
.finally(() => {
|
|
140
|
+
yield agentica.conversate("Make API operations").finally(() => {
|
|
147
141
|
const tokenUsage = agentica.getTokenUsage();
|
|
148
142
|
ctx.usage().record(tokenUsage, ["interface"]);
|
|
149
143
|
});
|
|
@@ -156,7 +150,7 @@ function createApplication(props) {
|
|
|
156
150
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
157
151
|
const application = collection[props.model];
|
|
158
152
|
application.functions[0].validate = (next) => {
|
|
159
|
-
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
|
|
153
|
+
const result = (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => Array.isArray(input.authorizationRoles) && input.authorizationRoles.every(elem => "string" === typeof elem && 1 <= elem.length) && "string" === typeof input.description && "string" === typeof input.name && "string" === typeof input.specification && "string" === typeof input.summary && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && (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)) && ("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 => (() => {
|
|
160
154
|
if ("number" === input.type)
|
|
161
155
|
return _io4(input);
|
|
162
156
|
else if ("integer" === input.type)
|
|
@@ -167,42 +161,70 @@ function createApplication(props) {
|
|
|
167
161
|
return false;
|
|
168
162
|
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
169
163
|
path: _path + ".operations",
|
|
170
|
-
expected: "Array<
|
|
164
|
+
expected: "Array<IAutoBeInterfaceOperationApplication.IOperation>",
|
|
171
165
|
value: input.operations
|
|
172
|
-
})) && input.operations.map((elem,
|
|
173
|
-
path: _path + ".operations[" +
|
|
174
|
-
expected: "
|
|
166
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
167
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
168
|
+
expected: "IAutoBeInterfaceOperationApplication.IOperation",
|
|
175
169
|
value: elem
|
|
176
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
177
|
-
path: _path + ".operations[" +
|
|
178
|
-
expected: "
|
|
170
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
171
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
172
|
+
expected: "IAutoBeInterfaceOperationApplication.IOperation",
|
|
179
173
|
value: elem
|
|
180
174
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
181
175
|
path: _path + ".operations",
|
|
182
|
-
expected: "Array<
|
|
176
|
+
expected: "Array<IAutoBeInterfaceOperationApplication.IOperation>",
|
|
183
177
|
value: input.operations
|
|
184
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [
|
|
185
|
-
path: _path + ".
|
|
186
|
-
expected: "string",
|
|
187
|
-
value: input.
|
|
178
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [(Array.isArray(input.authorizationRoles) || _report(_exceptionable, {
|
|
179
|
+
path: _path + ".authorizationRoles",
|
|
180
|
+
expected: "Array<string & MinLength<1>>",
|
|
181
|
+
value: input.authorizationRoles
|
|
182
|
+
})) && input.authorizationRoles.map((elem, _index5) => "string" === typeof elem && (1 <= elem.length || _report(_exceptionable, {
|
|
183
|
+
path: _path + ".authorizationRoles[" + _index5 + "]",
|
|
184
|
+
expected: "string & MinLength<1>",
|
|
185
|
+
value: elem
|
|
186
|
+
})) || _report(_exceptionable, {
|
|
187
|
+
path: _path + ".authorizationRoles[" + _index5 + "]",
|
|
188
|
+
expected: "(string & MinLength<1>)",
|
|
189
|
+
value: elem
|
|
190
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
191
|
+
path: _path + ".authorizationRoles",
|
|
192
|
+
expected: "Array<string & MinLength<1>>",
|
|
193
|
+
value: input.authorizationRoles
|
|
188
194
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
189
195
|
path: _path + ".description",
|
|
190
196
|
expected: "string",
|
|
191
197
|
value: input.description
|
|
198
|
+
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
199
|
+
path: _path + ".name",
|
|
200
|
+
expected: "string",
|
|
201
|
+
value: input.name
|
|
202
|
+
}), "string" === typeof input.specification || _report(_exceptionable, {
|
|
203
|
+
path: _path + ".specification",
|
|
204
|
+
expected: "string",
|
|
205
|
+
value: input.specification
|
|
192
206
|
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
193
207
|
path: _path + ".summary",
|
|
194
208
|
expected: "string",
|
|
195
209
|
value: input.summary
|
|
210
|
+
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
211
|
+
path: _path + ".path",
|
|
212
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
213
|
+
value: input.path
|
|
214
|
+
})) || _report(_exceptionable, {
|
|
215
|
+
path: _path + ".path",
|
|
216
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
217
|
+
value: input.path
|
|
196
218
|
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
197
219
|
path: _path + ".parameters",
|
|
198
220
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
199
221
|
value: input.parameters
|
|
200
|
-
})) && input.parameters.map((elem,
|
|
201
|
-
path: _path + ".parameters[" +
|
|
222
|
+
})) && input.parameters.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
223
|
+
path: _path + ".parameters[" + _index6 + "]",
|
|
202
224
|
expected: "AutoBeOpenApi.IParameter",
|
|
203
225
|
value: elem
|
|
204
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
205
|
-
path: _path + ".parameters[" +
|
|
226
|
+
})) && _vo2(elem, _path + ".parameters[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
227
|
+
path: _path + ".parameters[" + _index6 + "]",
|
|
206
228
|
expected: "AutoBeOpenApi.IParameter",
|
|
207
229
|
value: elem
|
|
208
230
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -225,22 +247,6 @@ function createApplication(props) {
|
|
|
225
247
|
path: _path + ".responseBody",
|
|
226
248
|
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
227
249
|
value: input.responseBody
|
|
228
|
-
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
229
|
-
path: _path + ".authorizationRole",
|
|
230
|
-
expected: "string & MinLength<1>",
|
|
231
|
-
value: input.authorizationRole
|
|
232
|
-
})) || _report(_exceptionable, {
|
|
233
|
-
path: _path + ".authorizationRole",
|
|
234
|
-
expected: "((string & MinLength<1>) | null)",
|
|
235
|
-
value: input.authorizationRole
|
|
236
|
-
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
237
|
-
path: _path + ".name",
|
|
238
|
-
expected: "string",
|
|
239
|
-
value: input.name
|
|
240
|
-
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
241
|
-
path: _path + ".path",
|
|
242
|
-
expected: "string",
|
|
243
|
-
value: input.path
|
|
244
250
|
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
245
251
|
path: _path + ".method",
|
|
246
252
|
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
@@ -396,11 +402,11 @@ function createApplication(props) {
|
|
|
396
402
|
_report = __typia_transform__validateReport._validateReport(errors);
|
|
397
403
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
398
404
|
path: _path + "",
|
|
399
|
-
expected: "
|
|
405
|
+
expected: "IAutoBeInterfaceOperationApplication.IProps",
|
|
400
406
|
value: input
|
|
401
407
|
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
402
408
|
path: _path + "",
|
|
403
|
-
expected: "
|
|
409
|
+
expected: "IAutoBeInterfaceOperationApplication.IProps",
|
|
404
410
|
value: input
|
|
405
411
|
}))(input, "$input", true);
|
|
406
412
|
const success = 0 === errors.length;
|
|
@@ -420,30 +426,33 @@ function createApplication(props) {
|
|
|
420
426
|
}; })()(next);
|
|
421
427
|
if (result.success === false)
|
|
422
428
|
return result;
|
|
429
|
+
const operations = result.data.operations;
|
|
423
430
|
const errors = [];
|
|
424
|
-
|
|
425
|
-
var _a, _b, _c;
|
|
431
|
+
operations.forEach((op, i) => {
|
|
426
432
|
if (op.method === "get" && op.requestBody !== null)
|
|
427
433
|
errors.push({
|
|
428
|
-
path:
|
|
434
|
+
path: `$input.operations[${i}].requestBody`,
|
|
429
435
|
expected: "GET method should not have request body. Change method, or re-design the operation.",
|
|
430
436
|
value: op.requestBody,
|
|
431
437
|
});
|
|
432
|
-
if (props.roles ===
|
|
433
|
-
op.
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
`
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
438
|
+
if (props.roles.length === 0)
|
|
439
|
+
op.authorizationRoles = [];
|
|
440
|
+
else if (op.authorizationRoles.length !== 0 && props.roles.length !== 0)
|
|
441
|
+
op.authorizationRoles.forEach((role, j) => {
|
|
442
|
+
if (props.roles.includes(role) === true)
|
|
443
|
+
return;
|
|
444
|
+
errors.push({
|
|
445
|
+
path: `$input.operations[${i}].authorizationRoles[${j}]`,
|
|
446
|
+
expected: `null | ${props.roles.map((str) => JSON.stringify(str)).join(" | ")}`,
|
|
447
|
+
description: [
|
|
448
|
+
`Role "${role}" is not defined in the roles list.`,
|
|
449
|
+
"",
|
|
450
|
+
"Please select one of them below, or do not define (`null`): ",
|
|
451
|
+
"",
|
|
452
|
+
...props.roles.map((role) => `- ${role}`),
|
|
453
|
+
].join("\n"),
|
|
454
|
+
value: role,
|
|
455
|
+
});
|
|
447
456
|
});
|
|
448
457
|
});
|
|
449
458
|
if (errors.length !== 0)
|
|
@@ -475,14 +484,14 @@ const claude = {
|
|
|
475
484
|
{
|
|
476
485
|
name: "makeOperations",
|
|
477
486
|
parameters: {
|
|
478
|
-
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link
|
|
487
|
+
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link IAutoBeInterfaceOperationApplication.IProps}",
|
|
479
488
|
type: "object",
|
|
480
489
|
properties: {
|
|
481
490
|
operations: {
|
|
482
|
-
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
|
|
491
|
+
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\n schema 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\ncreation (POST), use .ICreate request body. For modification (PUT), use\n.IUpdate request body.",
|
|
483
492
|
type: "array",
|
|
484
493
|
items: {
|
|
485
|
-
$ref: "#/$defs/
|
|
494
|
+
$ref: "#/$defs/IAutoBeInterfaceOperationApplication.IOperation"
|
|
486
495
|
}
|
|
487
496
|
}
|
|
488
497
|
},
|
|
@@ -491,22 +500,39 @@ const claude = {
|
|
|
491
500
|
],
|
|
492
501
|
additionalProperties: false,
|
|
493
502
|
$defs: {
|
|
494
|
-
"
|
|
503
|
+
"IAutoBeInterfaceOperationApplication.IOperation": {
|
|
495
504
|
description: "Operation of the Restful API.\n\nThis 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\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn 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```",
|
|
496
505
|
type: "object",
|
|
497
506
|
properties: {
|
|
498
|
-
|
|
499
|
-
description: "
|
|
500
|
-
type: "
|
|
507
|
+
authorizationRoles: {
|
|
508
|
+
description: "Authorization roles required to access this API operation.\n\nThis field specifies which user roles are allowed to access this\nendpoint. Multiple roles can be specified to allow different types of\nusers to access the same endpoint.\n\n## Important Guidelines\n\n- Set to empty array `[]` for public endpoints that require no\n authentication\n- Set to array with role strings for role-restricted endpoints\n- The role names MUST match exactly with the user type/role defined in the\n database\n- This will be used by the Realize Agent to generate appropriate decorator\n and authorization logic in the provider functions\n- The controller will apply the corresponding authentication decorator\n based on these roles\n\n## Examples\n\n- `[]` - Public endpoint, no authentication required\n- `[\"user\"]` - Any authenticated user can access\n- `[\"admin\"]` - Only admin users can access\n- `[\"admin\", \"moderator\"]` - Both admin and moderator users can access\n- `[\"seller\"]` - Only seller users can access\n\nNote: The actual authentication/authorization implementation will be\nhandled by decorators at the controller level, and the provider function\nwill receive the authenticated user object with the appropriate type.",
|
|
509
|
+
type: "array",
|
|
510
|
+
items: {
|
|
511
|
+
type: "string",
|
|
512
|
+
minLength: 1
|
|
513
|
+
}
|
|
501
514
|
},
|
|
502
515
|
description: {
|
|
503
516
|
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.",
|
|
504
517
|
type: "string"
|
|
505
518
|
},
|
|
519
|
+
name: {
|
|
520
|
+
description: "Functional name of the API endpoint.\n\nThis is a semantic identifier that represents the primary function or\npurpose of the API endpoint. It serves as a canonical name that can be\nused for code generation, SDK method names, and internal references.\n\n## Standard Endpoint Names\n\nUse these conventional names based on the endpoint's primary function:\n\n- **`index`**: List/search operations that return multiple entities\n\n - Typically used with PATCH method for complex queries\n - Example: `PATCH /users` \u2192 `name: \"index\"`\n- **`at`**: Retrieve a specific entity by identifier\n\n - Typically used with GET method on single resource\n - Example: `GET /users/{userId}` \u2192 `name: \"at\"`\n- **`create`**: Create a new entity\n\n - Typically used with POST method\n - Example: `POST /users` \u2192 `name: \"create\"`\n- **`update`**: Update an existing entity\n\n - Typically used with PUT method\n - Example: `PUT /users/{userId}` \u2192 `name: \"update\"`\n- **`erase`**: Delete/remove an entity\n\n - Typically used with DELETE method\n - Example: `DELETE /users/{userId}` \u2192 `name: \"erase\"`\n\n## Custom Endpoint Names\n\nFor specialized operations beyond basic CRUD, use descriptive verbs:\n\n- **`activate`**: Enable or turn on a feature/entity\n- **`deactivate`**: Disable or turn off a feature/entity\n- **`approve`**: Approve a request or entity\n- **`reject`**: Reject a request or entity\n- **`publish`**: Make content publicly available\n- **`archive`**: Move to archived state\n- **`restore`**: Restore from archived/deleted state\n- **`duplicate`**: Create a copy of an entity\n- **`transfer`**: Move ownership or change assignment\n- **`validate`**: Validate data or state\n- **`process`**: Execute a business process or workflow\n- **`export`**: Generate downloadable data\n- **`import`**: Process uploaded data\n\n## Naming Guidelines\n\n- Use lowercase, singular verb forms\n- Be concise but descriptive\n- Avoid abbreviations unless widely understood\n- Ensure the name clearly represents the endpoint's primary action\n- For nested resources, focus on the action rather than hierarchy\n\nExamples:\n\n- `GET /shopping/orders/{orderId}/items` \u2192 `name: \"index\"` (lists items)\n- `POST /shopping/orders/{orderId}/cancel` \u2192 `name: \"cancel\"`\n- `PUT /users/{userId}/password` \u2192 `name: \"updatePassword\"`",
|
|
521
|
+
type: "string"
|
|
522
|
+
},
|
|
523
|
+
specification: {
|
|
524
|
+
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.",
|
|
525
|
+
type: "string"
|
|
526
|
+
},
|
|
506
527
|
summary: {
|
|
507
528
|
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",
|
|
508
529
|
type: "string"
|
|
509
530
|
},
|
|
531
|
+
path: {
|
|
532
|
+
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)",
|
|
533
|
+
type: "string",
|
|
534
|
+
pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
|
|
535
|
+
},
|
|
510
536
|
parameters: {
|
|
511
537
|
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`",
|
|
512
538
|
type: "array",
|
|
@@ -536,26 +562,6 @@ const claude = {
|
|
|
536
562
|
}
|
|
537
563
|
]
|
|
538
564
|
},
|
|
539
|
-
authorizationRole: {
|
|
540
|
-
description: "Authorization role required to access this API operation.\n\nThis field specifies which user role is allowed to access this endpoint.\nThe role name must correspond exactly to the actual roles defined in your\nsystem's Prisma schema (e.g., \"admin\", \"administrator\", \"moderator\",\n\"seller\", \"buyer\", etc.).\n\n## Role-Based Path Convention\n\nWhen authorizationRole is specified, it should align with the path\nstructure:\n\n- If authorizationRole is \"admin\" \u2192 path might be \"/admin/resources/{id}\"\n- If authorizationRole is \"seller\" \u2192 path might be \"/seller/products\"\n- Special case: For user's own resources, use path prefix \"/my/\" regardless\n of role\n\n## Important Guidelines\n\n- Set to `null` for public endpoints that require no authentication\n- Set to specific role string for role-restricted endpoints\n- The role name MUST match exactly with the user type/role defined in the\n database\n- This role will be used by the Realize Agent to generate appropriate\n decorator and authorization logic in the provider functions\n- The controller will apply the corresponding authentication decorator\n based on this role\n\n## Examples\n\n- `null` - Public endpoint, no authentication required\n- `\"user\"` - Any authenticated user can access\n- `\"admin\"` - Only admin users can access\n- `\"seller\"` - Only seller users can access\n- `\"moderator\"` - Only moderator users can access\n\nNote: The actual authentication/authorization implementation will be\nhandled by decorators at the controller level, and the provider function\nwill receive the authenticated user object with the appropriate type.",
|
|
541
|
-
oneOf: [
|
|
542
|
-
{
|
|
543
|
-
type: "null"
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
type: "string",
|
|
547
|
-
minLength: 1
|
|
548
|
-
}
|
|
549
|
-
]
|
|
550
|
-
},
|
|
551
|
-
name: {
|
|
552
|
-
description: "Functional name of the API endpoint.\n\nThis is a semantic identifier that represents the primary function or\npurpose of the API endpoint. It serves as a canonical name that can be\nused for code generation, SDK method names, and internal references.\n\n## Standard Endpoint Names\n\nUse these conventional names based on the endpoint's primary function:\n\n- **`index`**: List/search operations that return multiple entities\n\n - Typically used with PATCH method for complex queries\n - Example: `PATCH /users` \u2192 `name: \"index\"`\n- **`at`**: Retrieve a specific entity by identifier\n\n - Typically used with GET method on single resource\n - Example: `GET /users/{userId}` \u2192 `name: \"at\"`\n- **`create`**: Create a new entity\n\n - Typically used with POST method\n - Example: `POST /users` \u2192 `name: \"create\"`\n- **`update`**: Update an existing entity\n\n - Typically used with PUT method\n - Example: `PUT /users/{userId}` \u2192 `name: \"update\"`\n- **`erase`**: Delete/remove an entity\n\n - Typically used with DELETE method\n - Example: `DELETE /users/{userId}` \u2192 `name: \"erase\"`\n\n## Custom Endpoint Names\n\nFor specialized operations beyond basic CRUD, use descriptive verbs:\n\n- **`activate`**: Enable or turn on a feature/entity\n- **`deactivate`**: Disable or turn off a feature/entity\n- **`approve`**: Approve a request or entity\n- **`reject`**: Reject a request or entity\n- **`publish`**: Make content publicly available\n- **`archive`**: Move to archived state\n- **`restore`**: Restore from archived/deleted state\n- **`duplicate`**: Create a copy of an entity\n- **`transfer`**: Move ownership or change assignment\n- **`validate`**: Validate data or state\n- **`process`**: Execute a business process or workflow\n- **`export`**: Generate downloadable data\n- **`import`**: Process uploaded data\n\n## Naming Guidelines\n\n- Use lowercase, singular verb forms\n- Be concise but descriptive\n- Avoid abbreviations unless widely understood\n- Ensure the name clearly represents the endpoint's primary action\n- For nested resources, focus on the action rather than hierarchy\n\nExamples:\n\n- `GET /shopping/orders/{orderId}/items` \u2192 `name: \"index\"` (lists items)\n- `POST /shopping/orders/{orderId}/cancel` \u2192 `name: \"cancel\"`\n- `PUT /users/{userId}/password` \u2192 `name: \"updatePassword\"`",
|
|
553
|
-
type: "string"
|
|
554
|
-
},
|
|
555
|
-
path: {
|
|
556
|
-
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.",
|
|
557
|
-
type: "string"
|
|
558
|
-
},
|
|
559
565
|
method: {
|
|
560
566
|
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",
|
|
561
567
|
oneOf: [
|
|
@@ -578,15 +584,15 @@ const claude = {
|
|
|
578
584
|
}
|
|
579
585
|
},
|
|
580
586
|
required: [
|
|
581
|
-
"
|
|
587
|
+
"authorizationRoles",
|
|
582
588
|
"description",
|
|
589
|
+
"name",
|
|
590
|
+
"specification",
|
|
583
591
|
"summary",
|
|
592
|
+
"path",
|
|
584
593
|
"parameters",
|
|
585
594
|
"requestBody",
|
|
586
595
|
"responseBody",
|
|
587
|
-
"authorizationRole",
|
|
588
|
-
"name",
|
|
589
|
-
"path",
|
|
590
596
|
"method"
|
|
591
597
|
]
|
|
592
598
|
},
|
|
@@ -773,7 +779,7 @@ const claude = {
|
|
|
773
779
|
}
|
|
774
780
|
},
|
|
775
781
|
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.",
|
|
776
|
-
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof
|
|
782
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => Array.isArray(input.authorizationRoles) && input.authorizationRoles.every(elem => "string" === typeof elem && 1 <= elem.length) && "string" === typeof input.description && "string" === typeof input.name && "string" === typeof input.specification && "string" === typeof input.summary && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && (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)) && ("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 => (() => {
|
|
777
783
|
if ("number" === input.type)
|
|
778
784
|
return _io4(input);
|
|
779
785
|
else if ("integer" === input.type)
|
|
@@ -784,42 +790,70 @@ const claude = {
|
|
|
784
790
|
return false;
|
|
785
791
|
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
786
792
|
path: _path + ".operations",
|
|
787
|
-
expected: "Array<
|
|
793
|
+
expected: "Array<IAutoBeInterfaceOperationApplication.IOperation>",
|
|
788
794
|
value: input.operations
|
|
789
|
-
})) && input.operations.map((elem,
|
|
790
|
-
path: _path + ".operations[" +
|
|
791
|
-
expected: "
|
|
795
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
796
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
797
|
+
expected: "IAutoBeInterfaceOperationApplication.IOperation",
|
|
792
798
|
value: elem
|
|
793
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
794
|
-
path: _path + ".operations[" +
|
|
795
|
-
expected: "
|
|
799
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
800
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
801
|
+
expected: "IAutoBeInterfaceOperationApplication.IOperation",
|
|
796
802
|
value: elem
|
|
797
803
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
798
804
|
path: _path + ".operations",
|
|
799
|
-
expected: "Array<
|
|
805
|
+
expected: "Array<IAutoBeInterfaceOperationApplication.IOperation>",
|
|
800
806
|
value: input.operations
|
|
801
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [
|
|
802
|
-
path: _path + ".
|
|
803
|
-
expected: "string",
|
|
804
|
-
value: input.
|
|
807
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [(Array.isArray(input.authorizationRoles) || _report(_exceptionable, {
|
|
808
|
+
path: _path + ".authorizationRoles",
|
|
809
|
+
expected: "Array<string & MinLength<1>>",
|
|
810
|
+
value: input.authorizationRoles
|
|
811
|
+
})) && input.authorizationRoles.map((elem, _index5) => "string" === typeof elem && (1 <= elem.length || _report(_exceptionable, {
|
|
812
|
+
path: _path + ".authorizationRoles[" + _index5 + "]",
|
|
813
|
+
expected: "string & MinLength<1>",
|
|
814
|
+
value: elem
|
|
815
|
+
})) || _report(_exceptionable, {
|
|
816
|
+
path: _path + ".authorizationRoles[" + _index5 + "]",
|
|
817
|
+
expected: "(string & MinLength<1>)",
|
|
818
|
+
value: elem
|
|
819
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
820
|
+
path: _path + ".authorizationRoles",
|
|
821
|
+
expected: "Array<string & MinLength<1>>",
|
|
822
|
+
value: input.authorizationRoles
|
|
805
823
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
806
824
|
path: _path + ".description",
|
|
807
825
|
expected: "string",
|
|
808
826
|
value: input.description
|
|
827
|
+
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
828
|
+
path: _path + ".name",
|
|
829
|
+
expected: "string",
|
|
830
|
+
value: input.name
|
|
831
|
+
}), "string" === typeof input.specification || _report(_exceptionable, {
|
|
832
|
+
path: _path + ".specification",
|
|
833
|
+
expected: "string",
|
|
834
|
+
value: input.specification
|
|
809
835
|
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
810
836
|
path: _path + ".summary",
|
|
811
837
|
expected: "string",
|
|
812
838
|
value: input.summary
|
|
839
|
+
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
840
|
+
path: _path + ".path",
|
|
841
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
842
|
+
value: input.path
|
|
843
|
+
})) || _report(_exceptionable, {
|
|
844
|
+
path: _path + ".path",
|
|
845
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
846
|
+
value: input.path
|
|
813
847
|
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
814
848
|
path: _path + ".parameters",
|
|
815
849
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
816
850
|
value: input.parameters
|
|
817
|
-
})) && input.parameters.map((elem,
|
|
818
|
-
path: _path + ".parameters[" +
|
|
851
|
+
})) && input.parameters.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
852
|
+
path: _path + ".parameters[" + _index6 + "]",
|
|
819
853
|
expected: "AutoBeOpenApi.IParameter",
|
|
820
854
|
value: elem
|
|
821
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
822
|
-
path: _path + ".parameters[" +
|
|
855
|
+
})) && _vo2(elem, _path + ".parameters[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
856
|
+
path: _path + ".parameters[" + _index6 + "]",
|
|
823
857
|
expected: "AutoBeOpenApi.IParameter",
|
|
824
858
|
value: elem
|
|
825
859
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -842,22 +876,6 @@ const claude = {
|
|
|
842
876
|
path: _path + ".responseBody",
|
|
843
877
|
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
844
878
|
value: input.responseBody
|
|
845
|
-
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
846
|
-
path: _path + ".authorizationRole",
|
|
847
|
-
expected: "string & MinLength<1>",
|
|
848
|
-
value: input.authorizationRole
|
|
849
|
-
})) || _report(_exceptionable, {
|
|
850
|
-
path: _path + ".authorizationRole",
|
|
851
|
-
expected: "((string & MinLength<1>) | null)",
|
|
852
|
-
value: input.authorizationRole
|
|
853
|
-
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
854
|
-
path: _path + ".name",
|
|
855
|
-
expected: "string",
|
|
856
|
-
value: input.name
|
|
857
|
-
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
858
|
-
path: _path + ".path",
|
|
859
|
-
expected: "string",
|
|
860
|
-
value: input.path
|
|
861
879
|
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
862
880
|
path: _path + ".method",
|
|
863
881
|
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
@@ -1013,11 +1031,11 @@ const claude = {
|
|
|
1013
1031
|
_report = __typia_transform__validateReport._validateReport(errors);
|
|
1014
1032
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
1015
1033
|
path: _path + "",
|
|
1016
|
-
expected: "
|
|
1034
|
+
expected: "IAutoBeInterfaceOperationApplication.IProps",
|
|
1017
1035
|
value: input
|
|
1018
1036
|
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
1019
1037
|
path: _path + "",
|
|
1020
|
-
expected: "
|
|
1038
|
+
expected: "IAutoBeInterfaceOperationApplication.IProps",
|
|
1021
1039
|
value: input
|
|
1022
1040
|
}))(input, "$input", true);
|
|
1023
1041
|
const success = 0 === errors.length;
|
|
@@ -1050,14 +1068,14 @@ const collection = {
|
|
|
1050
1068
|
{
|
|
1051
1069
|
name: "makeOperations",
|
|
1052
1070
|
parameters: {
|
|
1053
|
-
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link
|
|
1071
|
+
description: " Properties containing the operations to generate.\n\n------------------------------\n\nCurrent Type: {@link IAutoBeInterfaceOperationApplication.IProps}",
|
|
1054
1072
|
type: "object",
|
|
1055
1073
|
properties: {
|
|
1056
1074
|
operations: {
|
|
1057
|
-
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
|
|
1075
|
+
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\n schema 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\ncreation (POST), use .ICreate request body. For modification (PUT), use\n.IUpdate request body.",
|
|
1058
1076
|
type: "array",
|
|
1059
1077
|
items: {
|
|
1060
|
-
$ref: "#/$defs/
|
|
1078
|
+
$ref: "#/$defs/IAutoBeInterfaceOperationApplication.IOperation"
|
|
1061
1079
|
}
|
|
1062
1080
|
}
|
|
1063
1081
|
},
|
|
@@ -1066,22 +1084,38 @@ const collection = {
|
|
|
1066
1084
|
],
|
|
1067
1085
|
additionalProperties: false,
|
|
1068
1086
|
$defs: {
|
|
1069
|
-
"
|
|
1087
|
+
"IAutoBeInterfaceOperationApplication.IOperation": {
|
|
1070
1088
|
description: "Operation of the Restful API.\n\nThis 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\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn 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```",
|
|
1071
1089
|
type: "object",
|
|
1072
1090
|
properties: {
|
|
1073
|
-
|
|
1074
|
-
description: "
|
|
1075
|
-
type: "
|
|
1091
|
+
authorizationRoles: {
|
|
1092
|
+
description: "Authorization roles required to access this API operation.\n\nThis field specifies which user roles are allowed to access this\nendpoint. Multiple roles can be specified to allow different types of\nusers to access the same endpoint.\n\n## Important Guidelines\n\n- Set to empty array `[]` for public endpoints that require no\n authentication\n- Set to array with role strings for role-restricted endpoints\n- The role names MUST match exactly with the user type/role defined in the\n database\n- This will be used by the Realize Agent to generate appropriate decorator\n and authorization logic in the provider functions\n- The controller will apply the corresponding authentication decorator\n based on these roles\n\n## Examples\n\n- `[]` - Public endpoint, no authentication required\n- `[\"user\"]` - Any authenticated user can access\n- `[\"admin\"]` - Only admin users can access\n- `[\"admin\", \"moderator\"]` - Both admin and moderator users can access\n- `[\"seller\"]` - Only seller users can access\n\nNote: The actual authentication/authorization implementation will be\nhandled by decorators at the controller level, and the provider function\nwill receive the authenticated user object with the appropriate type.",
|
|
1093
|
+
type: "array",
|
|
1094
|
+
items: {
|
|
1095
|
+
description: "@minLength 1",
|
|
1096
|
+
type: "string"
|
|
1097
|
+
}
|
|
1076
1098
|
},
|
|
1077
1099
|
description: {
|
|
1078
1100
|
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.",
|
|
1079
1101
|
type: "string"
|
|
1080
1102
|
},
|
|
1103
|
+
name: {
|
|
1104
|
+
description: "Functional name of the API endpoint.\n\nThis is a semantic identifier that represents the primary function or\npurpose of the API endpoint. It serves as a canonical name that can be\nused for code generation, SDK method names, and internal references.\n\n## Standard Endpoint Names\n\nUse these conventional names based on the endpoint's primary function:\n\n- **`index`**: List/search operations that return multiple entities\n\n - Typically used with PATCH method for complex queries\n - Example: `PATCH /users` \u2192 `name: \"index\"`\n- **`at`**: Retrieve a specific entity by identifier\n\n - Typically used with GET method on single resource\n - Example: `GET /users/{userId}` \u2192 `name: \"at\"`\n- **`create`**: Create a new entity\n\n - Typically used with POST method\n - Example: `POST /users` \u2192 `name: \"create\"`\n- **`update`**: Update an existing entity\n\n - Typically used with PUT method\n - Example: `PUT /users/{userId}` \u2192 `name: \"update\"`\n- **`erase`**: Delete/remove an entity\n\n - Typically used with DELETE method\n - Example: `DELETE /users/{userId}` \u2192 `name: \"erase\"`\n\n## Custom Endpoint Names\n\nFor specialized operations beyond basic CRUD, use descriptive verbs:\n\n- **`activate`**: Enable or turn on a feature/entity\n- **`deactivate`**: Disable or turn off a feature/entity\n- **`approve`**: Approve a request or entity\n- **`reject`**: Reject a request or entity\n- **`publish`**: Make content publicly available\n- **`archive`**: Move to archived state\n- **`restore`**: Restore from archived/deleted state\n- **`duplicate`**: Create a copy of an entity\n- **`transfer`**: Move ownership or change assignment\n- **`validate`**: Validate data or state\n- **`process`**: Execute a business process or workflow\n- **`export`**: Generate downloadable data\n- **`import`**: Process uploaded data\n\n## Naming Guidelines\n\n- Use lowercase, singular verb forms\n- Be concise but descriptive\n- Avoid abbreviations unless widely understood\n- Ensure the name clearly represents the endpoint's primary action\n- For nested resources, focus on the action rather than hierarchy\n\nExamples:\n\n- `GET /shopping/orders/{orderId}/items` \u2192 `name: \"index\"` (lists items)\n- `POST /shopping/orders/{orderId}/cancel` \u2192 `name: \"cancel\"`\n- `PUT /users/{userId}/password` \u2192 `name: \"updatePassword\"`",
|
|
1105
|
+
type: "string"
|
|
1106
|
+
},
|
|
1107
|
+
specification: {
|
|
1108
|
+
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.",
|
|
1109
|
+
type: "string"
|
|
1110
|
+
},
|
|
1081
1111
|
summary: {
|
|
1082
1112
|
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",
|
|
1083
1113
|
type: "string"
|
|
1084
1114
|
},
|
|
1115
|
+
path: {
|
|
1116
|
+
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)\n\n\n@pattern ^\\/[a-zA-Z0-9\\/_{}.-]*$",
|
|
1117
|
+
type: "string"
|
|
1118
|
+
},
|
|
1085
1119
|
parameters: {
|
|
1086
1120
|
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`",
|
|
1087
1121
|
type: "array",
|
|
@@ -1111,26 +1145,6 @@ const collection = {
|
|
|
1111
1145
|
}
|
|
1112
1146
|
]
|
|
1113
1147
|
},
|
|
1114
|
-
authorizationRole: {
|
|
1115
|
-
description: "Authorization role required to access this API operation.\n\nThis field specifies which user role is allowed to access this endpoint.\nThe role name must correspond exactly to the actual roles defined in your\nsystem's Prisma schema (e.g., \"admin\", \"administrator\", \"moderator\",\n\"seller\", \"buyer\", etc.).\n\n## Role-Based Path Convention\n\nWhen authorizationRole is specified, it should align with the path\nstructure:\n\n- If authorizationRole is \"admin\" \u2192 path might be \"/admin/resources/{id}\"\n- If authorizationRole is \"seller\" \u2192 path might be \"/seller/products\"\n- Special case: For user's own resources, use path prefix \"/my/\" regardless\n of role\n\n## Important Guidelines\n\n- Set to `null` for public endpoints that require no authentication\n- Set to specific role string for role-restricted endpoints\n- The role name MUST match exactly with the user type/role defined in the\n database\n- This role will be used by the Realize Agent to generate appropriate\n decorator and authorization logic in the provider functions\n- The controller will apply the corresponding authentication decorator\n based on this role\n\n## Examples\n\n- `null` - Public endpoint, no authentication required\n- `\"user\"` - Any authenticated user can access\n- `\"admin\"` - Only admin users can access\n- `\"seller\"` - Only seller users can access\n- `\"moderator\"` - Only moderator users can access\n\nNote: The actual authentication/authorization implementation will be\nhandled by decorators at the controller level, and the provider function\nwill receive the authenticated user object with the appropriate type.",
|
|
1116
|
-
anyOf: [
|
|
1117
|
-
{
|
|
1118
|
-
type: "null"
|
|
1119
|
-
},
|
|
1120
|
-
{
|
|
1121
|
-
type: "string",
|
|
1122
|
-
description: "@minLength 1"
|
|
1123
|
-
}
|
|
1124
|
-
]
|
|
1125
|
-
},
|
|
1126
|
-
name: {
|
|
1127
|
-
description: "Functional name of the API endpoint.\n\nThis is a semantic identifier that represents the primary function or\npurpose of the API endpoint. It serves as a canonical name that can be\nused for code generation, SDK method names, and internal references.\n\n## Standard Endpoint Names\n\nUse these conventional names based on the endpoint's primary function:\n\n- **`index`**: List/search operations that return multiple entities\n\n - Typically used with PATCH method for complex queries\n - Example: `PATCH /users` \u2192 `name: \"index\"`\n- **`at`**: Retrieve a specific entity by identifier\n\n - Typically used with GET method on single resource\n - Example: `GET /users/{userId}` \u2192 `name: \"at\"`\n- **`create`**: Create a new entity\n\n - Typically used with POST method\n - Example: `POST /users` \u2192 `name: \"create\"`\n- **`update`**: Update an existing entity\n\n - Typically used with PUT method\n - Example: `PUT /users/{userId}` \u2192 `name: \"update\"`\n- **`erase`**: Delete/remove an entity\n\n - Typically used with DELETE method\n - Example: `DELETE /users/{userId}` \u2192 `name: \"erase\"`\n\n## Custom Endpoint Names\n\nFor specialized operations beyond basic CRUD, use descriptive verbs:\n\n- **`activate`**: Enable or turn on a feature/entity\n- **`deactivate`**: Disable or turn off a feature/entity\n- **`approve`**: Approve a request or entity\n- **`reject`**: Reject a request or entity\n- **`publish`**: Make content publicly available\n- **`archive`**: Move to archived state\n- **`restore`**: Restore from archived/deleted state\n- **`duplicate`**: Create a copy of an entity\n- **`transfer`**: Move ownership or change assignment\n- **`validate`**: Validate data or state\n- **`process`**: Execute a business process or workflow\n- **`export`**: Generate downloadable data\n- **`import`**: Process uploaded data\n\n## Naming Guidelines\n\n- Use lowercase, singular verb forms\n- Be concise but descriptive\n- Avoid abbreviations unless widely understood\n- Ensure the name clearly represents the endpoint's primary action\n- For nested resources, focus on the action rather than hierarchy\n\nExamples:\n\n- `GET /shopping/orders/{orderId}/items` \u2192 `name: \"index\"` (lists items)\n- `POST /shopping/orders/{orderId}/cancel` \u2192 `name: \"cancel\"`\n- `PUT /users/{userId}/password` \u2192 `name: \"updatePassword\"`",
|
|
1128
|
-
type: "string"
|
|
1129
|
-
},
|
|
1130
|
-
path: {
|
|
1131
|
-
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.",
|
|
1132
|
-
type: "string"
|
|
1133
|
-
},
|
|
1134
1148
|
method: {
|
|
1135
1149
|
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",
|
|
1136
1150
|
type: "string",
|
|
@@ -1144,15 +1158,15 @@ const collection = {
|
|
|
1144
1158
|
}
|
|
1145
1159
|
},
|
|
1146
1160
|
required: [
|
|
1147
|
-
"
|
|
1161
|
+
"authorizationRoles",
|
|
1148
1162
|
"description",
|
|
1163
|
+
"name",
|
|
1164
|
+
"specification",
|
|
1149
1165
|
"summary",
|
|
1166
|
+
"path",
|
|
1150
1167
|
"parameters",
|
|
1151
1168
|
"requestBody",
|
|
1152
1169
|
"responseBody",
|
|
1153
|
-
"authorizationRole",
|
|
1154
|
-
"name",
|
|
1155
|
-
"path",
|
|
1156
1170
|
"method"
|
|
1157
1171
|
]
|
|
1158
1172
|
},
|
|
@@ -1344,7 +1358,7 @@ const collection = {
|
|
|
1344
1358
|
}
|
|
1345
1359
|
},
|
|
1346
1360
|
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.",
|
|
1347
|
-
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof
|
|
1361
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => Array.isArray(input.authorizationRoles) && input.authorizationRoles.every(elem => "string" === typeof elem && 1 <= elem.length) && "string" === typeof input.description && "string" === typeof input.name && "string" === typeof input.specification && "string" === typeof input.summary && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && (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)) && ("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 => (() => {
|
|
1348
1362
|
if ("number" === input.type)
|
|
1349
1363
|
return _io4(input);
|
|
1350
1364
|
else if ("integer" === input.type)
|
|
@@ -1355,42 +1369,70 @@ const collection = {
|
|
|
1355
1369
|
return false;
|
|
1356
1370
|
})(); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.operations) || _report(_exceptionable, {
|
|
1357
1371
|
path: _path + ".operations",
|
|
1358
|
-
expected: "Array<
|
|
1372
|
+
expected: "Array<IAutoBeInterfaceOperationApplication.IOperation>",
|
|
1359
1373
|
value: input.operations
|
|
1360
|
-
})) && input.operations.map((elem,
|
|
1361
|
-
path: _path + ".operations[" +
|
|
1362
|
-
expected: "
|
|
1374
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1375
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
1376
|
+
expected: "IAutoBeInterfaceOperationApplication.IOperation",
|
|
1363
1377
|
value: elem
|
|
1364
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
1365
|
-
path: _path + ".operations[" +
|
|
1366
|
-
expected: "
|
|
1378
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1379
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
1380
|
+
expected: "IAutoBeInterfaceOperationApplication.IOperation",
|
|
1367
1381
|
value: elem
|
|
1368
1382
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
1369
1383
|
path: _path + ".operations",
|
|
1370
|
-
expected: "Array<
|
|
1384
|
+
expected: "Array<IAutoBeInterfaceOperationApplication.IOperation>",
|
|
1371
1385
|
value: input.operations
|
|
1372
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [
|
|
1373
|
-
path: _path + ".
|
|
1374
|
-
expected: "string",
|
|
1375
|
-
value: input.
|
|
1386
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [(Array.isArray(input.authorizationRoles) || _report(_exceptionable, {
|
|
1387
|
+
path: _path + ".authorizationRoles",
|
|
1388
|
+
expected: "Array<string & MinLength<1>>",
|
|
1389
|
+
value: input.authorizationRoles
|
|
1390
|
+
})) && input.authorizationRoles.map((elem, _index5) => "string" === typeof elem && (1 <= elem.length || _report(_exceptionable, {
|
|
1391
|
+
path: _path + ".authorizationRoles[" + _index5 + "]",
|
|
1392
|
+
expected: "string & MinLength<1>",
|
|
1393
|
+
value: elem
|
|
1394
|
+
})) || _report(_exceptionable, {
|
|
1395
|
+
path: _path + ".authorizationRoles[" + _index5 + "]",
|
|
1396
|
+
expected: "(string & MinLength<1>)",
|
|
1397
|
+
value: elem
|
|
1398
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1399
|
+
path: _path + ".authorizationRoles",
|
|
1400
|
+
expected: "Array<string & MinLength<1>>",
|
|
1401
|
+
value: input.authorizationRoles
|
|
1376
1402
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1377
1403
|
path: _path + ".description",
|
|
1378
1404
|
expected: "string",
|
|
1379
1405
|
value: input.description
|
|
1406
|
+
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
1407
|
+
path: _path + ".name",
|
|
1408
|
+
expected: "string",
|
|
1409
|
+
value: input.name
|
|
1410
|
+
}), "string" === typeof input.specification || _report(_exceptionable, {
|
|
1411
|
+
path: _path + ".specification",
|
|
1412
|
+
expected: "string",
|
|
1413
|
+
value: input.specification
|
|
1380
1414
|
}), "string" === typeof input.summary || _report(_exceptionable, {
|
|
1381
1415
|
path: _path + ".summary",
|
|
1382
1416
|
expected: "string",
|
|
1383
1417
|
value: input.summary
|
|
1418
|
+
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1419
|
+
path: _path + ".path",
|
|
1420
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
1421
|
+
value: input.path
|
|
1422
|
+
})) || _report(_exceptionable, {
|
|
1423
|
+
path: _path + ".path",
|
|
1424
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
1425
|
+
value: input.path
|
|
1384
1426
|
}), (Array.isArray(input.parameters) || _report(_exceptionable, {
|
|
1385
1427
|
path: _path + ".parameters",
|
|
1386
1428
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1387
1429
|
value: input.parameters
|
|
1388
|
-
})) && input.parameters.map((elem,
|
|
1389
|
-
path: _path + ".parameters[" +
|
|
1430
|
+
})) && input.parameters.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1431
|
+
path: _path + ".parameters[" + _index6 + "]",
|
|
1390
1432
|
expected: "AutoBeOpenApi.IParameter",
|
|
1391
1433
|
value: elem
|
|
1392
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
1393
|
-
path: _path + ".parameters[" +
|
|
1434
|
+
})) && _vo2(elem, _path + ".parameters[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1435
|
+
path: _path + ".parameters[" + _index6 + "]",
|
|
1394
1436
|
expected: "AutoBeOpenApi.IParameter",
|
|
1395
1437
|
value: elem
|
|
1396
1438
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1413,22 +1455,6 @@ const collection = {
|
|
|
1413
1455
|
path: _path + ".responseBody",
|
|
1414
1456
|
expected: "(AutoBeOpenApi.IResponseBody | null)",
|
|
1415
1457
|
value: input.responseBody
|
|
1416
|
-
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
1417
|
-
path: _path + ".authorizationRole",
|
|
1418
|
-
expected: "string & MinLength<1>",
|
|
1419
|
-
value: input.authorizationRole
|
|
1420
|
-
})) || _report(_exceptionable, {
|
|
1421
|
-
path: _path + ".authorizationRole",
|
|
1422
|
-
expected: "((string & MinLength<1>) | null)",
|
|
1423
|
-
value: input.authorizationRole
|
|
1424
|
-
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
1425
|
-
path: _path + ".name",
|
|
1426
|
-
expected: "string",
|
|
1427
|
-
value: input.name
|
|
1428
|
-
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
1429
|
-
path: _path + ".path",
|
|
1430
|
-
expected: "string",
|
|
1431
|
-
value: input.path
|
|
1432
1458
|
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1433
1459
|
path: _path + ".method",
|
|
1434
1460
|
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
@@ -1584,11 +1610,11 @@ const collection = {
|
|
|
1584
1610
|
_report = __typia_transform__validateReport._validateReport(errors);
|
|
1585
1611
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
1586
1612
|
path: _path + "",
|
|
1587
|
-
expected: "
|
|
1613
|
+
expected: "IAutoBeInterfaceOperationApplication.IProps",
|
|
1588
1614
|
value: input
|
|
1589
1615
|
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
1590
1616
|
path: _path + "",
|
|
1591
|
-
expected: "
|
|
1617
|
+
expected: "IAutoBeInterfaceOperationApplication.IProps",
|
|
1592
1618
|
value: input
|
|
1593
1619
|
}))(input, "$input", true);
|
|
1594
1620
|
const success = 0 === errors.length;
|