@autobe/agent 0.14.5 → 0.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/constants/AutoBeSystemPromptConstant.d.ts +2 -2
  2. package/lib/index.mjs +662 -182
  3. package/lib/index.mjs.map +1 -1
  4. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +12 -10
  5. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  6. package/lib/orchestrate/realize/orchestrateRealize.js +2 -2
  7. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  8. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +77 -82
  9. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  10. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +4 -0
  11. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +513 -0
  12. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -0
  13. package/lib/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.d.ts → IAutoBeRealizeAuthorizationApplication.d.ts} +9 -9
  14. package/lib/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.js → IAutoBeRealizeAuthorizationApplication.js} +1 -1
  15. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +1 -0
  16. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +33 -0
  17. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js +3 -0
  18. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +1 -0
  19. package/lib/orchestrate/realize/transformRealizeAuthorization.d.ts +4 -0
  20. package/lib/orchestrate/realize/transformRealizeAuthorization.js +43 -0
  21. package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -0
  22. package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.d.ts +5 -0
  23. package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +71 -0
  24. package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -0
  25. package/lib/orchestrate/test/orchestrateTestCorrect.js +2 -0
  26. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  27. package/lib/orchestrate/test/orchestrateTestWrite.js +2 -0
  28. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  29. package/package.json +6 -5
  30. package/src/constants/AutoBeSystemPromptConstant.ts +2 -2
  31. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -9
  32. package/src/orchestrate/realize/orchestrateRealize.ts +7 -2
  33. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +40 -36
  34. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +179 -0
  35. package/src/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.ts → IAutoBeRealizeAuthorizationApplication.ts} +11 -9
  36. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +40 -0
  37. package/src/orchestrate/realize/{transformRealizeDecorator.ts → transformRealizeAuthorization.ts} +13 -2
  38. package/src/orchestrate/realize/{transformRealizeDecoratorCorrectHistories.ts → transformRealizeAuthorizationCorrectHistories.ts} +15 -7
  39. package/src/orchestrate/test/orchestrateTestCorrect.ts +3 -0
  40. package/src/orchestrate/test/orchestrateTestWrite.ts +8 -1
  41. package/lib/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.js.map +0 -1
  42. package/lib/orchestrate/realize/transformRealizeDecorator.d.ts +0 -4
  43. package/lib/orchestrate/realize/transformRealizeDecorator.js +0 -32
  44. package/lib/orchestrate/realize/transformRealizeDecorator.js.map +0 -1
  45. package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.d.ts +0 -5
  46. package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js +0 -62
  47. package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js.map +0 -1
package/lib/index.mjs CHANGED
@@ -234,7 +234,7 @@ class AutoBeAnalyzeComposerApplication {
234
234
 
235
235
  function createController$1(props) {
236
236
  assertSchemaModel(props.model);
237
- const application = collection$e[props.model];
237
+ const application = collection$f[props.model];
238
238
  return {
239
239
  protocol: "class",
240
240
  name: "Compose",
@@ -248,7 +248,7 @@ function createController$1(props) {
248
248
  };
249
249
  }
250
250
 
251
- const claude$e = {
251
+ const claude$f = {
252
252
  model: "claude",
253
253
  options: {
254
254
  reference: true,
@@ -461,7 +461,7 @@ const claude$e = {
461
461
  } ]
462
462
  };
463
463
 
464
- const collection$e = {
464
+ const collection$f = {
465
465
  chatgpt: {
466
466
  model: "chatgpt",
467
467
  options: {
@@ -674,10 +674,10 @@ const collection$e = {
674
674
  })()
675
675
  } ]
676
676
  },
677
- claude: claude$e,
678
- llama: claude$e,
679
- deepseek: claude$e,
680
- 3.1: claude$e
677
+ claude: claude$f,
678
+ llama: claude$f,
679
+ deepseek: claude$f,
680
+ 3.1: claude$f
681
681
  };
682
682
 
683
683
  async function randomBackoffRetry(fn, options = {}) {
@@ -848,7 +848,7 @@ const orchestrateAnalyzeWrite = (ctx, input, pointer, isAborted) => {
848
848
 
849
849
  function createController(props) {
850
850
  assertSchemaModel(props.model);
851
- const application = collection$d[props.model];
851
+ const application = collection$e[props.model];
852
852
  return {
853
853
  protocol: "class",
854
854
  name: "Planning",
@@ -868,7 +868,7 @@ function createController(props) {
868
868
  };
869
869
  }
870
870
 
871
- const claude$d = {
871
+ const claude$e = {
872
872
  model: "claude",
873
873
  options: {
874
874
  reference: true,
@@ -1050,7 +1050,7 @@ const claude$d = {
1050
1050
  } ]
1051
1051
  };
1052
1052
 
1053
- const collection$d = {
1053
+ const collection$e = {
1054
1054
  chatgpt: {
1055
1055
  model: "chatgpt",
1056
1056
  options: {
@@ -1233,10 +1233,10 @@ const collection$d = {
1233
1233
  })()
1234
1234
  } ]
1235
1235
  },
1236
- claude: claude$d,
1237
- llama: claude$d,
1238
- deepseek: claude$d,
1239
- 3.1: claude$d
1236
+ claude: claude$e,
1237
+ llama: claude$e,
1238
+ deepseek: claude$e,
1239
+ 3.1: claude$e
1240
1240
  };
1241
1241
 
1242
1242
  async function writeDocumentUntilReviewPassed(ctx, pointer, totalFiles, filename, roles, progress, retry = 3) {
@@ -1463,7 +1463,7 @@ async function step$1(ctx, document, retry) {
1463
1463
  type: "assistantMessage",
1464
1464
  text: [ "You have missed below schema types in the document.components.schemas:", "", ...missed.map((s => `- ${s}`)) ].join("\n")
1465
1465
  } ],
1466
- controllers: [ createApplication$b({
1466
+ controllers: [ createApplication$c({
1467
1467
  model: ctx.model,
1468
1468
  build: next => {
1469
1469
  pointer.value ?? (pointer.value = {});
@@ -1520,9 +1520,9 @@ const getMissed = document => {
1520
1520
  return Array.from(missed);
1521
1521
  };
1522
1522
 
1523
- function createApplication$b(props) {
1523
+ function createApplication$c(props) {
1524
1524
  assertSchemaModel(props.model);
1525
- const application = collection$c[props.model];
1525
+ const application = collection$d[props.model];
1526
1526
  return {
1527
1527
  protocol: "class",
1528
1528
  name: "interface",
@@ -1535,7 +1535,7 @@ function createApplication$b(props) {
1535
1535
  };
1536
1536
  }
1537
1537
 
1538
- const claude$c = {
1538
+ const claude$d = {
1539
1539
  model: "claude",
1540
1540
  options: {
1541
1541
  reference: true,
@@ -1648,7 +1648,7 @@ const claude$c = {
1648
1648
  } ]
1649
1649
  };
1650
1650
 
1651
- const collection$c = {
1651
+ const collection$d = {
1652
1652
  chatgpt: {
1653
1653
  model: "chatgpt",
1654
1654
  options: {
@@ -1761,10 +1761,10 @@ const collection$c = {
1761
1761
  })()
1762
1762
  } ]
1763
1763
  },
1764
- claude: claude$c,
1765
- llama: claude$c,
1766
- deepseek: claude$c,
1767
- 3.1: claude$c
1764
+ claude: claude$d,
1765
+ llama: claude$d,
1766
+ deepseek: claude$d,
1767
+ 3.1: claude$d
1768
1768
  };
1769
1769
 
1770
1770
  function divideArray(props) {
@@ -1856,7 +1856,7 @@ async function process$5(ctx, operations, oldbie, remained) {
1856
1856
  type: "assistantMessage",
1857
1857
  text: [ "Here is the OpenAPI operations generated by phase 2.", "", "```json", JSON.stringify(operations), "```" ].join("\n")
1858
1858
  } ],
1859
- controllers: [ createApplication$a({
1859
+ controllers: [ createApplication$b({
1860
1860
  model: ctx.model,
1861
1861
  build: async components => {
1862
1862
  pointer.value ?? (pointer.value = {
@@ -1879,9 +1879,9 @@ async function process$5(ctx, operations, oldbie, remained) {
1879
1879
  return OpenApiV3_1Emender.convertComponents(pointer.value);
1880
1880
  }
1881
1881
 
1882
- function createApplication$a(props) {
1882
+ function createApplication$b(props) {
1883
1883
  assertSchemaModel(props.model);
1884
- const application = collection$b[props.model];
1884
+ const application = collection$c[props.model];
1885
1885
  return {
1886
1886
  protocol: "class",
1887
1887
  name: "interface",
@@ -1894,7 +1894,7 @@ function createApplication$a(props) {
1894
1894
  };
1895
1895
  }
1896
1896
 
1897
- const claude$b = {
1897
+ const claude$c = {
1898
1898
  model: "claude",
1899
1899
  options: {
1900
1900
  reference: true,
@@ -2028,7 +2028,7 @@ const claude$b = {
2028
2028
  } ]
2029
2029
  };
2030
2030
 
2031
- const collection$b = {
2031
+ const collection$c = {
2032
2032
  chatgpt: {
2033
2033
  model: "chatgpt",
2034
2034
  options: {
@@ -2161,10 +2161,10 @@ const collection$b = {
2161
2161
  })()
2162
2162
  } ]
2163
2163
  },
2164
- claude: claude$b,
2165
- llama: claude$b,
2166
- deepseek: claude$b,
2167
- 3.1: claude$b
2164
+ claude: claude$c,
2165
+ llama: claude$c,
2166
+ deepseek: claude$c,
2167
+ 3.1: claude$c
2168
2168
  };
2169
2169
 
2170
2170
  var OpenApiEndpointComparator;
@@ -2195,7 +2195,7 @@ async function orchestrateInterfaceEndpoints(ctx, content = "Make API endpoints
2195
2195
  }
2196
2196
  },
2197
2197
  histories: 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 → use `/admin/`\n - If your system has `administrator` role → use `/administrator/`\n - If your system has `moderator` role → use `/moderator/`\n - If your system has `seller` role → use `/seller/`\n - If your system has `buyer` role → use `/buyer/`\n - If your system has custom roles → 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**🔴 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### 🔴 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 → Will need user authentication in Phase 2\n- `/{role}/*` paths → Will need specific role authentication in Phase 2\n- Plain paths without prefix → 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` → `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`)'),
2198
- controllers: [ createApplication$9({
2198
+ controllers: [ createApplication$a({
2199
2199
  model: ctx.model,
2200
2200
  build: endpoints => {
2201
2201
  pointer.value ?? (pointer.value = endpoints);
@@ -2221,9 +2221,9 @@ async function orchestrateInterfaceEndpoints(ctx, content = "Make API endpoints
2221
2221
  };
2222
2222
  }
2223
2223
 
2224
- function createApplication$9(props) {
2224
+ function createApplication$a(props) {
2225
2225
  assertSchemaModel(props.model);
2226
- const application = collection$a[props.model];
2226
+ const application = collection$b[props.model];
2227
2227
  return {
2228
2228
  protocol: "class",
2229
2229
  name: "interface",
@@ -2236,7 +2236,7 @@ function createApplication$9(props) {
2236
2236
  };
2237
2237
  }
2238
2238
 
2239
- const claude$a = {
2239
+ const claude$b = {
2240
2240
  model: "claude",
2241
2241
  options: {
2242
2242
  reference: true,
@@ -2351,7 +2351,7 @@ const claude$a = {
2351
2351
  } ]
2352
2352
  };
2353
2353
 
2354
- const collection$a = {
2354
+ const collection$b = {
2355
2355
  chatgpt: {
2356
2356
  model: "chatgpt",
2357
2357
  options: {
@@ -2458,10 +2458,10 @@ const collection$a = {
2458
2458
  })()
2459
2459
  } ]
2460
2460
  },
2461
- claude: claude$a,
2462
- llama: claude$a,
2463
- deepseek: claude$a,
2464
- 3.1: claude$a
2461
+ claude: claude$b,
2462
+ llama: claude$b,
2463
+ deepseek: claude$b,
2464
+ 3.1: claude$b
2465
2465
  };
2466
2466
 
2467
2467
  async function orchestrateInterfaceOperations(ctx, endpoints, capacity = 12) {
@@ -2517,7 +2517,7 @@ async function process$4(ctx, endpoints) {
2517
2517
  }
2518
2518
  },
2519
2519
  histories: 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 → use `/admin/`\n - If your system has `administrator` role → use `/administrator/`\n - If your system has `moderator` role → use `/moderator/`\n - If your system has `seller` role → use `/seller/`\n - If your system has `buyer` role → use `/buyer/`\n - If your system has custom roles → 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**🔴 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### 🔴 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 → Will need user authentication in Phase 2\n- `/{role}/*` paths → Will need specific role authentication in Phase 2\n- Plain paths without prefix → 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` → `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`)'),
2520
- controllers: [ createApplication$8({
2520
+ controllers: [ createApplication$9({
2521
2521
  model: ctx.model,
2522
2522
  roles: ctx.state().analyze?.roles.map((it => it.name)) ?? null,
2523
2523
  build: endpoints => {
@@ -2535,9 +2535,9 @@ async function process$4(ctx, endpoints) {
2535
2535
  return pointer.value;
2536
2536
  }
2537
2537
 
2538
- function createApplication$8(props) {
2538
+ function createApplication$9(props) {
2539
2539
  assertSchemaModel(props.model);
2540
- const application = collection$9[props.model];
2540
+ const application = collection$a[props.model];
2541
2541
  application.functions[0].validate = next => {
2542
2542
  const result = (() => {
2543
2543
  const _io0 = input => Array.isArray(input.operations) && input.operations.every((elem => "object" === typeof elem && null !== elem && _io1(elem)));
@@ -2811,19 +2811,18 @@ function createApplication$8(props) {
2811
2811
  };
2812
2812
  })()(next);
2813
2813
  if (result.success === false) return result;
2814
+ const operations = result.data.operations;
2814
2815
  const errors = [];
2815
- result.data.operations.forEach(((op, i) => {
2816
+ operations.forEach(((op, i) => {
2816
2817
  if (op.method === "get" && op.requestBody !== null) errors.push({
2817
- path: `operations[${i}].requestBody`,
2818
+ path: `$input.operations[${i}].requestBody`,
2818
2819
  expected: "GET method should not have request body. Change method, or re-design the operation.",
2819
2820
  value: op.requestBody
2820
2821
  });
2821
- if (props.roles === null) {
2822
- op.authorizationRole = null;
2823
- } else if (props.roles?.find((it => it === op.authorizationRole)) === undefined) errors.push({
2824
- path: `operations[${i}].authorizationRole`,
2825
- expected: `undefined | ${props.roles?.join(" | ")}`,
2826
- description: [ `Role "${op.authorizationRole}" is not defined in the roles list.`, "", "Please select one of them below, or do not define (undefined): ", "", ...(props.roles ?? []).map((role => `- ${role}`)) ].join("\n"),
2822
+ if (props.roles === null) op.authorizationRole = null; else if (op.authorizationRole !== null && !!props.roles?.length && props.roles.find((it => it === op.authorizationRole)) === undefined) errors.push({
2823
+ path: `$input.operations[${i}].authorizationRole`,
2824
+ expected: `null | ${props.roles.map((str => JSON.stringify(str))).join(" | ")}`,
2825
+ description: [ `Role "${op.authorizationRole}" is not defined in the roles list.`, "", "Please select one of them below, or do not define (`null`): ", "", ...(props.roles ?? []).map((role => `- ${role}`)) ].join("\n"),
2827
2826
  value: op.authorizationRole
2828
2827
  });
2829
2828
  }));
@@ -2846,7 +2845,7 @@ function createApplication$8(props) {
2846
2845
  };
2847
2846
  }
2848
2847
 
2849
- const claude$9 = {
2848
+ const claude$a = {
2850
2849
  model: "claude",
2851
2850
  options: {
2852
2851
  reference: true,
@@ -3379,7 +3378,7 @@ const claude$9 = {
3379
3378
  } ]
3380
3379
  };
3381
3380
 
3382
- const collection$9 = {
3381
+ const collection$a = {
3383
3382
  chatgpt: {
3384
3383
  model: "chatgpt",
3385
3384
  options: {
@@ -3903,10 +3902,10 @@ const collection$9 = {
3903
3902
  })()
3904
3903
  } ]
3905
3904
  },
3906
- claude: claude$9,
3907
- llama: claude$9,
3908
- deepseek: claude$9,
3909
- 3.1: claude$9
3905
+ claude: claude$a,
3906
+ llama: claude$a,
3907
+ deepseek: claude$a,
3908
+ 3.1: claude$a
3910
3909
  };
3911
3910
 
3912
3911
  const orchestrateInterface = ctx => async props => {
@@ -3986,7 +3985,7 @@ async function orchestratePrismaComponents(ctx, content = "Please extract files
3986
3985
  }
3987
3986
  },
3988
3987
  histories: transformPrismaComponentsHistories(ctx.state(), prefix),
3989
- controllers: [ createApplication$7({
3988
+ controllers: [ createApplication$8({
3990
3989
  model: ctx.model,
3991
3990
  build: next => {
3992
3991
  pointer.value ?? (pointer.value = {
@@ -4016,9 +4015,9 @@ async function orchestratePrismaComponents(ctx, content = "Please extract files
4016
4015
  };
4017
4016
  }
4018
4017
 
4019
- function createApplication$7(props) {
4018
+ function createApplication$8(props) {
4020
4019
  assertSchemaModel(props.model);
4021
- const application = collection$8[props.model];
4020
+ const application = collection$9[props.model];
4022
4021
  return {
4023
4022
  protocol: "class",
4024
4023
  name: "Prisma Extract Files and Tables",
@@ -4031,7 +4030,7 @@ function createApplication$7(props) {
4031
4030
  };
4032
4031
  }
4033
4032
 
4034
- const claude$8 = {
4033
+ const claude$9 = {
4035
4034
  model: "claude",
4036
4035
  options: {
4037
4036
  reference: true,
@@ -4170,7 +4169,7 @@ const claude$8 = {
4170
4169
  } ]
4171
4170
  };
4172
4171
 
4173
- const collection$8 = {
4172
+ const collection$9 = {
4174
4173
  chatgpt: {
4175
4174
  model: "chatgpt",
4176
4175
  options: {
@@ -4308,10 +4307,10 @@ const collection$8 = {
4308
4307
  })()
4309
4308
  } ]
4310
4309
  },
4311
- claude: claude$8,
4312
- llama: claude$8,
4313
- deepseek: claude$8,
4314
- 3.1: claude$8
4310
+ claude: claude$9,
4311
+ llama: claude$9,
4312
+ deepseek: claude$9,
4313
+ 3.1: claude$9
4315
4314
  };
4316
4315
 
4317
4316
  const transformPrismaCorrectHistories = result => [ {
@@ -4375,7 +4374,7 @@ async function step(ctx, application, life) {
4375
4374
  }
4376
4375
  },
4377
4376
  histories: transformPrismaCorrectHistories(result),
4378
- controllers: [ createApplication$6({
4377
+ controllers: [ createApplication$7({
4379
4378
  model: ctx.model,
4380
4379
  build: next => {
4381
4380
  pointer.value = next;
@@ -4414,9 +4413,9 @@ async function step(ctx, application, life) {
4414
4413
  }, life - 1);
4415
4414
  }
4416
4415
 
4417
- function createApplication$6(props) {
4416
+ function createApplication$7(props) {
4418
4417
  assertSchemaModel(props.model);
4419
- const application = collection$7[props.model];
4418
+ const application = collection$8[props.model];
4420
4419
  return {
4421
4420
  protocol: "class",
4422
4421
  name: "Prisma Compiler",
@@ -4429,7 +4428,7 @@ function createApplication$6(props) {
4429
4428
  };
4430
4429
  }
4431
4430
 
4432
- const claude$7 = {
4431
+ const claude$8 = {
4433
4432
  model: "claude",
4434
4433
  options: {
4435
4434
  reference: true,
@@ -4977,7 +4976,7 @@ const claude$7 = {
4977
4976
  } ]
4978
4977
  };
4979
4978
 
4980
- const collection$7 = {
4979
+ const collection$8 = {
4981
4980
  chatgpt: {
4982
4981
  model: "chatgpt",
4983
4982
  options: {
@@ -5505,10 +5504,10 @@ const collection$7 = {
5505
5504
  })()
5506
5505
  } ]
5507
5506
  },
5508
- claude: claude$7,
5509
- llama: claude$7,
5510
- deepseek: claude$7,
5511
- 3.1: claude$7
5507
+ claude: claude$8,
5508
+ llama: claude$8,
5509
+ deepseek: claude$8,
5510
+ 3.1: claude$8
5512
5511
  };
5513
5512
 
5514
5513
  const transformPrismaSchemaHistories = (requirementAnalysisReport, targetComponent, otherComponents) => [ {
@@ -5573,7 +5572,7 @@ async function process$3(ctx, targetComponent, otherComponents) {
5573
5572
  }
5574
5573
  },
5575
5574
  histories: transformPrismaSchemaHistories(ctx.state().analyze.files, targetComponent, otherComponents),
5576
- controllers: [ createApplication$5(ctx, {
5575
+ controllers: [ createApplication$6(ctx, {
5577
5576
  targetComponent,
5578
5577
  otherComponents,
5579
5578
  build: next => {
@@ -5590,9 +5589,9 @@ async function process$3(ctx, targetComponent, otherComponents) {
5590
5589
  return pointer.value;
5591
5590
  }
5592
5591
 
5593
- function createApplication$5(ctx, props) {
5592
+ function createApplication$6(ctx, props) {
5594
5593
  assertSchemaModel(ctx.model);
5595
- const application = collection$6[ctx.model];
5594
+ const application = collection$7[ctx.model];
5596
5595
  return {
5597
5596
  protocol: "class",
5598
5597
  name: "Prisma Generator",
@@ -5605,7 +5604,7 @@ function createApplication$5(ctx, props) {
5605
5604
  };
5606
5605
  }
5607
5606
 
5608
- const claude$6 = {
5607
+ const claude$7 = {
5609
5608
  model: "claude",
5610
5609
  options: {
5611
5610
  reference: true,
@@ -6191,7 +6190,7 @@ const claude$6 = {
6191
6190
  } ]
6192
6191
  };
6193
6192
 
6194
- const collection$6 = {
6193
+ const collection$7 = {
6195
6194
  chatgpt: {
6196
6195
  model: "chatgpt",
6197
6196
  options: {
@@ -6757,10 +6756,10 @@ const collection$6 = {
6757
6756
  })()
6758
6757
  } ]
6759
6758
  },
6760
- claude: claude$6,
6761
- llama: claude$6,
6762
- deepseek: claude$6,
6763
- 3.1: claude$6
6759
+ claude: claude$7,
6760
+ llama: claude$7,
6761
+ deepseek: claude$7,
6762
+ 3.1: claude$7
6764
6763
  };
6765
6764
 
6766
6765
  const orchestratePrisma = ctx => async props => {
@@ -6810,19 +6809,12 @@ const orchestratePrisma = ctx => async props => {
6810
6809
  return history;
6811
6810
  };
6812
6811
 
6813
- const transformRealizeDecoratorHistories = (ctx, role) => [ {
6812
+ const transformRealizeAuthorizationCorrectHistories = (ctx, auth, templateFiles, diagnostics) => [ {
6814
6813
  id: v4(),
6815
6814
  created_at: (new Date).toISOString(),
6816
6815
  type: "systemMessage",
6817
- text: '# NestJS Authentication Provider & Decorator Generation AI Agent \n\nYou are a world-class NestJS expert and TypeScript developer. Your role is to automatically generate Provider functions and Decorators for JWT authentication based on given Role information and Prisma Schema. \n\n## Core Mission \n\nGenerate authentication Provider and Decorator code specialized for specific Roles based on Role information provided by users. \n\n## Input Information \n\n- **Role Name**: The authentication role to generate (e.g., admin, user, manager, etc.) \n- **Prisma Schema**: Database table information.\n\n## Code Generation Rules \n\n### 1. Provider Function Generation Rules \n\n- Function name: `{role}Authorize` format (e.g., adminAuthorize, userAuthorize) \n- Must use the `jwtAuthorize` function for JWT token verification \n- Verify payload type and check if `payload.type` matches the correct role \n- Query database using `MyGlobal.prisma.{tableName}` format to fetch **only the authorization model itself** - do not include relations or business logic models (no `include` statements for profile, etc.) \n- Verify that the user actually exists in the database \n- Function return type should be `{Role}Payload` interface \n- Return the `payload` variable whenever feasible in provider functions. \n- **Always check the Prisma schema for validation columns (e.g., `deleted_at`, status fields) within the authorization model and include them in the `where` clause to ensure the user is valid and active.** \n\n### 2. Payload Interface Generation Rules \n\n- Interface name: `{Role}Payload` format (e.g., AdminPayload, UserPayload) \n- Required fields: \n - `id: string & tags.Format<"uuid">`: User ID (UUID format) \n - `type: "{role}"`: Discriminator for role identification \n- Additional fields should be generated according to Role characteristics and "Prisma Schema" \n\n### 3. Decorator Generation Rules \n\n- Decorator name: `{Role}Auth` format (e.g., AdminAuth, UserAuth) \n- Use SwaggerCustomizer to add bearer token security schema to API documentation \n- Use createParamDecorator to implement actual authentication logic \n- Use Singleton pattern to manage decorator instances \n\n### 4. Code Style and Structure\n\n- Comply with TypeScript strict mode \n- Utilize NestJS Exception classes (ForbiddenException, UnauthorizedException) \n- Ensure type safety using typia tags \n- Add appropriate JSDoc comments \n\n## Reference Functions and Examples \n\n### JWT Authentication Function \n\n```typescript\n// path - src/authentications/jwtAuthorize.ts\nimport { ForbiddenException, UnauthorizedException } from "@nestjs/common";\nimport jwt from "jsonwebtoken";\n\nimport { MyGlobal } from "../MyGlobal";\n\nexport function jwtAuthorize(props: {\n request: {\n headers: { authorization?: string };\n };\n}) {\n if (!props.request.headers.authorization)\n throw new ForbiddenException("No token value exists");\n else if (\n props.request.headers.authorization.startsWith(BEARER_PREFIX) === false\n )\n throw new UnauthorizedException("Invalid token");\n\n // PARSE TOKEN\n try {\n const token: string = props.request.headers.authorization.substring(\n BEARER_PREFIX.length,\n );\n\n const verified = jwt.verify(token, MyGlobal.env.JWT_SECRET_KEY);\n\n return verified;\n } catch {\n throw new UnauthorizedException("Invalid token");\n }\n}\n\nconst BEARER_PREFIX = "Bearer ";\n``` \n\n### Provider Function Example \n\n```typescript\nimport { ForbiddenException } from "@nestjs/common";\n\nimport { MyGlobal } from "../MyGlobal";\nimport { jwtAuthorize } from "./jwtAuthorize";\nimport { AdminPayload } from "./types/AdminPayload";\n\nexport async function adminAuthorize(request: {\n headers: {\n authorization?: string;\n };\n}): Promise<AdminPayload> {\n const payload: AdminPayload = jwtAuthorize({ request }) as AdminPayload;\n\n if (payload.type !== "admin") {\n throw new ForbiddenException(`You\'re not ${payload.type}`);\n }\n\n const admin = await MyGlobal.prisma.admins.findFirst({\n where: {\n id: payload.id,\n user: {\n deleted_at: null,\n is_banned: false,\n },\n },\n });\n\n if (admin === null) {\n throw new ForbiddenException("You\'re not enrolled");\n }\n\n return payload;\n}\n``` \n\n### Decorator Example\n\n```typescript\nimport { SwaggerCustomizer } from "@nestia/core";\nimport { ExecutionContext, createParamDecorator } from "@nestjs/common";\nimport { Singleton } from "tstl";\n\nimport { adminAuthorize } from "../authentications/adminAuthorize";\n\nexport const AdminAuth =\n (): ParameterDecorator =>\n (\n target: object,\n propertyKey: string | symbol | undefined,\n parameterIndex: number,\n ): void => {\n SwaggerCustomizer((props) => {\n props.route.security ??= [];\n props.route.security.push({\n bearer: [],\n });\n })(target, propertyKey as string, undefined!);\n singleton.get()(target, propertyKey, parameterIndex);\n };\n\nconst singleton = new Singleton(() =>\n createParamDecorator(async (_0: unknown, ctx: ExecutionContext) => {\n const request = ctx.switchToHttp().getRequest();\n return adminAuthorize(request);\n })(),\n);\n``` \n\n### Decorator Type Example \n\nIn case of the columns related to Date type like `created_at`, `updated_at`, `deleted_at`, must use the `string & tags.Format<\'date-time\'>` Type instead of Date type. \n\n```typescript\nimport { tags } from "typia";\n\nexport interface AdminPayload {\n /**\n * Admin ID.\n */\n id: string & tags.Format<"uuid">;\n\n /**\n * Discriminator for the discriminated union type.\n */\n type: "admin";\n}\n``` \n\n## Output Format \n\nYou must provide your response in a structured JSON format containing the following nested structure: \n\n**provider**: An object containing the authentication Provider function configuration \n\n- **name**: The name of the authentication Provider function in `{role}Authorize` format (e.g., adminAuthorize, userAuthorize). This function verifies JWT tokens and returns user information for the specified role. \n- **code**: Complete TypeScript code for the authentication Provider function only. Must include JWT verification, role checking, database query logic, and proper import statements for the Payload interface.\n\n**decorator**: An object containing the authentication Decorator configuration \n\n- **name**: The name of the Decorator to be generated in `{Role}Auth` format (e.g., AdminAuth, UserAuth). The decorator name used in Controller method parameters. \n- **code**: Complete TypeScript code for the Decorator. Must include complete authentication decorator implementation using SwaggerCustomizer, createParamDecorator, and Singleton pattern.\n\n**decoratorType**: An object containing the Decorator Type configuration\n\n- **name**: The name of the Decorator Type in `{Role}Payload` format (e.g., AdminPayload, UserPayload). Used as the TypeScript type for the authenticated user data.\n- **code**: Complete TypeScript code for the Payload type interface. Must include proper field definitions with typia tags for type safety.\n\n## Work Process \n\n1. Analyze the input Role name \n2. Generate Provider function for the Role \n3. Define Payload interface \n4. Implement Decorator \n5. Verify that all code follows example patterns \n6. Generate response in specified format \n\n## Quality Standards \n\n- Ensure type safety \n- Follow NestJS conventions \n- Complete error handling \n- Code reusability \n- Complete documentation \n\nWhen users provide Role information, generate complete and practical authentication code according to the above rules.'
6816
+ text: '# NestJS Authentication Provider & Decorator Generation AI Agent \n\nYou are a world-class NestJS expert and TypeScript developer. Your role is to automatically generate Provider functions and Decorators for JWT authentication based on given Role information and Prisma Schema. \n\n## Core Mission \n\nGenerate authentication Provider and Decorator code specialized for specific Roles based on Role information provided by users. \n\n## Input Information \n\n- **Role Name**: The authentication role to generate (e.g., admin, user, manager, etc.) \n- **Prisma Schema**: Database table information.\n\n## Code Generation Rules \n\n### 1. Provider Function Generation Rules \n\n- Function name: `{role}Authorize` format (e.g., adminAuthorize, userAuthorize) \n- Must use the `jwtAuthorize` function for JWT token verification \n- Verify payload type and check if `payload.type` matches the correct role \n- Query database using `MyGlobal.prisma.{tableName}` format to fetch **only the authorization model itself** - do not include relations or business logic models (no `include` statements for profile, etc.) \n- Verify that the user actually exists in the database \n- Function return type should be `{Role}Payload` interface \n- Return the `payload` variable whenever feasible in provider functions. \n- **Always check the Prisma schema for validation columns (e.g., `deleted_at`, status fields) within the authorization model and include them in the `where` clause to ensure the user is valid and active.** \n\n### 2. Payload Interface Generation Rules \n\n- Interface name: `{Role}Payload` format (e.g., AdminPayload, UserPayload) \n- Required fields: \n - `id: string & tags.Format<"uuid">`: User ID (UUID format) \n - `type: "{role}"`: Discriminator for role identification \n- Additional fields should be generated according to Role characteristics and "Prisma Schema" \n\n### 3. Decorator Generation Rules \n\n- Decorator name: `{Role}Auth` format (e.g., AdminAuth, UserAuth) \n- Use SwaggerCustomizer to add bearer token security schema to API documentation \n- Use createParamDecorator to implement actual authentication logic \n- Use Singleton pattern to manage decorator instances \n\n### 4. Code Style and Structure\n\n- Comply with TypeScript strict mode \n- Utilize NestJS Exception classes (ForbiddenException, UnauthorizedException) \n- Ensure type safety using typia tags \n- Add appropriate JSDoc comments \n\n## Reference Functions and Examples \n\n### JWT Authentication Function \n\n```typescript\nimport { ForbiddenException, UnauthorizedException } from "@nestjs/common";\nimport jwt from "jsonwebtoken";\n\nimport { MyGlobal } from "../MyGlobal";\n\nexport function jwtAuthorize(props: {\n request: {\n headers: { authorization?: string };\n };\n}) {\n if (!props.request.headers.authorization)\n throw new ForbiddenException("No token value exists");\n else if (\n props.request.headers.authorization.startsWith(BEARER_PREFIX) === false\n )\n throw new UnauthorizedException("Invalid token");\n\n // PARSE TOKEN\n try {\n const token: string = props.request.headers.authorization.substring(\n BEARER_PREFIX.length,\n );\n\n const verified = jwt.verify(token, MyGlobal.env.JWT_SECRET_KEY);\n\n return verified;\n } catch {\n throw new UnauthorizedException("Invalid token");\n }\n}\n\nconst BEARER_PREFIX = "Bearer ";\n``` \n\n### Provider Function Example \n\n```typescript\nimport { ForbiddenException } from "@nestjs/common";\n\nimport { MyGlobal } from "../../MyGlobal";\nimport { jwtAuthorize } from "./jwtAuthorize";\nimport { AdminPayload } from "../../decorators/payload/AdminPayload";\n\nexport async function adminAuthorize(request: {\n headers: {\n authorization?: string;\n };\n}): Promise<AdminPayload> {\n const payload: AdminPayload = jwtAuthorize({ request }) as AdminPayload;\n\n if (payload.type !== "admin") {\n throw new ForbiddenException(`You\'re not ${payload.type}`);\n }\n\n const admin = await MyGlobal.prisma.admins.findFirst({\n where: {\n id: payload.id,\n user: {\n deleted_at: null,\n is_banned: false,\n },\n },\n });\n\n if (admin === null) {\n throw new ForbiddenException("You\'re not enrolled");\n }\n\n return payload;\n}\n``` \n\n### Decorator Example\n\n```typescript\nimport { SwaggerCustomizer } from "@nestia/core";\nimport { ExecutionContext, createParamDecorator } from "@nestjs/common";\nimport { Singleton } from "tstl";\n\nimport { adminAuthorize } from "../providers/authorize/adminAuthorize";\n\nexport const AdminAuth =\n (): ParameterDecorator =>\n (\n target: object,\n propertyKey: string | symbol | undefined,\n parameterIndex: number,\n ): void => {\n SwaggerCustomizer((props) => {\n props.route.security ??= [];\n props.route.security.push({\n bearer: [],\n });\n })(target, propertyKey as string, undefined!);\n singleton.get()(target, propertyKey, parameterIndex);\n };\n\nconst singleton = new Singleton(() =>\n createParamDecorator(async (_0: unknown, ctx: ExecutionContext) => {\n const request = ctx.switchToHttp().getRequest();\n return adminAuthorize(request);\n })(),\n);\n``` \n\n### Decorator Type Example \n\nIn case of the columns related to Date type like `created_at`, `updated_at`, `deleted_at`, must use the `string & tags.Format<\'date-time\'>` Type instead of Date type. \n\n```typescript\nimport { tags } from "typia";\n\nexport interface AdminPayload {\n /**\n * Admin ID.\n */\n id: string & tags.Format<"uuid">;\n\n /**\n * Discriminator for the discriminated union type.\n */\n type: "admin";\n}\n``` \n\n## Output Format \n\nYou must provide your response in a structured JSON format containing the following nested structure: \n\n**provider**: An object containing the authentication Provider function configuration \n\n- **name**: The name of the authentication Provider function in `{role}Authorize` format (e.g., adminAuthorize, userAuthorize). This function verifies JWT tokens and returns user information for the specified role. \n- **code**: Complete TypeScript code for the authentication Provider function only. Must include JWT verification, role checking, database query logic, and proper import statements for the Payload interface.\n\n**decorator**: An object containing the authentication Decorator configuration \n\n- **name**: The name of the Decorator to be generated in `{Role}Auth` format (e.g., AdminAuth, UserAuth). The decorator name used in Controller method parameters. \n- **code**: Complete TypeScript code for the Decorator. Must include complete authentication decorator implementation using SwaggerCustomizer, createParamDecorator, and Singleton pattern.\n\n**decoratorType**: An object containing the Decorator Type configuration\n\n- **name**: The name of the Decorator Type in `{Role}Payload` format (e.g., AdminPayload, UserPayload). Used as the TypeScript type for the authenticated user data.\n- **code**: Complete TypeScript code for the Payload type interface. Must include proper field definitions with typia tags for type safety.\n\n## Work Process \n\n1. Analyze the input Role name \n2. Generate Provider function for the Role \n3. Define Payload interface \n4. Implement Decorator \n5. Verify that all code follows example patterns \n6. Generate response in specified format \n\n## Quality Standards \n\n- Ensure type safety \n- Follow NestJS conventions \n- Complete error handling \n- Code reusability \n- Complete documentation \n\nWhen users provide Role information, generate complete and practical authentication code according to the above rules.'
6818
6817
  }, {
6819
- id: v4(),
6820
- created_at: (new Date).toISOString(),
6821
- type: "systemMessage",
6822
- text: [ "## Role", "", role, "", "## Prisma Schema", "", JSON.stringify(ctx.state().prisma?.schemas, null, 2), "" ].join("\n")
6823
- } ];
6824
-
6825
- const transformRealizeDecoratorCorrectHistories = (ctx, auth, templateFiles, diagnostics) => [ {
6826
6818
  id: v4(),
6827
6819
  created_at: (new Date).toISOString(),
6828
6820
  type: "systemMessage",
@@ -6833,16 +6825,19 @@ const transformRealizeDecoratorCorrectHistories = (ctx, auth, templateFiles, dia
6833
6825
  type: "assistantMessage",
6834
6826
  text: [ "## Generated TypeScript Code", "", "```json", `${JSON.stringify({
6835
6827
  provider: {
6828
+ location: auth.provider.location,
6836
6829
  name: auth.provider.name,
6837
- code: auth.provider.content
6830
+ content: auth.provider.content
6838
6831
  },
6839
6832
  decorator: {
6833
+ location: auth.decorator.location,
6840
6834
  name: auth.decorator.name,
6841
- code: auth.decorator.content
6835
+ content: auth.decorator.content
6842
6836
  },
6843
6837
  payload: {
6838
+ location: auth.payload.location,
6844
6839
  name: auth.payload.name,
6845
- code: auth.payload.content
6840
+ content: auth.payload.content
6846
6841
  }
6847
6842
  }, null, 2)}`, "```", "", "## Prisma Schema", "", "```json", `${JSON.stringify(ctx.state().prisma?.schemas, null, 2)}`, "```", "", "## File Paths", "", Object.keys(templateFiles).map((path => `- ${path}`)).join("\n"), "", "## Compile Errors", "", "Fix the compilation error in the provided code.", "", "```json", JSON.stringify(diagnostics, null, 2), "```" ].join("\n")
6848
6843
  } ];
@@ -6855,12 +6850,496 @@ var AuthorizationFileSystem;
6855
6850
  AuthorizationFileSystem.providerPath = name => `src/providers/authorize/${name}.ts`;
6856
6851
  })(AuthorizationFileSystem || (AuthorizationFileSystem = {}));
6857
6852
 
6853
+ async function orchestrateRealizeAuthorizationCorrect(ctx, authorization, prismaClients, templateFiles, life = 4) {
6854
+ const files = {
6855
+ ...templateFiles,
6856
+ ...prismaClients,
6857
+ [AuthorizationFileSystem.decoratorPath(authorization.decorator.name)]: authorization.decorator.content,
6858
+ [AuthorizationFileSystem.providerPath(authorization.provider.name)]: authorization.provider.content,
6859
+ [AuthorizationFileSystem.payloadPath(authorization.payload.name)]: authorization.payload.content
6860
+ };
6861
+ const compiler = await ctx.compiler();
6862
+ const compiled = await compiler.typescript.compile({
6863
+ files
6864
+ });
6865
+ ctx.dispatch({
6866
+ type: "realizeAuthorizationValidate",
6867
+ created_at: (new Date).toISOString(),
6868
+ authorization,
6869
+ result: compiled,
6870
+ step: ctx.state().test?.step ?? 0
6871
+ });
6872
+ if (compiled.type === "success") {
6873
+ return authorization;
6874
+ } else if (compiled.type === "exception" || life === 0) {
6875
+ return authorization;
6876
+ }
6877
+ const pointer = {
6878
+ value: null
6879
+ };
6880
+ const agentica = new MicroAgentica({
6881
+ model: ctx.model,
6882
+ vendor: ctx.vendor,
6883
+ config: {
6884
+ ...ctx.config ?? {},
6885
+ executor: {
6886
+ describe: null
6887
+ }
6888
+ },
6889
+ histories: transformRealizeAuthorizationCorrectHistories(ctx, authorization, templateFiles, compiled.diagnostics),
6890
+ controllers: [ createApplication$5({
6891
+ model: ctx.model,
6892
+ build: next => {
6893
+ pointer.value = next;
6894
+ }
6895
+ }) ]
6896
+ });
6897
+ enforceToolCall(agentica);
6898
+ await agentica.conversate("Please correct the decorator and the provider.").finally((() => {
6899
+ const tokenUsage = agentica.getTokenUsage();
6900
+ ctx.usage().record(tokenUsage, [ "realize" ]);
6901
+ }));
6902
+ if (pointer.value === null) throw new Error("Failed to correct decorator.");
6903
+ const result = {
6904
+ ...pointer.value,
6905
+ decorator: {
6906
+ ...pointer.value.decorator,
6907
+ location: AuthorizationFileSystem.decoratorPath(pointer.value.decorator.name)
6908
+ },
6909
+ provider: {
6910
+ ...pointer.value.provider,
6911
+ location: AuthorizationFileSystem.providerPath(pointer.value.provider.name)
6912
+ },
6913
+ payload: {
6914
+ ...pointer.value.payload,
6915
+ location: AuthorizationFileSystem.payloadPath(pointer.value.payload.name)
6916
+ },
6917
+ role: authorization.role
6918
+ };
6919
+ ctx.dispatch({
6920
+ ...pointer.value,
6921
+ type: "realizeAuthorizationCorrect",
6922
+ created_at: (new Date).toISOString(),
6923
+ authorization: result,
6924
+ result: compiled,
6925
+ step: ctx.state().test?.step ?? 0
6926
+ });
6927
+ return await orchestrateRealizeAuthorizationCorrect(ctx, result, prismaClients, templateFiles, life - 1);
6928
+ }
6929
+
6930
+ function createApplication$5(props) {
6931
+ assertSchemaModel(props.model);
6932
+ const application = collection$6[props.model];
6933
+ return {
6934
+ protocol: "class",
6935
+ name: "Correct Authorization",
6936
+ application,
6937
+ execute: {
6938
+ correctDecorator: next => {
6939
+ props.build(next);
6940
+ }
6941
+ }
6942
+ };
6943
+ }
6944
+
6945
+ const claude$6 = {
6946
+ model: "claude",
6947
+ options: {
6948
+ reference: true,
6949
+ separate: null
6950
+ },
6951
+ functions: [ {
6952
+ name: "correctDecorator",
6953
+ parameters: {
6954
+ description: "Current Type: {@link IAutoBeRealizeAuthorizationCorrectApplication.IProps}",
6955
+ type: "object",
6956
+ properties: {
6957
+ error_analysis: {
6958
+ description: "Step 1: TypeScript compilation error analysis and diagnosis.\n\nAI identifies all compilation errors (type mismatches, imports, syntax)\nand categorizes them by component (provider/decorator/payload). Analyzes\nerror dependencies and determines fix priorities for systematic\nresolution.",
6959
+ type: "string"
6960
+ },
6961
+ corrected_implementation: {
6962
+ description: "Step 2: Corrected implementation with all compilation errors resolved.\n\nAI generates fixed versions of provider, decorator, and payload code.\nMaintains original functionality while ensuring TypeScript compilation\nsuccess and proper NestJS/Prisma framework integration.",
6963
+ type: "string"
6964
+ },
6965
+ validation_summary: {
6966
+ description: "Step 3: Final validation and comprehensive fix summary.\n\nAI validates corrected code compiles successfully and documents all\nchanges made. Provides production-ready code with detailed change log for\nmaintenance reference.",
6967
+ type: "string"
6968
+ },
6969
+ provider: {
6970
+ description: "Authentication Provider function configuration containing the function\nname and implementation code. The Provider handles JWT token\nverification, role validation, and database queries to authenticate\nusers.",
6971
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
6972
+ },
6973
+ decorator: {
6974
+ description: "Authentication Decorator configuration containing the decorator name and\nimplementation code. The Decorator integrates with NestJS parameter\ndecorators to automatically inject authenticated user data into\nController methods.",
6975
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
6976
+ },
6977
+ payload: {
6978
+ description: "Authentication Payload Type configuration containing the payload type\nname and implementation code. The Payload Type is used to define the\nstructure of the authenticated user data that will be injected into\nController methods when using the decorator. It serves as the TypeScript\ntype for the parameter in Controller method signatures.",
6979
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
6980
+ }
6981
+ },
6982
+ required: [ "error_analysis", "corrected_implementation", "validation_summary", "provider", "decorator", "payload" ],
6983
+ additionalProperties: false,
6984
+ $defs: {
6985
+ "IAutoBeRealizeAuthorizationApplication.IProvider": {
6986
+ type: "object",
6987
+ properties: {
6988
+ name: {
6989
+ description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.",
6990
+ type: "string"
6991
+ },
6992
+ content: {
6993
+ description: "Complete TypeScript code for the authentication Provider function and its\ncorresponding Payload interface. Must include: JWT token verification\nusing jwtAuthorize function, role type checking against payload.type,\ndatabase query using MyGlobal.prisma.{tableName} pattern to verify user\nexistence, proper error handling with ForbiddenException and\nUnauthorizedException, and the Payload interface definition with id (UUID\nformat) and type (role discriminator) fields using typia tags.",
6994
+ type: "string"
6995
+ }
6996
+ },
6997
+ required: [ "name", "content" ]
6998
+ },
6999
+ "IAutoBeRealizeAuthorizationApplication.IDecorator": {
7000
+ type: "object",
7001
+ properties: {
7002
+ name: {
7003
+ description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7004
+ type: "string"
7005
+ },
7006
+ content: {
7007
+ description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
7008
+ type: "string"
7009
+ }
7010
+ },
7011
+ required: [ "name", "content" ]
7012
+ },
7013
+ "IAutoBeRealizeAuthorizationApplication.IPayloadType": {
7014
+ type: "object",
7015
+ properties: {
7016
+ name: {
7017
+ description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7018
+ type: "string"
7019
+ },
7020
+ content: {
7021
+ description: "The TypeScript code for the Payload type in {Role}Payload format (e.g.,\nAdminPayload, UserPayload). This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator. It serves as the TypeScript type for the\nparameter in Controller method signatures.",
7022
+ type: "string"
7023
+ }
7024
+ },
7025
+ required: [ "name", "content" ]
7026
+ }
7027
+ }
7028
+ },
7029
+ validate: (() => {
7030
+ const _io0 = input => "string" === typeof input.error_analysis && "string" === typeof input.corrected_implementation && "string" === typeof input.validation_summary && ("object" === typeof input.provider && null !== input.provider && _io1(input.provider)) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload));
7031
+ const _io1 = input => "string" === typeof input.name && "string" === typeof input.content;
7032
+ const _io2 = input => "string" === typeof input.name && "string" === typeof input.content;
7033
+ const _io3 = input => "string" === typeof input.name && "string" === typeof input.content;
7034
+ const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.error_analysis || _report(_exceptionable, {
7035
+ path: _path + ".error_analysis",
7036
+ expected: "string",
7037
+ value: input.error_analysis
7038
+ }), "string" === typeof input.corrected_implementation || _report(_exceptionable, {
7039
+ path: _path + ".corrected_implementation",
7040
+ expected: "string",
7041
+ value: input.corrected_implementation
7042
+ }), "string" === typeof input.validation_summary || _report(_exceptionable, {
7043
+ path: _path + ".validation_summary",
7044
+ expected: "string",
7045
+ value: input.validation_summary
7046
+ }), ("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
7047
+ path: _path + ".provider",
7048
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7049
+ value: input.provider
7050
+ })) && _vo1(input.provider, _path + ".provider", _exceptionable) || _report(_exceptionable, {
7051
+ path: _path + ".provider",
7052
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7053
+ value: input.provider
7054
+ }), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
7055
+ path: _path + ".decorator",
7056
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7057
+ value: input.decorator
7058
+ })) && _vo2(input.decorator, _path + ".decorator", _exceptionable) || _report(_exceptionable, {
7059
+ path: _path + ".decorator",
7060
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7061
+ value: input.decorator
7062
+ }), ("object" === typeof input.payload && null !== input.payload || _report(_exceptionable, {
7063
+ path: _path + ".payload",
7064
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7065
+ value: input.payload
7066
+ })) && _vo3(input.payload, _path + ".payload", _exceptionable) || _report(_exceptionable, {
7067
+ path: _path + ".payload",
7068
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7069
+ value: input.payload
7070
+ }) ].every((flag => flag));
7071
+ const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7072
+ path: _path + ".name",
7073
+ expected: "string",
7074
+ value: input.name
7075
+ }), "string" === typeof input.content || _report(_exceptionable, {
7076
+ path: _path + ".content",
7077
+ expected: "string",
7078
+ value: input.content
7079
+ }) ].every((flag => flag));
7080
+ const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7081
+ path: _path + ".name",
7082
+ expected: "string",
7083
+ value: input.name
7084
+ }), "string" === typeof input.content || _report(_exceptionable, {
7085
+ path: _path + ".content",
7086
+ expected: "string",
7087
+ value: input.content
7088
+ }) ].every((flag => flag));
7089
+ const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7090
+ path: _path + ".name",
7091
+ expected: "string",
7092
+ value: input.name
7093
+ }), "string" === typeof input.content || _report(_exceptionable, {
7094
+ path: _path + ".content",
7095
+ expected: "string",
7096
+ value: input.content
7097
+ }) ].every((flag => flag));
7098
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
7099
+ let errors;
7100
+ let _report;
7101
+ return input => {
7102
+ if (false === __is(input)) {
7103
+ errors = [];
7104
+ _report = __typia_transform__validateReport._validateReport(errors);
7105
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
7106
+ path: _path + "",
7107
+ expected: "IAutoBeRealizeAuthorizationCorrectApplication.IProps",
7108
+ value: input
7109
+ })) && _vo0(input, _path + "", true) || _report(true, {
7110
+ path: _path + "",
7111
+ expected: "IAutoBeRealizeAuthorizationCorrectApplication.IProps",
7112
+ value: input
7113
+ }))(input, "$input", true);
7114
+ const success = 0 === errors.length;
7115
+ return success ? {
7116
+ success,
7117
+ data: input
7118
+ } : {
7119
+ success,
7120
+ errors,
7121
+ data: input
7122
+ };
7123
+ }
7124
+ return {
7125
+ success: true,
7126
+ data: input
7127
+ };
7128
+ };
7129
+ })()
7130
+ } ]
7131
+ };
7132
+
7133
+ const collection$6 = {
7134
+ chatgpt: {
7135
+ model: "chatgpt",
7136
+ options: {
7137
+ reference: true,
7138
+ strict: false,
7139
+ separate: null
7140
+ },
7141
+ functions: [ {
7142
+ name: "correctDecorator",
7143
+ parameters: {
7144
+ description: "Current Type: {@link IAutoBeRealizeAuthorizationCorrectApplication.IProps}\n\n### Description of {@link provider} property:\n\n> Authentication Provider function configuration containing the function\n> name and implementation code. The Provider handles JWT token\n> verification, role validation, and database queries to authenticate\n> users.\n\n### Description of {@link decorator} property:\n\n> Authentication Decorator configuration containing the decorator name and\n> implementation code. The Decorator integrates with NestJS parameter\n> decorators to automatically inject authenticated user data into\n> Controller methods.\n\n### Description of {@link payload} property:\n\n> Authentication Payload Type configuration containing the payload type\n> name and implementation code. The Payload Type is used to define the\n> structure of the authenticated user data that will be injected into\n> Controller methods when using the decorator. It serves as the TypeScript\n> type for the parameter in Controller method signatures.",
7145
+ type: "object",
7146
+ properties: {
7147
+ error_analysis: {
7148
+ description: "Step 1: TypeScript compilation error analysis and diagnosis.\n\nAI identifies all compilation errors (type mismatches, imports, syntax)\nand categorizes them by component (provider/decorator/payload). Analyzes\nerror dependencies and determines fix priorities for systematic\nresolution.",
7149
+ type: "string"
7150
+ },
7151
+ corrected_implementation: {
7152
+ description: "Step 2: Corrected implementation with all compilation errors resolved.\n\nAI generates fixed versions of provider, decorator, and payload code.\nMaintains original functionality while ensuring TypeScript compilation\nsuccess and proper NestJS/Prisma framework integration.",
7153
+ type: "string"
7154
+ },
7155
+ validation_summary: {
7156
+ description: "Step 3: Final validation and comprehensive fix summary.\n\nAI validates corrected code compiles successfully and documents all\nchanges made. Provides production-ready code with detailed change log for\nmaintenance reference.",
7157
+ type: "string"
7158
+ },
7159
+ provider: {
7160
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
7161
+ },
7162
+ decorator: {
7163
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
7164
+ },
7165
+ payload: {
7166
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
7167
+ }
7168
+ },
7169
+ required: [ "error_analysis", "corrected_implementation", "validation_summary", "provider", "decorator", "payload" ],
7170
+ additionalProperties: false,
7171
+ $defs: {
7172
+ "IAutoBeRealizeAuthorizationApplication.IProvider": {
7173
+ type: "object",
7174
+ properties: {
7175
+ name: {
7176
+ description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.",
7177
+ type: "string"
7178
+ },
7179
+ content: {
7180
+ description: "Complete TypeScript code for the authentication Provider function and its\ncorresponding Payload interface. Must include: JWT token verification\nusing jwtAuthorize function, role type checking against payload.type,\ndatabase query using MyGlobal.prisma.{tableName} pattern to verify user\nexistence, proper error handling with ForbiddenException and\nUnauthorizedException, and the Payload interface definition with id (UUID\nformat) and type (role discriminator) fields using typia tags.",
7181
+ type: "string"
7182
+ }
7183
+ },
7184
+ required: [ "name", "content" ]
7185
+ },
7186
+ "IAutoBeRealizeAuthorizationApplication.IDecorator": {
7187
+ type: "object",
7188
+ properties: {
7189
+ name: {
7190
+ description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7191
+ type: "string"
7192
+ },
7193
+ content: {
7194
+ description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
7195
+ type: "string"
7196
+ }
7197
+ },
7198
+ required: [ "name", "content" ]
7199
+ },
7200
+ "IAutoBeRealizeAuthorizationApplication.IPayloadType": {
7201
+ type: "object",
7202
+ properties: {
7203
+ name: {
7204
+ description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7205
+ type: "string"
7206
+ },
7207
+ content: {
7208
+ description: "The TypeScript code for the Payload type in {Role}Payload format (e.g.,\nAdminPayload, UserPayload). This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator. It serves as the TypeScript type for the\nparameter in Controller method signatures.",
7209
+ type: "string"
7210
+ }
7211
+ },
7212
+ required: [ "name", "content" ]
7213
+ }
7214
+ }
7215
+ },
7216
+ validate: (() => {
7217
+ const _io0 = input => "string" === typeof input.error_analysis && "string" === typeof input.corrected_implementation && "string" === typeof input.validation_summary && ("object" === typeof input.provider && null !== input.provider && _io1(input.provider)) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload));
7218
+ const _io1 = input => "string" === typeof input.name && "string" === typeof input.content;
7219
+ const _io2 = input => "string" === typeof input.name && "string" === typeof input.content;
7220
+ const _io3 = input => "string" === typeof input.name && "string" === typeof input.content;
7221
+ const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.error_analysis || _report(_exceptionable, {
7222
+ path: _path + ".error_analysis",
7223
+ expected: "string",
7224
+ value: input.error_analysis
7225
+ }), "string" === typeof input.corrected_implementation || _report(_exceptionable, {
7226
+ path: _path + ".corrected_implementation",
7227
+ expected: "string",
7228
+ value: input.corrected_implementation
7229
+ }), "string" === typeof input.validation_summary || _report(_exceptionable, {
7230
+ path: _path + ".validation_summary",
7231
+ expected: "string",
7232
+ value: input.validation_summary
7233
+ }), ("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
7234
+ path: _path + ".provider",
7235
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7236
+ value: input.provider
7237
+ })) && _vo1(input.provider, _path + ".provider", _exceptionable) || _report(_exceptionable, {
7238
+ path: _path + ".provider",
7239
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7240
+ value: input.provider
7241
+ }), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
7242
+ path: _path + ".decorator",
7243
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7244
+ value: input.decorator
7245
+ })) && _vo2(input.decorator, _path + ".decorator", _exceptionable) || _report(_exceptionable, {
7246
+ path: _path + ".decorator",
7247
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7248
+ value: input.decorator
7249
+ }), ("object" === typeof input.payload && null !== input.payload || _report(_exceptionable, {
7250
+ path: _path + ".payload",
7251
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7252
+ value: input.payload
7253
+ })) && _vo3(input.payload, _path + ".payload", _exceptionable) || _report(_exceptionable, {
7254
+ path: _path + ".payload",
7255
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7256
+ value: input.payload
7257
+ }) ].every((flag => flag));
7258
+ const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7259
+ path: _path + ".name",
7260
+ expected: "string",
7261
+ value: input.name
7262
+ }), "string" === typeof input.content || _report(_exceptionable, {
7263
+ path: _path + ".content",
7264
+ expected: "string",
7265
+ value: input.content
7266
+ }) ].every((flag => flag));
7267
+ const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7268
+ path: _path + ".name",
7269
+ expected: "string",
7270
+ value: input.name
7271
+ }), "string" === typeof input.content || _report(_exceptionable, {
7272
+ path: _path + ".content",
7273
+ expected: "string",
7274
+ value: input.content
7275
+ }) ].every((flag => flag));
7276
+ const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7277
+ path: _path + ".name",
7278
+ expected: "string",
7279
+ value: input.name
7280
+ }), "string" === typeof input.content || _report(_exceptionable, {
7281
+ path: _path + ".content",
7282
+ expected: "string",
7283
+ value: input.content
7284
+ }) ].every((flag => flag));
7285
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
7286
+ let errors;
7287
+ let _report;
7288
+ return input => {
7289
+ if (false === __is(input)) {
7290
+ errors = [];
7291
+ _report = __typia_transform__validateReport._validateReport(errors);
7292
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
7293
+ path: _path + "",
7294
+ expected: "IAutoBeRealizeAuthorizationCorrectApplication.IProps",
7295
+ value: input
7296
+ })) && _vo0(input, _path + "", true) || _report(true, {
7297
+ path: _path + "",
7298
+ expected: "IAutoBeRealizeAuthorizationCorrectApplication.IProps",
7299
+ value: input
7300
+ }))(input, "$input", true);
7301
+ const success = 0 === errors.length;
7302
+ return success ? {
7303
+ success,
7304
+ data: input
7305
+ } : {
7306
+ success,
7307
+ errors,
7308
+ data: input
7309
+ };
7310
+ }
7311
+ return {
7312
+ success: true,
7313
+ data: input
7314
+ };
7315
+ };
7316
+ })()
7317
+ } ]
7318
+ },
7319
+ claude: claude$6,
7320
+ llama: claude$6,
7321
+ deepseek: claude$6,
7322
+ 3.1: claude$6
7323
+ };
7324
+
7325
+ const transformRealizeAuthorizationHistories = (ctx, role) => [ {
7326
+ id: v4(),
7327
+ created_at: (new Date).toISOString(),
7328
+ type: "systemMessage",
7329
+ text: '# NestJS Authentication Provider & Decorator Generation AI Agent \n\nYou are a world-class NestJS expert and TypeScript developer. Your role is to automatically generate Provider functions and Decorators for JWT authentication based on given Role information and Prisma Schema. \n\n## Core Mission \n\nGenerate authentication Provider and Decorator code specialized for specific Roles based on Role information provided by users. \n\n## Input Information \n\n- **Role Name**: The authentication role to generate (e.g., admin, user, manager, etc.) \n- **Prisma Schema**: Database table information.\n\n## Code Generation Rules \n\n### 1. Provider Function Generation Rules \n\n- Function name: `{role}Authorize` format (e.g., adminAuthorize, userAuthorize) \n- Must use the `jwtAuthorize` function for JWT token verification \n- Verify payload type and check if `payload.type` matches the correct role \n- Query database using `MyGlobal.prisma.{tableName}` format to fetch **only the authorization model itself** - do not include relations or business logic models (no `include` statements for profile, etc.) \n- Verify that the user actually exists in the database \n- Function return type should be `{Role}Payload` interface \n- Return the `payload` variable whenever feasible in provider functions. \n- **Always check the Prisma schema for validation columns (e.g., `deleted_at`, status fields) within the authorization model and include them in the `where` clause to ensure the user is valid and active.** \n\n### 2. Payload Interface Generation Rules \n\n- Interface name: `{Role}Payload` format (e.g., AdminPayload, UserPayload) \n- Required fields: \n - `id: string & tags.Format<"uuid">`: User ID (UUID format) \n - `type: "{role}"`: Discriminator for role identification \n- Additional fields should be generated according to Role characteristics and "Prisma Schema" \n\n### 3. Decorator Generation Rules \n\n- Decorator name: `{Role}Auth` format (e.g., AdminAuth, UserAuth) \n- Use SwaggerCustomizer to add bearer token security schema to API documentation \n- Use createParamDecorator to implement actual authentication logic \n- Use Singleton pattern to manage decorator instances \n\n### 4. Code Style and Structure\n\n- Comply with TypeScript strict mode \n- Utilize NestJS Exception classes (ForbiddenException, UnauthorizedException) \n- Ensure type safety using typia tags \n- Add appropriate JSDoc comments \n\n## Reference Functions and Examples \n\n### JWT Authentication Function \n\n```typescript\nimport { ForbiddenException, UnauthorizedException } from "@nestjs/common";\nimport jwt from "jsonwebtoken";\n\nimport { MyGlobal } from "../MyGlobal";\n\nexport function jwtAuthorize(props: {\n request: {\n headers: { authorization?: string };\n };\n}) {\n if (!props.request.headers.authorization)\n throw new ForbiddenException("No token value exists");\n else if (\n props.request.headers.authorization.startsWith(BEARER_PREFIX) === false\n )\n throw new UnauthorizedException("Invalid token");\n\n // PARSE TOKEN\n try {\n const token: string = props.request.headers.authorization.substring(\n BEARER_PREFIX.length,\n );\n\n const verified = jwt.verify(token, MyGlobal.env.JWT_SECRET_KEY);\n\n return verified;\n } catch {\n throw new UnauthorizedException("Invalid token");\n }\n}\n\nconst BEARER_PREFIX = "Bearer ";\n``` \n\n### Provider Function Example \n\n```typescript\nimport { ForbiddenException } from "@nestjs/common";\n\nimport { MyGlobal } from "../../MyGlobal";\nimport { jwtAuthorize } from "./jwtAuthorize";\nimport { AdminPayload } from "../../decorators/payload/AdminPayload";\n\nexport async function adminAuthorize(request: {\n headers: {\n authorization?: string;\n };\n}): Promise<AdminPayload> {\n const payload: AdminPayload = jwtAuthorize({ request }) as AdminPayload;\n\n if (payload.type !== "admin") {\n throw new ForbiddenException(`You\'re not ${payload.type}`);\n }\n\n const admin = await MyGlobal.prisma.admins.findFirst({\n where: {\n id: payload.id,\n user: {\n deleted_at: null,\n is_banned: false,\n },\n },\n });\n\n if (admin === null) {\n throw new ForbiddenException("You\'re not enrolled");\n }\n\n return payload;\n}\n``` \n\n### Decorator Example\n\n```typescript\nimport { SwaggerCustomizer } from "@nestia/core";\nimport { ExecutionContext, createParamDecorator } from "@nestjs/common";\nimport { Singleton } from "tstl";\n\nimport { adminAuthorize } from "../providers/authorize/adminAuthorize";\n\nexport const AdminAuth =\n (): ParameterDecorator =>\n (\n target: object,\n propertyKey: string | symbol | undefined,\n parameterIndex: number,\n ): void => {\n SwaggerCustomizer((props) => {\n props.route.security ??= [];\n props.route.security.push({\n bearer: [],\n });\n })(target, propertyKey as string, undefined!);\n singleton.get()(target, propertyKey, parameterIndex);\n };\n\nconst singleton = new Singleton(() =>\n createParamDecorator(async (_0: unknown, ctx: ExecutionContext) => {\n const request = ctx.switchToHttp().getRequest();\n return adminAuthorize(request);\n })(),\n);\n``` \n\n### Decorator Type Example \n\nIn case of the columns related to Date type like `created_at`, `updated_at`, `deleted_at`, must use the `string & tags.Format<\'date-time\'>` Type instead of Date type. \n\n```typescript\nimport { tags } from "typia";\n\nexport interface AdminPayload {\n /**\n * Admin ID.\n */\n id: string & tags.Format<"uuid">;\n\n /**\n * Discriminator for the discriminated union type.\n */\n type: "admin";\n}\n``` \n\n## Output Format \n\nYou must provide your response in a structured JSON format containing the following nested structure: \n\n**provider**: An object containing the authentication Provider function configuration \n\n- **name**: The name of the authentication Provider function in `{role}Authorize` format (e.g., adminAuthorize, userAuthorize). This function verifies JWT tokens and returns user information for the specified role. \n- **code**: Complete TypeScript code for the authentication Provider function only. Must include JWT verification, role checking, database query logic, and proper import statements for the Payload interface.\n\n**decorator**: An object containing the authentication Decorator configuration \n\n- **name**: The name of the Decorator to be generated in `{Role}Auth` format (e.g., AdminAuth, UserAuth). The decorator name used in Controller method parameters. \n- **code**: Complete TypeScript code for the Decorator. Must include complete authentication decorator implementation using SwaggerCustomizer, createParamDecorator, and Singleton pattern.\n\n**decoratorType**: An object containing the Decorator Type configuration\n\n- **name**: The name of the Decorator Type in `{Role}Payload` format (e.g., AdminPayload, UserPayload). Used as the TypeScript type for the authenticated user data.\n- **code**: Complete TypeScript code for the Payload type interface. Must include proper field definitions with typia tags for type safety.\n\n## Work Process \n\n1. Analyze the input Role name \n2. Generate Provider function for the Role \n3. Define Payload interface \n4. Implement Decorator \n5. Verify that all code follows example patterns \n6. Generate response in specified format \n\n## Quality Standards \n\n- Ensure type safety \n- Follow NestJS conventions \n- Complete error handling \n- Code reusability \n- Complete documentation \n\nWhen users provide Role information, generate complete and practical authentication code according to the above rules.'
7330
+ }, {
7331
+ id: v4(),
7332
+ created_at: (new Date).toISOString(),
7333
+ type: "systemMessage",
7334
+ text: [ "## Role", "", role, "", "## Prisma Schema", "", JSON.stringify(ctx.state().prisma?.schemas, null, 2), "", "## File Structure Example", "", "Please refer to the following file structure to construct appropriate import paths:", "", "File locations:", "", `- Decorator Path : ${AuthorizationFileSystem.decoratorPath("AdminAuth.ts")}`, `- Payload Path : ${AuthorizationFileSystem.payloadPath("AdminPayload.ts")}`, `- Provider Path : ${AuthorizationFileSystem.providerPath("adminAuthorize.ts")}`, "" ].join("\n")
7335
+ } ];
7336
+
6858
7337
  async function orchestrateRealizeAuthorization(ctx) {
6859
7338
  const roles = ctx.state().interface?.document.components.authorization?.map((auth => auth.name)) ?? [];
6860
7339
  let completed = 0;
6861
7340
  const templateFiles = {
6862
7341
  "src/MyGlobal.ts": await fs.readFile(path.join(__dirname, "../../../../../internals/template/realize/src/MyGlobal.ts"), "utf-8"),
6863
- "src/authentications/jwtAuthorize.ts": await fs.readFile(path.join(__dirname, "../../../../../internals/template/realize/src/providers/jwtAuthorize.ts"), "utf-8")
7342
+ [AuthorizationFileSystem.providerPath("jwtAuthorize")]: await fs.readFile(path.join(__dirname, "../../../../../internals/template/realize/src/providers/jwtAuthorize.ts"), "utf-8")
6864
7343
  };
6865
7344
  ctx.dispatch({
6866
7345
  type: "realizeAuthorizationStart",
@@ -6900,7 +7379,7 @@ async function process$2(ctx, role, templateFiles) {
6900
7379
  describe: null
6901
7380
  }
6902
7381
  },
6903
- histories: transformRealizeDecoratorHistories(ctx, role),
7382
+ histories: transformRealizeAuthorizationHistories(ctx, role),
6904
7383
  controllers: [ createApplication$4({
6905
7384
  model: ctx.model,
6906
7385
  build: next => {
@@ -6919,17 +7398,17 @@ async function process$2(ctx, role, templateFiles) {
6919
7398
  decorator: {
6920
7399
  location: AuthorizationFileSystem.decoratorPath(pointer.value.decorator.name),
6921
7400
  name: pointer.value.decorator.name,
6922
- content: pointer.value.decorator.code
7401
+ content: pointer.value.decorator.content
6923
7402
  },
6924
7403
  payload: {
6925
7404
  location: AuthorizationFileSystem.payloadPath(pointer.value.payload.name),
6926
7405
  name: pointer.value.payload.name,
6927
- content: pointer.value.payload.code
7406
+ content: pointer.value.payload.content
6928
7407
  },
6929
7408
  provider: {
6930
7409
  location: AuthorizationFileSystem.providerPath(pointer.value.provider.name),
6931
7410
  name: pointer.value.provider.name,
6932
- content: pointer.value.provider.code
7411
+ content: pointer.value.provider.content
6933
7412
  }
6934
7413
  };
6935
7414
  const compiled = ctx.state().prisma?.compiled;
@@ -6973,7 +7452,7 @@ async function correctDecorator(ctx, auth, prismaClients, templateFiles, life =
6973
7452
  describe: null
6974
7453
  }
6975
7454
  },
6976
- histories: transformRealizeDecoratorCorrectHistories(ctx, auth, templateFiles, result.diagnostics),
7455
+ histories: transformRealizeAuthorizationCorrectHistories(ctx, auth, templateFiles, result.diagnostics),
6977
7456
  controllers: [ createApplication$4({
6978
7457
  model: ctx.model,
6979
7458
  build: next => {
@@ -6992,27 +7471,24 @@ async function correctDecorator(ctx, auth, prismaClients, templateFiles, life =
6992
7471
  decorator: {
6993
7472
  location: auth.decorator.location,
6994
7473
  name: pointer.value.decorator.name,
6995
- content: pointer.value.decorator.code
7474
+ content: pointer.value.decorator.content
6996
7475
  },
6997
7476
  payload: {
6998
7477
  location: auth.payload.location,
6999
7478
  name: pointer.value.payload.name,
7000
- content: pointer.value.payload.code
7479
+ content: pointer.value.payload.content
7001
7480
  },
7002
7481
  provider: {
7003
7482
  location: auth.provider.location,
7004
7483
  name: pointer.value.provider.name,
7005
- content: pointer.value.provider.code
7484
+ content: pointer.value.provider.content
7006
7485
  }
7007
7486
  };
7008
- ctx.dispatch({
7009
- type: "realizeAuthorizationCorrect",
7010
- created_at: (new Date).toISOString(),
7011
- authorization: corrected,
7012
- result,
7013
- step: ctx.state().test?.step ?? 0
7014
- });
7015
- return await correctDecorator(ctx, corrected, prismaClients, templateFiles, life - 1);
7487
+ const res = await orchestrateRealizeAuthorizationCorrect(ctx, corrected, prismaClients, templateFiles, life - 1);
7488
+ return {
7489
+ ...res,
7490
+ role: auth.role
7491
+ };
7016
7492
  }
7017
7493
 
7018
7494
  function createApplication$4(props) {
@@ -7039,125 +7515,125 @@ const claude$5 = {
7039
7515
  functions: [ {
7040
7516
  name: "createDecorator",
7041
7517
  parameters: {
7042
- description: "Current Type: {@link IAutoBeRealizeDecoratorApplication.IProps}",
7518
+ description: "Current Type: {@link IAutoBeRealizeAuthorizationApplication.IProps}",
7043
7519
  type: "object",
7044
7520
  properties: {
7045
7521
  provider: {
7046
7522
  description: "Authentication Provider function configuration containing the function\nname and implementation code. The Provider handles JWT token\nverification, role validation, and database queries to authenticate\nusers.",
7047
- $ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IProvider"
7523
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
7048
7524
  },
7049
7525
  decorator: {
7050
7526
  description: "Authentication Decorator configuration containing the decorator name and\nimplementation code. The Decorator integrates with NestJS parameter\ndecorators to automatically inject authenticated user data into\nController methods.",
7051
- $ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IDecorator"
7527
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
7052
7528
  },
7053
7529
  payload: {
7054
7530
  description: "Authentication Payload Type configuration containing the payload type\nname and implementation code. The Payload Type is used to define the\nstructure of the authenticated user data that will be injected into\nController methods when using the decorator. It serves as the TypeScript\ntype for the parameter in Controller method signatures.",
7055
- $ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IPayloadType"
7531
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
7056
7532
  }
7057
7533
  },
7058
7534
  required: [ "provider", "decorator", "payload" ],
7059
7535
  additionalProperties: false,
7060
7536
  $defs: {
7061
- "IAutoBeRealizeDecoratorApplication.IProvider": {
7537
+ "IAutoBeRealizeAuthorizationApplication.IProvider": {
7062
7538
  type: "object",
7063
7539
  properties: {
7064
7540
  name: {
7065
7541
  description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.",
7066
7542
  type: "string"
7067
7543
  },
7068
- code: {
7544
+ content: {
7069
7545
  description: "Complete TypeScript code for the authentication Provider function and its\ncorresponding Payload interface. Must include: JWT token verification\nusing jwtAuthorize function, role type checking against payload.type,\ndatabase query using MyGlobal.prisma.{tableName} pattern to verify user\nexistence, proper error handling with ForbiddenException and\nUnauthorizedException, and the Payload interface definition with id (UUID\nformat) and type (role discriminator) fields using typia tags.",
7070
7546
  type: "string"
7071
7547
  }
7072
7548
  },
7073
- required: [ "name", "code" ]
7549
+ required: [ "name", "content" ]
7074
7550
  },
7075
- "IAutoBeRealizeDecoratorApplication.IDecorator": {
7551
+ "IAutoBeRealizeAuthorizationApplication.IDecorator": {
7076
7552
  type: "object",
7077
7553
  properties: {
7078
7554
  name: {
7079
7555
  description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7080
7556
  type: "string"
7081
7557
  },
7082
- code: {
7558
+ content: {
7083
7559
  description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
7084
7560
  type: "string"
7085
7561
  }
7086
7562
  },
7087
- required: [ "name", "code" ]
7563
+ required: [ "name", "content" ]
7088
7564
  },
7089
- "IAutoBeRealizeDecoratorApplication.IPayloadType": {
7565
+ "IAutoBeRealizeAuthorizationApplication.IPayloadType": {
7090
7566
  type: "object",
7091
7567
  properties: {
7092
7568
  name: {
7093
7569
  description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7094
7570
  type: "string"
7095
7571
  },
7096
- code: {
7572
+ content: {
7097
7573
  description: "The TypeScript code for the Payload type in {Role}Payload format (e.g.,\nAdminPayload, UserPayload). This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator. It serves as the TypeScript type for the\nparameter in Controller method signatures.",
7098
7574
  type: "string"
7099
7575
  }
7100
7576
  },
7101
- required: [ "name", "code" ]
7577
+ required: [ "name", "content" ]
7102
7578
  }
7103
7579
  }
7104
7580
  },
7105
7581
  validate: (() => {
7106
7582
  const _io0 = input => "object" === typeof input.provider && null !== input.provider && _io1(input.provider) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload));
7107
- const _io1 = input => "string" === typeof input.name && "string" === typeof input.code;
7108
- const _io2 = input => "string" === typeof input.name && "string" === typeof input.code;
7109
- const _io3 = input => "string" === typeof input.name && "string" === typeof input.code;
7583
+ const _io1 = input => "string" === typeof input.name && "string" === typeof input.content;
7584
+ const _io2 = input => "string" === typeof input.name && "string" === typeof input.content;
7585
+ const _io3 = input => "string" === typeof input.name && "string" === typeof input.content;
7110
7586
  const _vo0 = (input, _path, _exceptionable = true) => [ ("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
7111
7587
  path: _path + ".provider",
7112
- expected: "IAutoBeRealizeDecoratorApplication.IProvider",
7588
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7113
7589
  value: input.provider
7114
7590
  })) && _vo1(input.provider, _path + ".provider", _exceptionable) || _report(_exceptionable, {
7115
7591
  path: _path + ".provider",
7116
- expected: "IAutoBeRealizeDecoratorApplication.IProvider",
7592
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7117
7593
  value: input.provider
7118
7594
  }), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
7119
7595
  path: _path + ".decorator",
7120
- expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
7596
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7121
7597
  value: input.decorator
7122
7598
  })) && _vo2(input.decorator, _path + ".decorator", _exceptionable) || _report(_exceptionable, {
7123
7599
  path: _path + ".decorator",
7124
- expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
7600
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7125
7601
  value: input.decorator
7126
7602
  }), ("object" === typeof input.payload && null !== input.payload || _report(_exceptionable, {
7127
7603
  path: _path + ".payload",
7128
- expected: "IAutoBeRealizeDecoratorApplication.IPayloadType",
7604
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7129
7605
  value: input.payload
7130
7606
  })) && _vo3(input.payload, _path + ".payload", _exceptionable) || _report(_exceptionable, {
7131
7607
  path: _path + ".payload",
7132
- expected: "IAutoBeRealizeDecoratorApplication.IPayloadType",
7608
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7133
7609
  value: input.payload
7134
7610
  }) ].every((flag => flag));
7135
7611
  const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7136
7612
  path: _path + ".name",
7137
7613
  expected: "string",
7138
7614
  value: input.name
7139
- }), "string" === typeof input.code || _report(_exceptionable, {
7140
- path: _path + ".code",
7615
+ }), "string" === typeof input.content || _report(_exceptionable, {
7616
+ path: _path + ".content",
7141
7617
  expected: "string",
7142
- value: input.code
7618
+ value: input.content
7143
7619
  }) ].every((flag => flag));
7144
7620
  const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7145
7621
  path: _path + ".name",
7146
7622
  expected: "string",
7147
7623
  value: input.name
7148
- }), "string" === typeof input.code || _report(_exceptionable, {
7149
- path: _path + ".code",
7624
+ }), "string" === typeof input.content || _report(_exceptionable, {
7625
+ path: _path + ".content",
7150
7626
  expected: "string",
7151
- value: input.code
7627
+ value: input.content
7152
7628
  }) ].every((flag => flag));
7153
7629
  const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7154
7630
  path: _path + ".name",
7155
7631
  expected: "string",
7156
7632
  value: input.name
7157
- }), "string" === typeof input.code || _report(_exceptionable, {
7158
- path: _path + ".code",
7633
+ }), "string" === typeof input.content || _report(_exceptionable, {
7634
+ path: _path + ".content",
7159
7635
  expected: "string",
7160
- value: input.code
7636
+ value: input.content
7161
7637
  }) ].every((flag => flag));
7162
7638
  const __is = input => "object" === typeof input && null !== input && _io0(input);
7163
7639
  let errors;
@@ -7168,11 +7644,11 @@ const claude$5 = {
7168
7644
  _report = __typia_transform__validateReport._validateReport(errors);
7169
7645
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
7170
7646
  path: _path + "",
7171
- expected: "IAutoBeRealizeDecoratorApplication.IProps",
7647
+ expected: "IAutoBeRealizeAuthorizationApplication.IProps",
7172
7648
  value: input
7173
7649
  })) && _vo0(input, _path + "", true) || _report(true, {
7174
7650
  path: _path + "",
7175
- expected: "IAutoBeRealizeDecoratorApplication.IProps",
7651
+ expected: "IAutoBeRealizeAuthorizationApplication.IProps",
7176
7652
  value: input
7177
7653
  }))(input, "$input", true);
7178
7654
  const success = 0 === errors.length;
@@ -7205,122 +7681,122 @@ const collection$5 = {
7205
7681
  functions: [ {
7206
7682
  name: "createDecorator",
7207
7683
  parameters: {
7208
- description: "Current Type: {@link IAutoBeRealizeDecoratorApplication.IProps}\n\n### Description of {@link provider} property:\n\n> Authentication Provider function configuration containing the function\n> name and implementation code. The Provider handles JWT token\n> verification, role validation, and database queries to authenticate\n> users.\n\n### Description of {@link decorator} property:\n\n> Authentication Decorator configuration containing the decorator name and\n> implementation code. The Decorator integrates with NestJS parameter\n> decorators to automatically inject authenticated user data into\n> Controller methods.\n\n### Description of {@link payload} property:\n\n> Authentication Payload Type configuration containing the payload type\n> name and implementation code. The Payload Type is used to define the\n> structure of the authenticated user data that will be injected into\n> Controller methods when using the decorator. It serves as the TypeScript\n> type for the parameter in Controller method signatures.",
7684
+ description: "Current Type: {@link IAutoBeRealizeAuthorizationApplication.IProps}\n\n### Description of {@link provider} property:\n\n> Authentication Provider function configuration containing the function\n> name and implementation code. The Provider handles JWT token\n> verification, role validation, and database queries to authenticate\n> users.\n\n### Description of {@link decorator} property:\n\n> Authentication Decorator configuration containing the decorator name and\n> implementation code. The Decorator integrates with NestJS parameter\n> decorators to automatically inject authenticated user data into\n> Controller methods.\n\n### Description of {@link payload} property:\n\n> Authentication Payload Type configuration containing the payload type\n> name and implementation code. The Payload Type is used to define the\n> structure of the authenticated user data that will be injected into\n> Controller methods when using the decorator. It serves as the TypeScript\n> type for the parameter in Controller method signatures.",
7209
7685
  type: "object",
7210
7686
  properties: {
7211
7687
  provider: {
7212
- $ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IProvider"
7688
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
7213
7689
  },
7214
7690
  decorator: {
7215
- $ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IDecorator"
7691
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
7216
7692
  },
7217
7693
  payload: {
7218
- $ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IPayloadType"
7694
+ $ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
7219
7695
  }
7220
7696
  },
7221
7697
  required: [ "provider", "decorator", "payload" ],
7222
7698
  additionalProperties: false,
7223
7699
  $defs: {
7224
- "IAutoBeRealizeDecoratorApplication.IProvider": {
7700
+ "IAutoBeRealizeAuthorizationApplication.IProvider": {
7225
7701
  type: "object",
7226
7702
  properties: {
7227
7703
  name: {
7228
7704
  description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.",
7229
7705
  type: "string"
7230
7706
  },
7231
- code: {
7707
+ content: {
7232
7708
  description: "Complete TypeScript code for the authentication Provider function and its\ncorresponding Payload interface. Must include: JWT token verification\nusing jwtAuthorize function, role type checking against payload.type,\ndatabase query using MyGlobal.prisma.{tableName} pattern to verify user\nexistence, proper error handling with ForbiddenException and\nUnauthorizedException, and the Payload interface definition with id (UUID\nformat) and type (role discriminator) fields using typia tags.",
7233
7709
  type: "string"
7234
7710
  }
7235
7711
  },
7236
- required: [ "name", "code" ]
7712
+ required: [ "name", "content" ]
7237
7713
  },
7238
- "IAutoBeRealizeDecoratorApplication.IDecorator": {
7714
+ "IAutoBeRealizeAuthorizationApplication.IDecorator": {
7239
7715
  type: "object",
7240
7716
  properties: {
7241
7717
  name: {
7242
7718
  description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7243
7719
  type: "string"
7244
7720
  },
7245
- code: {
7721
+ content: {
7246
7722
  description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
7247
7723
  type: "string"
7248
7724
  }
7249
7725
  },
7250
- required: [ "name", "code" ]
7726
+ required: [ "name", "content" ]
7251
7727
  },
7252
- "IAutoBeRealizeDecoratorApplication.IPayloadType": {
7728
+ "IAutoBeRealizeAuthorizationApplication.IPayloadType": {
7253
7729
  type: "object",
7254
7730
  properties: {
7255
7731
  name: {
7256
7732
  description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
7257
7733
  type: "string"
7258
7734
  },
7259
- code: {
7735
+ content: {
7260
7736
  description: "The TypeScript code for the Payload type in {Role}Payload format (e.g.,\nAdminPayload, UserPayload). This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator. It serves as the TypeScript type for the\nparameter in Controller method signatures.",
7261
7737
  type: "string"
7262
7738
  }
7263
7739
  },
7264
- required: [ "name", "code" ]
7740
+ required: [ "name", "content" ]
7265
7741
  }
7266
7742
  }
7267
7743
  },
7268
7744
  validate: (() => {
7269
7745
  const _io0 = input => "object" === typeof input.provider && null !== input.provider && _io1(input.provider) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload));
7270
- const _io1 = input => "string" === typeof input.name && "string" === typeof input.code;
7271
- const _io2 = input => "string" === typeof input.name && "string" === typeof input.code;
7272
- const _io3 = input => "string" === typeof input.name && "string" === typeof input.code;
7746
+ const _io1 = input => "string" === typeof input.name && "string" === typeof input.content;
7747
+ const _io2 = input => "string" === typeof input.name && "string" === typeof input.content;
7748
+ const _io3 = input => "string" === typeof input.name && "string" === typeof input.content;
7273
7749
  const _vo0 = (input, _path, _exceptionable = true) => [ ("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
7274
7750
  path: _path + ".provider",
7275
- expected: "IAutoBeRealizeDecoratorApplication.IProvider",
7751
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7276
7752
  value: input.provider
7277
7753
  })) && _vo1(input.provider, _path + ".provider", _exceptionable) || _report(_exceptionable, {
7278
7754
  path: _path + ".provider",
7279
- expected: "IAutoBeRealizeDecoratorApplication.IProvider",
7755
+ expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
7280
7756
  value: input.provider
7281
7757
  }), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
7282
7758
  path: _path + ".decorator",
7283
- expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
7759
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7284
7760
  value: input.decorator
7285
7761
  })) && _vo2(input.decorator, _path + ".decorator", _exceptionable) || _report(_exceptionable, {
7286
7762
  path: _path + ".decorator",
7287
- expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
7763
+ expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
7288
7764
  value: input.decorator
7289
7765
  }), ("object" === typeof input.payload && null !== input.payload || _report(_exceptionable, {
7290
7766
  path: _path + ".payload",
7291
- expected: "IAutoBeRealizeDecoratorApplication.IPayloadType",
7767
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7292
7768
  value: input.payload
7293
7769
  })) && _vo3(input.payload, _path + ".payload", _exceptionable) || _report(_exceptionable, {
7294
7770
  path: _path + ".payload",
7295
- expected: "IAutoBeRealizeDecoratorApplication.IPayloadType",
7771
+ expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
7296
7772
  value: input.payload
7297
7773
  }) ].every((flag => flag));
7298
7774
  const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7299
7775
  path: _path + ".name",
7300
7776
  expected: "string",
7301
7777
  value: input.name
7302
- }), "string" === typeof input.code || _report(_exceptionable, {
7303
- path: _path + ".code",
7778
+ }), "string" === typeof input.content || _report(_exceptionable, {
7779
+ path: _path + ".content",
7304
7780
  expected: "string",
7305
- value: input.code
7781
+ value: input.content
7306
7782
  }) ].every((flag => flag));
7307
7783
  const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7308
7784
  path: _path + ".name",
7309
7785
  expected: "string",
7310
7786
  value: input.name
7311
- }), "string" === typeof input.code || _report(_exceptionable, {
7312
- path: _path + ".code",
7787
+ }), "string" === typeof input.content || _report(_exceptionable, {
7788
+ path: _path + ".content",
7313
7789
  expected: "string",
7314
- value: input.code
7790
+ value: input.content
7315
7791
  }) ].every((flag => flag));
7316
7792
  const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name || _report(_exceptionable, {
7317
7793
  path: _path + ".name",
7318
7794
  expected: "string",
7319
7795
  value: input.name
7320
- }), "string" === typeof input.code || _report(_exceptionable, {
7321
- path: _path + ".code",
7796
+ }), "string" === typeof input.content || _report(_exceptionable, {
7797
+ path: _path + ".content",
7322
7798
  expected: "string",
7323
- value: input.code
7799
+ value: input.content
7324
7800
  }) ].every((flag => flag));
7325
7801
  const __is = input => "object" === typeof input && null !== input && _io0(input);
7326
7802
  let errors;
@@ -7331,11 +7807,11 @@ const collection$5 = {
7331
7807
  _report = __typia_transform__validateReport._validateReport(errors);
7332
7808
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
7333
7809
  path: _path + "",
7334
- expected: "IAutoBeRealizeDecoratorApplication.IProps",
7810
+ expected: "IAutoBeRealizeAuthorizationApplication.IProps",
7335
7811
  value: input
7336
7812
  })) && _vo0(input, _path + "", true) || _report(true, {
7337
7813
  path: _path + "",
7338
- expected: "IAutoBeRealizeDecoratorApplication.IProps",
7814
+ expected: "IAutoBeRealizeAuthorizationApplication.IProps",
7339
7815
  value: input
7340
7816
  }))(input, "$input", true);
7341
7817
  const success = 0 === errors.length;
@@ -8019,8 +8495,8 @@ const orchestrateRealize = ctx => async props => {
8019
8495
  reason: props.reason,
8020
8496
  step: ctx.state().test?.step ?? 0
8021
8497
  });
8022
- const decorators = await orchestrateRealizeAuthorization(ctx);
8023
- const files = await writeCodeUntilCompilePassed(ctx, ops, decorators, 2);
8498
+ const authorizations = await orchestrateRealizeAuthorization(ctx);
8499
+ const files = await writeCodeUntilCompilePassed(ctx, ops, authorizations, 2);
8024
8500
  const now = (new Date).toISOString();
8025
8501
  const realize = ctx.state().realize;
8026
8502
  if (realize !== null) {
@@ -8307,6 +8783,8 @@ const correct = async (ctx, content, validate, life) => {
8307
8783
  ctx.usage().record(tokenUsage, [ "test" ]);
8308
8784
  }));
8309
8785
  if (pointer.value === null) throw new Error("Failed to modify test code.");
8786
+ const compiler = await ctx.compiler();
8787
+ pointer.value.final = await compiler.typescript.beautify(pointer.value.final);
8310
8788
  ctx.dispatch({
8311
8789
  type: "testCorrect",
8312
8790
  created_at: (new Date).toISOString(),
@@ -9338,6 +9816,8 @@ async function process(ctx, scenario, artifacts) {
9338
9816
  ctx.usage().record(tokenUsage, [ "test" ]);
9339
9817
  }));
9340
9818
  if (pointer.value === null) throw new Error("Failed to create test code.");
9819
+ const compiler = await ctx.compiler();
9820
+ pointer.value.final = await compiler.typescript.beautify(pointer.value.final);
9341
9821
  return pointer.value;
9342
9822
  }
9343
9823