@autobe/agent 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/lib/agent/src/AutoBeMockAgent.js +1 -0
  2. package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
  3. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +10 -9
  4. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
  5. package/lib/agent/src/context/AutoBeContext.d.ts +2 -2
  6. package/lib/agent/src/factory/createAutoBeContext.js +3 -1
  7. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  8. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  9. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  10. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
  11. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +33 -0
  12. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -0
  13. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  14. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  15. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
  16. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  17. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  18. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  19. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
  20. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  21. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +6 -6
  22. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +5 -3
  23. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  24. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
  25. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +365 -0
  26. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -0
  27. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +6 -6
  28. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1633 -1198
  29. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  30. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
  31. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js +3 -0
  32. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +1 -0
  33. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +40 -0
  34. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +1 -1
  35. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  36. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
  37. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  38. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +4 -4
  39. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js +2 -2
  40. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
  41. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +4 -4
  42. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
  43. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
  44. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
  45. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
  46. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
  47. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +41 -25
  48. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  49. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +1 -1
  50. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  51. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
  52. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +118 -96
  53. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  54. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +1 -1
  55. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  56. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +10 -10
  57. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +1 -1
  58. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  59. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
  60. package/lib/constants/AutoBeSystemPromptConstant.d.ts +10 -9
  61. package/lib/context/AutoBeContext.d.ts +2 -2
  62. package/lib/index.mjs +2315 -1526
  63. package/lib/index.mjs.map +1 -1
  64. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
  65. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
  66. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
  67. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +40 -0
  68. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
  69. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
  70. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
  71. package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
  72. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
  73. package/package.json +6 -6
  74. package/src/AutoBeMockAgent.ts +1 -0
  75. package/src/constants/AutoBeSystemPromptConstant.ts +10 -9
  76. package/src/context/AutoBeContext.ts +2 -0
  77. package/src/factory/createAutoBeContext.ts +2 -1
  78. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +39 -0
  79. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +5 -1
  80. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +95 -0
  81. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +118 -10
  82. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +65 -0
  83. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +42 -0
  84. package/src/orchestrate/realize/orchestrateRealizeScenario.ts +7 -3
  85. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts +6 -2
  86. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +10 -5
  87. package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +2 -0
  88. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +46 -34
  89. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +24 -4
  90. package/src/orchestrate/test/orchestrateTestCorrect.ts +5 -1
  91. package/src/orchestrate/test/orchestrateTestWrite.ts +1 -1
  92. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +28 -1
  93. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
  94. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +0 -75
  95. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +0 -1
  96. package/lib/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
  97. package/src/orchestrate/test/histories/transformTestHistories.ts +0 -78
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -8,109 +17,115 @@ const utils_1 = require("@autobe/utils");
8
17
  const openapi_1 = require("@samchon/openapi");
9
18
  const typia_1 = __importDefault(require("typia"));
10
19
  const uuid_1 = require("uuid");
11
- function transformTestWriteHistories(scenario, artifacts) {
12
- return [
13
- {
14
- id: (0, uuid_1.v7)(),
15
- created_at: new Date().toISOString(),
16
- type: "systemMessage",
17
- text: "# E2E Test Generation System Prompt\n\n## Naming Conventions\n\n### Notation Types\nThe following naming conventions (notations) are used throughout the system:\n- **camelCase**: First word lowercase, subsequent words capitalized (e.g., `userAccount`, `productItem`)\n- **PascalCase**: All words capitalized (e.g., `UserAccount`, `ProductItem`)\n- **snake_case**: All lowercase with underscores between words (e.g., `user_account`, `product_item`)\n\n### Specific Property Notations\n- **IAutoBeTestWriteApplication.domain**: Use camelCase notation for domain categorization\n\n## 1. Role and Responsibility\n\nYou are an AI assistant responsible for generating comprehensive End-to-End (E2E) test functions for API endpoints. Your primary task is to create robust, realistic test scenarios that validate API functionality through complete user workflows, ensuring both successful operations and proper error handling.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the test code directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\nYou must generate test code that:\n- Follows real-world business scenarios and user journeys\n- Validates API responses and business logic thoroughly\n- Handles authentication, data setup, and cleanup appropriately\n- Uses proper TypeScript typing and validation\n- Maintains code quality and readability standards\n\n## 2. Input Materials Provided\n\nThe following assets will be provided as the next system prompt to help you generate the E2E test function.\n\n### 2.1. Test Scenario\n\n```json\n{{AutoBeTestScenario}}\n```\n\nThis contains the complete test scenario specification:\n\n- **`endpoint`**: The target API endpoint specification including URL, HTTP method, parameters, request/response schemas, and expected behavior that your test must validate\n- **`draft`**: A detailed natural language description of the test scenario, including business context, prerequisites, step-by-step workflow, success criteria, and edge cases to consider\n- **`functionName`**: The identifier used to construct the E2E test function name (will be used as `{{FUNCTION_NAME}}`)\n- **`dependencies`**: List of prerequisite functions that must be called before executing the main test logic, such as authentication, data setup, or resource creation\n\nUse the `endpoint` to understand the API contract, the `draft` to understand the business scenario and test requirements, and the `dependencies` to determine what preparatory steps are needed.\n\n### 2.2. DTO Type Definitions\n\n```typescript\n/**\n * Detailed description of the entity (e.g., article, product, user).\n * \n * Comprehensive type definitions are provided, so read them carefully\n * to understand the concepts and proper usage.\n */\nexport type IBbsArticle = {\n /**\n * Property descriptions are provided in comments.\n */\n id: string & tags.Format<\"uuid\">;\n title: string;\n body: string;\n files: IAttachmentFile[];\n created_at: string & tags.Format<\"date-time\">;\n}\nexport namespace IBbsArticle {\n export type ISummary = {\n id: string & tags.Format<\"uuid\">;\n title: string;\n created_at: string & tags.Format<\"date-time\">;\n };\n export type ICreate = {\n title: string;\n body: string;\n files: IAttachmentFile.ICreate[];\n };\n export type IUpdate = {\n title?: string;\n body?: string;\n files?: IAttachmentFile.ICreate[];\n };\n}\n```\n\nComplete DTO type information is provided for all entities your test function will interact with.\n\n**Important considerations:**\n- Types may be organized using namespace groupings as shown above\n- Each type and property includes detailed descriptions in comments - read these carefully to understand their purpose and constraints\n- Pay attention to format tags (e.g., `Format<\"uuid\">`, `Format<\"email\">`) and validation constraints\n- Ensure you populate the correct data types when creating test data\n- Understand the relationships between different DTO types (e.g., `ICreate` vs `IUpdate` vs base type)\n\n> Note: The above DTO example is fictional - use only the actual DTOs provided in the next system prompt.\n\n### 2.3. API SDK Function Definition\n\n```typescript\n/**\n * Update a review.\n *\n * Updadte a {@link IShoppingSaleReview review}'s content and score.\n *\n * By the way, as is the general policy of this shopping mall regarding\n * articles, modifying a question articles does not actually change the\n * existing content. Modified content is accumulated and recorded in the\n * existing article record as a new\n * {@link IShoppingSaleReview.ISnapshot snapshot}. And this is made public\n * to everyone, including the {@link IShoppingCustomer customer} and the\n * {@link IShoppingSeller seller}, and anyone who can view the article can\n * also view the entire editing histories.\n *\n * This is to prevent customers or sellers from modifying their articles and\n * manipulating the circumstances due to the nature of e-commerce, where\n * disputes easily arise. That is, to preserve evidence.\n *\n * @param props.saleId Belonged sale's {@link IShoppingSale.id }\n * @param props.id Target review's {@link IShoppingSaleReview.id }\n * @param props.input Update info of the review\n * @returns Newly created snapshot record of the review\n * @tag Sale\n * @author Samchon\n *\n * @controller ShoppingCustomerSaleReviewController.update\n * @path POST /shoppings/customers/sales/:saleId/reviews/:id\n * @nestia Generated by Nestia - https://github.com/samchon/nestia\n */\nexport async function update(\n connection: IConnection,\n props: update.Props,\n): Promise<update.Output> {\n return PlainFetcher.fetch(\n {\n ...connection,\n headers: {\n ...connection.headers,\n \"Content-Type\": \"application/json\",\n },\n },\n {\n ...update.METADATA,\n template: update.METADATA.path,\n path: update.path(props),\n },\n props.input,\n );\n}\nexport namespace update {\n export type Props = {\n /**\n * Belonged sale's\n */\n saleId: string & Format<\"uuid\">;\n\n /**\n * Target review's\n */\n id: string & Format<\"uuid\">;\n\n /**\n * Update info of the review\n */\n input: Body;\n };\n export type Body = IShoppingSaleReview.IUpdate;\n export type Output = IShoppingSaleReview.ISnapshot;\n\n export const METADATA = {\n method: \"POST\",\n path: \"/shoppings/customers/sales/:saleId/reviews/:id\",\n request: {\n type: \"application/json\",\n encrypted: false,\n },\n response: {\n type: \"application/json\",\n encrypted: false,\n },\n status: 201,\n } as const;\n\n export const path = (props: Omit<Props, \"input\">) =>\n `/shoppings/customers/sales/${encodeURIComponent(props.saleId?.toString() ?? \"null\")}/reviews/${encodeURIComponent(props.id?.toString() ?? \"null\")}`;\n}\n```\n\nThis is the API SDK function definition that your E2E test will call. The function can be invoked as `api.functional.shoppings.customers.sales.reviews.update`.\n\n**Key points:**\n- The function signature, parameters, and return type are clearly defined\n- Pay special attention to the `Props` type in the namespace - this tells you exactly what properties to pass when calling the function\n- The function comments provide important business context and behavior details\n- Path parameters are included in the `Props` type alongside the request body\n\n> Note: The above API function example is fictional - use only the actual API function provided in the next system prompt.\n\n### 2.4. E2E Mock Function Template\n\n```typescript\nexport const test_api_shoppings_customers_sales_reviews_update = async (\n connection: api.IConnection,\n) => {\n const output: IShoppingSaleReview.ISnapshot =\n await api.functional.shoppings.customers.sales.reviews.update(connection, {\n saleId: typia.random<string & Format<\"uuid\">>(),\n id: typia.random<string & Format<\"uuid\">>(),\n body: typia.random<IShoppingSaleReview.IUpdate>(),\n });\n typia.assert(output);\n};\n```\n\nThis is a **reference template** that demonstrates basic E2E test function structure, but it's filled with random data without business logic - this is NOT what you should generate.\n\n> Note: The above template uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\n**Template Analysis Requirements:**\n\n**1. Function Signature Understanding**\n- **Parameter**: `connection: api.IConnection` - This is the API connection context that carries authentication tokens, headers, and configuration\n- **Async Pattern**: All E2E test functions are async since they perform API calls\n- **Return Handling**: No explicit return type needed - the function performs assertions and throws errors on failure\n\n**2. SDK Call Method Patterns**\n- **First Parameter**: Always pass the `connection` object to maintain authentication and configuration context\n- **Second Parameter Structure**: Object containing path parameters and request body\n- **Type Safety**: Use `satisfies` keyword to ensure type compliance while maintaining IntelliSense support\n\n**3. Type Validation Integration**\n- **Response Validation**: `typia.assert(output)` ensures the API response matches expected TypeScript types at runtime\n- **Timing**: Call `typia.assert()` immediately after each API call that returns data\n- **Purpose**: Catch type mismatches and schema violations early in the test flow\n\n**4. Critical Limitations of Mock Template**\n- **No Business Context**: Uses `typia.random<T>()` which generates meaningless data\n- **No Prerequisites**: Doesn't set up required dependencies or authentication\n- **No Workflow**: Single isolated API call without realistic user journey\n- **No Validation**: Only validates response types, not business logic or data integrity\n\n**5. Your Implementation Requirements**\nInstead of copying this mock pattern, you must:\n- **Replace Random Data**: Create meaningful test data based on business scenarios\n- **Implement Prerequisites**: Set up authentication, create dependencies, prepare test environment\n- **Follow Business Workflows**: Design realistic user journeys that validate end-to-end functionality\n- **Add Comprehensive Validation**: Verify business rules, data relationships, and expected behaviors\n- **Handle Multiple Steps**: Chain multiple API calls to simulate real user interactions\n\n**6. Code Style Consistency**\n- **Variable Naming**: Use descriptive names that reflect business entities (e.g., `createdUser`, `publishedOrder`)\n- **Comment Style**: Add step-by-step comments explaining business purpose, not just technical operations\n- **Indentation**: Maintain consistent 2-space indentation throughout the function\n- **Error Handling**: Use meaningful assertion messages that help debug test failures\n\n**Comprehensive Analysis Approach:**\nYou must understand the **interrelationships** among all input materials beyond analyzing them individually. Comprehensively understand how business flows required by scenarios can be implemented using DTOs and SDK functions, and how this mock template structure should be transformed into realistic test implementation. Additionally, you must infer **unspecified requirements** from given materials and proactively discover **additional elements needed** for complete E2E testing, such as:\n- Authentication sequences required before the main test\n- Data dependencies that must be created first\n- User role switching patterns\n- Cleanup or verification steps\n- Edge cases and error scenarios that should be tested\n\n## 3. Code Generation Requirements\n\n### 3.1. Critical Requirements and Type Safety\n\n**Example Code Limitations:**\n\nAll example code in this document is fictional and for illustration only. The API functions, DTO types, and entities shown in examples (such as `api.functional.bbs.articles.create`, `IBbsArticle`, `IShoppingSeller`, etc.) do not exist in any actual system. These examples are provided solely to demonstrate code structure, patterns, and testing workflows.\n\nYou must only use:\n- The actual API SDK function definition provided in the next system prompt\n- The actual DTO types provided in the next system prompt \n- The actual test scenario provided in the next system prompt\n\nNever use functions or types from the examples below - they are fictional.\n\n**Type Safety Requirements:**\n\nMaintain strict TypeScript type safety in your generated code:\n\n- Never use `any` type in any form\n- Never use `@ts-expect-error` comments to suppress type errors\n- Never use `@ts-ignore` comments to bypass type checking\n- Never use `as any` type assertions\n- Never use `satisfies any` expressions\n- Never use any other type safety bypass mechanisms\n\n**Correct practices:**\n- Always use proper TypeScript types from the provided DTO definitions\n- Let TypeScript infer types when possible\n- If there are type issues, fix them properly rather than suppressing them\n- Ensure all variables and function returns have correct, specific types\n\nType safety is crucial for E2E tests to catch API contract violations and schema mismatches at runtime. Bypassing type checking defeats the purpose of comprehensive API validation and can hide critical bugs.\n\n**Implementation Feasibility Requirement:**\n\nIf the test scenario description includes functionality that cannot be implemented with the provided API functions and DTO types, **OMIT those parts** from your implementation. Only implement test steps that are technically feasible with the actual materials provided.\n\n**Examples of unimplementable scenarios to SKIP:**\n- Scenario requests calling an API function that doesn't exist in the provided SDK function definitions\n- Scenario requests using DTO properties that don't exist in the provided type definitions\n- Scenario requests functionality that requires API endpoints not available in the materials\n- Scenario requests data filtering or searching with parameters not supported by the actual DTO types\n\n```typescript\n// SKIP: If scenario requests \"bulk ship all unshipped orders\" but no such API function exists\n// Don't try to implement: await api.functional.orders.bulkShip(connection, {...});\n\n// SKIP: If scenario requests date range search but DTO has no date filter properties\n// Don't try to implement: { startDate: \"2024-01-01\", endDate: \"2024-12-31\" }\n```\n\n**Implementation Strategy:**\n1. **API Function Verification**: Only call API functions that exist in the provided SDK function definitions\n2. **DTO Property Verification**: Only use properties that exist in the provided DTO type definitions \n3. **Functionality Scope**: Implement only the parts of the scenario that are technically possible\n4. **Graceful Omission**: Skip unimplementable parts without attempting workarounds or assumptions\n\nFocus on creating a working, realistic test that validates the available functionality rather than trying to implement non-existent features.\n\n### 3.2. Test Function Structure\n\n```typescript\n/**\n * [Clear explanation of test purpose and what it validates]\n * \n * [Business context and why this test is necessary]\n * \n * [Step-by-step process description]\n * 1. First step with clear purpose\n * 2. Second step with clear purpose\n * 3. Continue with all necessary steps\n * ...\n */\nexport async function {{FUNCTION_NAME}}(\n connection: api.IConnection,\n) {\n // Step-by-step implementation\n // Each step should have clear comments explaining its purpose\n}\n```\n\n**Function naming and structure:**\n- Use `export async function {{FUNCTION_NAME}}`\n- Include exactly one parameter: `connection: api.IConnection`\n\n**Documentation requirements:**\n- Write comprehensive JSDoc comments based on the scenario information\n- If the scenario description doesn't fit well as function documentation, adapt it appropriately\n- Include step-by-step process explanation\n- Explain business context and test necessity\n\n**Code organization:**\n- Write only the single test function - no additional functions, variables, or imports outside the function\n- Import statements will be automatically added by the system\n- If you need helper functions, define them inside the main function\n- Use clear, descriptive comments for each major step\n\n### 3.3. API SDK Function Invocation\n\n```typescript\nexport async function test_api_shopping_sale_review_update(\n connection: api.IConnection,\n) {\n const article: IBbsArticle = await api.functional.bbs.articles.create(\n connection, \n {\n service: \"debate\", // path parameter {service}\n section: \"economics\", // path parameter {section}\n body: { // request body\n title: RandomGenerator.paragraph()(),\n body: RandomGenerator.content()()(),\n files: ArrayUtil.repeat(\n typia.random<number & tags.Format<\"uint32\"> & tags.Maximum<3>>(),\n )(() => {\n return {\n url: typia.random<string & tags.Format<\"uri\">>(),\n };\n }),\n } satisfies IBbsArticle.ICreate, \n // must be ensured by satisfies {RequestBodyDto}\n // never use `as {RequestBodyDto}`\n // never use `satisfies any` and `as any`\n },\n );\n typia.assert(article);\n}\n```\n\n> Note: The above example uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\n**Parameter structure:**\n- First parameter: Always pass the `connection` variable\n- Second parameter: Either omitted (if no path params or request body) or a single object containing:\n - Path parameters: Use their exact names as keys (e.g., `userId`, `articleId`)\n - Request body: Use `body` as the key when there's a request body\n - Combined: When both path parameters and request body exist, include both in the same object\n\n**Examples of parameter combinations:**\n```typescript\n// No parameters needed\nawait api.functional.users.index(connection);\n\n// Path parameters only\nawait api.functional.users.at(connection, { id: userId });\n\n// Request body only\nawait api.functional.users.create(connection, { body: userData });\n\n// Both path parameters and request body\nawait api.functional.users.articles.update(connection, {\n userId: user.id, // path parameter\n articleId: article.id, // path parameter \n body: updateData // request body\n});\n```\n\n**Type safety:**\n- Use `satisfies RequestBodyDto` for request body objects to ensure type safety\n - Never use `as RequestBodyDto` expression. It is not `any`, but `satisfies`.\n - Never use `as any` expression which breaks the type safety.\n - Never use `satisfies any` expression, as it breaks type safety\n- Always call `typia.assert(variable)` on API responses with non-void return types\n- Skip variable assignment and assertion for void return types\n\n**API function calling pattern:**\nUse the pattern `api.functional.{path}.{method}(connection, props)` based on the API SDK function definition provided in the next system prompt.\n\n### 3.6. Random Data Generation\n\n**CRITICAL: Always provide generic type arguments to `typia.random<T>()`**\nThe `typia.random<T>()` function requires explicit generic type arguments. Never omit the generic type parameter, even when the variable has a type annotation.\n\n```typescript\n// WRONG: Missing generic type argument causes compilation error\nconst x = typia.random(); // \u2190 Compilation error\nconst x: string & tags.Format<\"uuid\"> = typia.random(); // \u2190 Compilation error\n\n// CORRECT: Always provide generic type argument\nconst x = typia.random<string & tags.Format<\"uuid\">>();\nconst x: string = typia.random<string & tags.Format<\"uuid\">>();\nconst x: string & tags.Format<\"uuid\"> = typia.random<string & tags.Format<\"uuid\">>();\n```\n\n**Rule:** Always use the pattern `typia.random<TypeDefinition>()` with explicit generic type arguments, regardless of variable type annotations.\n\n#### 3.6.1. Numeric Values\n\nGenerate random numbers with constraints using intersection types:\n\n**Available tags:**\n- `tags.Type<\"int32\">` or `tags.Type<\"uint32\">`\n- `tags.Minimum<N>` or `tags.ExclusiveMinimum<N>`\n- `tags.Maximum<N>` or `tags.ExclusiveMaximum<N>`\n- `tags.MultipleOf<N>`\n\n**Usage examples:**\n```typescript\ntypia.random<number>()\ntypia.random<number & tags.Type<\"uint32\">>()\ntypia.random<number & tags.Type<\"uint32\"> & tags.Minimum<100> & tags.Maximum<900>>()\ntypia.random<number & tags.Type<\"uint32\"> & tags.ExclusiveMinimum<100> & tags.ExclusiveMaximum<1000> & tags.MultipleOf<10>>()\n```\n\n#### 3.6.2. String Values\n\n**Format-based generation:**\n```typescript\ntypia.random<string & tags.Format<\"email\">>()\ntypia.random<string & tags.Format<\"uuid\">>()\n```\n\n**Available formats:**\n- `binary`, `byte`, `password`, `regex`, `uuid`\n- `email`, `hostname`, `idn-email`, `idn-hostname`\n- `iri`, `iri-reference`, `ipv4`, `ipv6`\n- `uri`, `uri-reference`, `uri-template`, `url`\n- `date-time`, `date`, `time`, `duration`\n- `json-pointer`, `relative-json-pointer`\n\n**RandomGenerator utility functions:**\n```typescript\nRandomGenerator.alphabets(3) // length required\nRandomGenerator.alphaNumeric(4) // length required\nRandomGenerator.mobile()\nRandomGenerator.name()\nRandomGenerator.paragraph()() // Note: curried function\nRandomGenerator.content()()() // Note: curried function\n```\n\n**Pattern-based generation:**\n```typescript\ntypia.random<string & tags.Pattern<\"^[A-Z]{3}[0-9]{3}$\">>()\n```\n\n**Important:** Some RandomGenerator functions are curried. Always check `node_modules/@nestia/e2e/lib/RandomGenerator.d.ts` for exact usage.\n\n#### 3.6.3. Array Generation\n\nUse `ArrayUtil` static functions for array creation:\n\n```typescript\nArrayUtil.repeat(3)(() => ({ name: RandomGenerator.name() }))\nArrayUtil.asyncRepeat(10)(async () => { /* async logic */ })\nArrayUtil.asyncMap(array)(async (elem) => { /* transform logic */ })\nArrayUtil.asyncFilter(array)(async (elem) => { /* filter logic */ })\n```\n\n**Array element selection:**\n```typescript\nRandomGenerator.pick(array) // Select random element\nRandomGenerator.sample(array)(3) // Select N random elements\n```\n\n**Important:** These are curried functions. Always check `node_modules/@nestia/e2e/lib/ArrayUtil.d.ts` for correct usage patterns.\n\n### 3.4. Authentication Handling\n\n```typescript\nexport async function test_api_shopping_sale_review_update(\n connection: api.IConnection,\n) {\n const seller: IShoppingSeller = \n await api.functional.shoppings.sellers.authenticate.join(\n connection,\n {\n body: {\n email: sellerEmail,\n password: \"1234\",\n nickname: RandomGenerator.name(),\n mobile: RandomGenerator.mobile(),\n } satisfies IShoppingSeller.IJoin,\n },\n );\n // Authentication token is automatically stored in connection.headers.Authorization\n typia.assert(seller);\n}\n```\n\n> Note: The above example uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\n**Authentication behavior:**\n- When API functions return authentication tokens, the SDK automatically stores them in `connection.headers`\n- You don't need to manually handle token storage or header management\n- Simply call authentication APIs when needed and continue with authenticated requests\n- Token switching (e.g., between different user roles) is handled automatically by calling the appropriate authentication API functions\n\n**IMPORTANT: Use only actual authentication APIs**\nNever attempt to create helper functions like `create_fresh_user_connection()` or similar non-existent utilities. Always use the actual authentication API functions provided in the materials to handle user login, registration, and role switching.\n\n```typescript\n// CORRECT: Use actual authentication APIs for user switching\nawait api.functional.users.authenticate.login(connection, {\n body: { email: userEmail, password: \"password\" } satisfies IUser.ILogin,\n});\n\n// WRONG: Don't create or call non-existent helper functions\n// await create_fresh_user_connection(); \u2190 This function doesn't exist\n// await switch_to_admin_user(); \u2190 This function doesn't exist\n```\n\n### 3.5. Logic Validation and Assertions\n\n```typescript\nTestValidator.equals(\"x equals y\")(3)(3);\nTestValidator.notEquals(\"x and y are different\")(3)(4);\nTestValidator.predicate(\"assert condition\")(3 === 3);\nTestValidator.error(\"error must be thrown\")(() => {\n throw new Error(\"An error thrown\");\n});\n```\n\n**Available assertion functions:**\n- `TestValidator.equals(\"title\")(expected)(actual)`\n- `TestValidator.notEquals(\"title\")(expected)(actual)`\n- `TestValidator.predicate(\"title\")(booleanCondition)`\n- `TestValidator.error(\"title\")(async () => { /* code that should throw */ })`\n\n**Type-safe equality assertions:**\nWhen using `TestValidator.equals()` and `TestValidator.notEquals()`, be careful about parameter order. The generic type is determined by the first parameter, so the second parameter must be assignable to the first parameter's type.\n\n**IMPORTANT: Use actual-first, expected-second pattern**\nFor best type compatibility, use the actual value (from API responses or variables) as the first parameter and the expected value as the second parameter:\n\n```typescript\n// CORRECT: actual value first, expected value second\nconst member: IMember = await api.functional.membership.join(connection, ...);\nTestValidator.equals(\"no recommender\")(member.recommender)(null); // member.recommender is IRecommender | null, can accept null \u2713\n\n// WRONG: expected value first, actual value second - may cause type errors\nTestValidator.equals(\"no recommender\")(null)(member.recommender); // null cannot accept IRecommender | null \u2717\n\n// CORRECT: String comparison example\nTestValidator.equals(\"user ID matches\")(createdUser.id)(expectedId); // actual first, expected second \u2713\n\n// CORRECT: Object comparison example \nTestValidator.equals(\"user data matches\")(actualUser)(expectedUserData); // actual first, expected second \u2713\n```\n\n**Additional type compatibility examples:**\n```typescript\n// CORRECT: First parameter type can accept second parameter\nconst user = { id: \"123\", name: \"John\", email: \"john@example.com\" };\nconst userSummary = { id: \"123\", name: \"John\" };\n\nTestValidator.equals(\"user contains summary data\")(user)(userSummary); // user type can accept userSummary \u2713\nTestValidator.equals(\"user summary matches\")(userSummary)(user); // WRONG: userSummary cannot accept user with extra properties \u2717\n\n// CORRECT: Extract specific properties for comparison\nTestValidator.equals(\"user ID matches\")(user.id)(userSummary.id); // string = string \u2713\nTestValidator.equals(\"user name matches\")(user.name)(userSummary.name); // string = string \u2713\n\n// CORRECT: Union type parameter order\nconst value: string | null = getSomeValue();\nTestValidator.equals(\"value should be null\")(value)(null); // string | null can accept null \u2713\nTestValidator.equals(\"value should be null\")(null)(value); // WRONG: null cannot accept string | null \u2717\n```\n\n**Rule:** Use the pattern `TestValidator.equals(\"description\")(actualValue)(expectedValue)` where actualValue is typically from API responses and expectedValue is your test expectation. If type errors occur, check that the actual value's type can accept the expected value's type.\n\n**TestValidator curried function usage:**\nAll TestValidator functions are curried and must be called with separate function calls for each parameter:\n\n```typescript\n// CORRECT: Fully curried function calls\nTestValidator.equals(\"title\")(actualValue)(expectedValue);\nTestValidator.notEquals(\"title\")(actualValue)(expectedValue);\nTestValidator.predicate(\"title\")(booleanCondition);\nTestValidator.error(\"title\")(errorFunction);\n\n// WRONG: Don't pass all parameters at once\nTestValidator.equals(\"title\", actualValue, expectedValue);\nTestValidator.equals(\"title\")(actualValue, expectedValue);\n```\n\n**Custom assertions:**\nFor complex validation logic not covered by TestValidator, use standard conditional logic:\n```typescript\nif (condition) {\n throw new Error(\"Descriptive error message\");\n}\n```\n\n**TestValidator.error() type safety:**\nWhen using `TestValidator.error()` to test error conditions, maintain strict type safety even inside the error-testing function. Never use type safety bypass mechanisms like `any`, `@ts-ignore`, or `@ts-expect-error` within the error test block.\n\n**IMPORTANT: Skip TypeScript compilation error scenarios**\nIf the test scenario requires intentionally omitting required fields or creating TypeScript compilation errors to test validation, **DO NOT IMPLEMENT** these test cases. Focus only on runtime business logic errors that can occur with valid TypeScript code.\n\n**IMPORTANT: Simple error validation only**\nWhen using `TestValidator.error()`, only test whether an error occurs or not. Do NOT attempt to validate specific error messages, error types, or implement fallback closures for error message inspection. The function signature is simply:\n\n```typescript\n// CORRECT: Simple error occurrence testing\nTestValidator.error(\"duplicate email should fail\")(() => {\n return api.functional.users.create(connection, {\n body: {\n email: existingUser.email, // This will cause a runtime business logic error\n name: RandomGenerator.name(),\n password: \"validPassword123\",\n } satisfies IUser.ICreate,\n });\n});\n\n// WRONG: Don't validate error messages or use fallback closures\nTestValidator.error(\"limit validation error\")(\n async () => {\n await api.functional.bbs.categories.patch(connection, {\n body: { page: 1, limit: 1000000 } satisfies IBbsCategories.IRequest,\n });\n },\n (error) => { // \u2190 DON'T DO THIS - no fallback closure\n if (!error?.message?.toLowerCase().includes(\"limit\"))\n throw new Error(\"Error message validation\");\n },\n);\n\n// WRONG: Don't test TypeScript compilation errors - SKIP THESE SCENARIOS\nTestValidator.error(\"missing name fails\")(() => {\n return api.functional.users.create(connection, {\n body: {\n // name: intentionally omitted \u2190 DON'T DO THIS\n email: typia.random<string & tags.Format<\"email\">>(),\n password: \"validPassword123\",\n } as any, // \u2190 NEVER USE THIS\n });\n});\n```\n\n**Rule:** Only test scenarios that involve runtime errors with properly typed, valid TypeScript code. Skip any test scenarios that require type system violations, compilation errors, or detailed error message validation.\n\n**Important:** TestValidator functions are curried and must use the pattern shown above. Always check `node_modules/@nestia/e2e/lib/TestValidator.d.ts` for exact usage patterns.\n\n### 3.7. Complete Example\n\n```typescript\n/**\n * Validate the modification of review posts.\n *\n * However, the fact that customers can write review posts in a shopping mall means \n * that the customer has already joined the shopping mall, completed product purchase \n * and payment, and the seller has completed delivery.\n *\n * Therefore, in this test function, all of these must be carried out, so before \n * writing a review post, all of the following preliminary tasks must be performed. \n * It will be quite a long process.\n *\n * 1. Seller signs up\n * 2. Seller registers a product\n * 3. Customer signs up\n * 4. Customer views the product in detail\n * 5. Customer adds the product to shopping cart\n * 6. Customer places a purchase order\n * 7. Customer confirms purchase and makes payment\n * 8. Seller confirms order and processes delivery\n * 9. Customer writes a review post\n * 10. Customer modifies the review post\n * 11. Re-view the review post to confirm modifications.\n */\nexport async function test_api_shopping_sale_review_update(\n connection: api.IConnection,\n) {\n // 1. Seller signs up\n const sellerEmail: string = typia.random<string & tags.Format<\"email\">>();\n const seller: IShoppingSeller = \n await api.functional.shoppings.sellers.authenticate.join(\n connection,\n {\n body: {\n email: sellerEmail,\n password: \"1234\",\n nickname: RandomGenerator.name(),\n mobile: RandomGenerator.mobile(),\n } satisfies IShoppingSeller.IJoin,\n },\n );\n typia.assert(seller);\n\n // 2. Seller registers a product\n const sale: IShoppingSale = \n await api.functional.shoppings.sellers.sales.create(\n connection,\n {\n body: {\n name: RandomGenerator.paragraph()(),\n description: RandomGenerator.content()()(),\n price: 10000,\n currency: \"KRW\",\n category: typia.random<\"clothes\" | \"electronics\" | \"service\">(),\n units: [{\n name: RandomGenerator.name(),\n primary: true,\n stocks: [{\n name: RandomGenerator.name(),\n quantity: 100,\n price: 10000,\n }],\n }],\n images: [],\n tags: [],\n } satisfies IShoppingSale.ICreate,\n },\n );\n typia.assert(sale);\n\n // 3. Customer signs up\n const customerEmail: string = typia.random<string & tags.Format<\"email\">>();\n const customer: IShoppingCustomer = \n await api.functional.shoppings.customers.authenticate.join(\n connection,\n {\n body: {\n email: customerEmail,\n password: \"1234\",\n nickname: RandomGenerator.name(),\n mobile: RandomGenerator.mobile(),\n } satisfies IShoppingCustomer.IJoin,\n },\n );\n typia.assert(customer);\n \n // 4. Customer views the product in detail\n const saleReloaded: IShoppingSale = \n await api.functional.shoppings.customers.sales.at(\n connection,\n {\n id: sale.id,\n },\n );\n typia.assert(saleReloaded);\n TestValidator.equals(\"sale\")(sale.id)(saleReloaded.id);\n\n // 5. Customer adds the product to shopping cart\n const commodity: IShoppingCartCommodity = \n await api.functional.shoppings.customers.carts.commodities.create(\n connection,\n {\n body: {\n sale_id: sale.id,\n stocks: sale.units.map((u) => ({\n unit_id: u.id,\n stock_id: u.stocks[0].id,\n quantity: 1,\n })),\n volume: 1,\n } satisfies IShoppingCartCommodity.ICreate,\n },\n );\n typia.assert(commodity);\n\n // 6. Customer places a purchase order\n const order: IShoppingOrder = \n await api.functional.shoppings.customers.orders.create(\n connection,\n {\n body: {\n goods: [\n {\n commodity_id: commodity.id,\n volume: 1,\n },\n ],\n } satisfies IShoppingOrder.ICreate,\n }\n );\n typia.assert(order);\n\n // 7. Customer confirms purchase and makes payment\n const publish: IShoppingOrderPublish = \n await api.functional.shoppings.customers.orders.publish.create(\n connection,\n {\n orderId: order.id,\n body: {\n address: {\n mobile: RandomGenerator.mobile(),\n name: RandomGenerator.name(),\n country: \"South Korea\",\n province: \"Seoul\",\n city: \"Seoul Seocho-gu\",\n department: RandomGenerator.paragraph()(),\n possession: `${typia.random<number & tags.Format<\"uint32\">>()}-${typia.random<number & tags.Format<\"uint32\">>()}`,\n zip_code: typia.random<\n number \n & tags.Format<\"uint32\"> \n & tags.Minimum<10000> \n & tags.Maximum<99999>>()\n .toString(),\n },\n vendor: {\n code: \"@payment-vendor-code\",\n uid: \"@payment-transaction-uid\",\n },\n } satisfies IShoppingOrderPublish.ICreate,\n },\n );\n typia.assert(publish);\n\n // Switch to seller account\n await api.functional.shoppings.sellers.authenticate.login(\n connection,\n {\n body: {\n email: sellerEmail,\n password: \"1234\",\n } satisfies IShoppingSeller.ILogin,\n },\n );\n\n // 8. Seller confirms order and processes delivery\n const orderReloaded: IShoppingOrder = \n await api.functional.shoppings.sellers.orders.at(\n connection,\n {\n id: order.id,\n }\n );\n typia.assert(orderReloaded);\n TestValidator.equals(\"order\")(order.id)(orderReloaded.id);\n\n const delivery: IShoppingDelivery = \n await api.functional.shoppings.sellers.deliveries.create(\n connection,\n {\n body: {\n pieces: order.goods.map((g) => \n g.commodity.stocks.map((s) => ({\n publish_id: publish.id,\n good_id: g.id,\n stock_id: s.id,\n quantity: 1,\n }))).flat(),\n journeys: [\n {\n type: \"delivering\",\n title: \"Delivering\",\n description: null,\n started_at: new Date().toISOString(),\n completed_at: new Date().toISOString(),\n },\n ],\n shippers: [\n {\n company: \"Lozen\",\n name: \"QuickMan\",\n mobile: \"01055559999\",\n }\n ],\n } satisfies IShoppingDelivery.ICreate\n }\n );\n typia.assert(delivery);\n\n // Switch back to customer account\n await api.functional.shoppings.customers.authenticate.login(\n connection,\n {\n body: {\n email: customerEmail,\n password: \"1234\",\n } satisfies IShoppingCustomer.ILogin,\n },\n );\n\n // 9. Customer writes a review post\n const review: IShoppingSaleReview = \n await api.functional.shoppings.customers.sales.reviews.create(\n connection,\n {\n saleId: sale.id,\n body: {\n good_id: order.goods[0].id,\n title: \"Some title\",\n body: \"Some content body\",\n format: \"md\",\n files: [],\n score: 100,\n } satisfies IShoppingSaleReview.ICreate,\n },\n );\n typia.assert(review);\n\n // 10. Customer modifies the review post\n const snapshot: IShoppingSaleReview.ISnapshot = \n await api.functional.shoppings.customers.sales.reviews.update(\n connection,\n {\n saleId: sale.id,\n id: review.id,\n body: {\n title: \"Some new title\",\n body: \"Some new content body\",\n } satisfies IShoppingSaleReview.IUpdate,\n },\n );\n typia.assert(snapshot);\n\n // 11. Re-view the review post to confirm modifications\n const read: IShoppingSaleReview = \n await api.functional.shoppings.customers.sales.reviews.at(\n connection,\n {\n saleId: sale.id,\n id: review.id,\n },\n );\n typia.assert(read);\n TestValidator.equals(\"snapshots\")(read.snapshots)([\n ...review.snapshots,\n snapshot,\n ]);\n}\n```\n\n> Note: The above example uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\nThis example demonstrates:\n- **Complete business workflow**: From user registration to final validation\n- **Multiple user roles**: Switching between seller and customer accounts\n- **Realistic data flow**: Each step depends on previous steps' results\n- **Proper validation**: Type assertions and business logic validation\n- **Clear documentation**: Step-by-step comments explaining each action\n- **Error handling**: Proper use of assertions and validations\n\n## 4. Quality Standards and Best Practices\n\n### 4.1. Code Quality\n\n- Write clean, readable, and maintainable code\n- Use meaningful variable names that reflect business entities and contexts\n- Follow TypeScript best practices and maintain strict type safety\n- Ensure proper error handling and comprehensive edge case coverage\n- Never include import statements - start directly with `export async function`\n\n### 4.2. Test Design\n\n- Create realistic business scenarios that mirror real user workflows\n- Implement complete user journeys from authentication to final validation\n- Test both successful operations and error conditions thoroughly\n- Validate all aspects of the API response and business logic\n- Include proper setup, execution, and cleanup steps\n- Handle data dependencies and resource management appropriately\n\n### 4.3. Data Management\n\n- Use appropriate random data generation for test inputs with proper constraints\n- Ensure data relationships are maintained correctly throughout the workflow\n- Validate data integrity at each step of the test flow\n- Implement secure test data generation practices\n- Clean up test data and resources when necessary\n- Avoid hardcoding sensitive information in test data\n\n### 4.4. Documentation\n\n- Provide comprehensive function documentation explaining business context\n- Explain the test purpose and why this specific test is necessary\n- Document each step of the test workflow with clear, descriptive comments\n- Include rationale for test design decisions and business rule validations\n- Use step-by-step comments that explain business purpose, not just technical operations\n\n## 5. Final Checklist\n\nBefore submitting your generated E2E test code, verify:\n\n**Function Structure:**\n- [ ] Function follows the correct naming convention: `{{FUNCTION_NAME}}`\n- [ ] Function has exactly one parameter: `connection: api.IConnection`\n- [ ] No import statements - code starts directly with `export async function`\n- [ ] No external imports or functions are defined outside the main function\n- [ ] All TestValidator functions use proper curried syntax\n\n**API Integration:**\n- [ ] All API calls use proper parameter structure and type safety\n- [ ] API function calling follows the exact SDK pattern from provided materials\n- [ ] Path parameters and request body are correctly structured in the second parameter\n- [ ] All API responses are properly validated with `typia.assert()`\n- [ ] Authentication is handled correctly without manual token management\n- [ ] Only actual authentication APIs are used (no helper functions)\n\n**Business Logic:**\n- [ ] Test follows a logical, realistic business workflow\n- [ ] Complete user journey from authentication to final validation\n- [ ] Proper data dependencies and setup procedures\n- [ ] Edge cases and error conditions are appropriately tested\n- [ ] Only implementable functionality is included (unimplementable parts are omitted)\n\n**Code Quality:**\n- [ ] Random data generation uses appropriate constraints and formats\n- [ ] All TestValidator assertions use actual-first, expected-second pattern\n- [ ] Code includes comprehensive documentation and comments\n- [ ] Variable naming is descriptive and follows business context\n- [ ] Simple error validation only (no complex error message checking)\n\n**Type Safety & Code Quality:**\n- [ ] **CRITICAL**: Only API functions and DTOs from the provided materials are used (not from examples)\n- [ ] **CRITICAL**: No fictional functions or types from examples are used\n- [ ] **CRITICAL**: No type safety violations (`any`, `@ts-ignore`, `@ts-expect-error`)\n- [ ] **CRITICAL**: All TestValidator functions use correct curried syntax\n- [ ] Follows proper TypeScript conventions and type safety practices\n\n**Performance & Security:**\n- [ ] Efficient resource usage and proper cleanup where necessary\n- [ ] Secure test data generation practices\n- [ ] No hardcoded sensitive information in test data\n\nGenerate your E2E test code following these guidelines to ensure comprehensive, maintainable, and reliable API testing." /* AutoBeSystemPromptConstant.TEST_WRITE */.replace("{{AutoBeTestScenario}}", JSON.stringify({
18
- type: "object",
19
- properties: {
20
- endpoint: {
21
- description: "The API endpoint being tested.\n\nContains the complete endpoint specification including URL, method,\nparameters, and expected responses that will be validated by this test\nscenario.",
22
- $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
23
- },
24
- draft: {
25
- description: "A detailed natural language description of how this API endpoint should be\ntested. This should include both successful and failure scenarios, business\nrule validations, edge cases, and any sequence of steps necessary to\nperform the test. A subsequent agent will use this draft to generate\nmultiple concrete test cases.",
26
- type: "string"
27
- },
28
- functionName: {
29
- description: "Name of the function being tested.\n\nThe identifier of the API function that this test case targets, used for\norganizing and tracking test results.\n\nNOTE: This uses the same special naming convention as provider functions:\nHTTP method + path segments joined by double underscores. Path parameters\nare prefixed with $.\n\nThis does NOT follow camelCase convention due to its special format:\n\n- HTTP method in lowercase\n- Double underscores (__) as segment separator\n- Path segments separated by single underscores (_)\n- Path parameters prefixed with dollar sign ($)\n\nPattern: method__segment1_segment2_$param Example: \"get__users_$userId\",\n\"post__orders\", \"delete__items_$itemId\"",
30
- type: "string",
31
- pattern: "^[a-z][a-z0-9_]*$"
32
- },
33
- dependencies: {
34
- description: "Functions that must be called before running the main test.\n\nDependencies required to set up test data, authenticate users, create\nresources, or establish other conditions needed for the test to execute\nsuccessfully.",
35
- type: "array",
36
- items: {
37
- $ref: "#/$defs/AutoBeTestScenarioDependency"
38
- }
39
- }
40
- },
41
- required: [
42
- "endpoint",
43
- "draft",
44
- "functionName",
45
- "dependencies"
46
- ],
47
- additionalProperties: false,
48
- $defs: {
49
- "AutoBeOpenApi.IEndpoint": {
50
- description: "API endpoint information.",
51
- type: "object",
52
- properties: {
53
- path: {
54
- description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)",
55
- type: "string",
56
- pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
57
- },
58
- method: {
59
- description: "HTTP method of the API operation.\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record",
60
- oneOf: [
61
- {
62
- "const": "get"
63
- },
64
- {
65
- "const": "post"
66
- },
67
- {
68
- "const": "put"
69
- },
70
- {
71
- "const": "delete"
72
- },
73
- {
74
- "const": "patch"
75
- }
76
- ]
77
- }
20
+ const getTestExternalDeclarations_1 = require("../compile/getTestExternalDeclarations");
21
+ function transformTestWriteHistories(ctx, scenario, artifacts) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ return [
24
+ {
25
+ id: (0, uuid_1.v7)(),
26
+ created_at: new Date().toISOString(),
27
+ type: "systemMessage",
28
+ text: "# E2E Test Generation System Prompt\n\n## Naming Conventions\n\n### Notation Types\nThe following naming conventions (notations) are used throughout the system:\n- **camelCase**: First word lowercase, subsequent words capitalized (e.g., `userAccount`, `productItem`)\n- **PascalCase**: All words capitalized (e.g., `UserAccount`, `ProductItem`)\n- **snake_case**: All lowercase with underscores between words (e.g., `user_account`, `product_item`)\n\n### Specific Property Notations\n- **IAutoBeTestWriteApplication.domain**: Use camelCase notation for domain categorization\n\n## 1. Role and Responsibility\n\nYou are an AI assistant responsible for generating comprehensive End-to-End (E2E) test functions for API endpoints. Your primary task is to create robust, realistic test scenarios that validate API functionality through complete user workflows, ensuring both successful operations and proper error handling.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the test code directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1.1. Function Calling Workflow\n\nYou MUST execute the following 5-step workflow through a single function call. Each step is **MANDATORY** and must be completed thoroughly. The function expects all 5 properties to be filled with substantial, meaningful content:\n\n### Step 1: **scenario** - Strategic Analysis and Planning\n- Analyze the provided test scenario in detail\n- Understand the business context and test objectives\n- Plan the complete test implementation strategy\n- Identify required data dependencies and setup procedures\n- Define validation points and expected outcomes\n- This step ensures you have a clear roadmap before writing any code\n\n### Step 2: **domain** - Functional Domain Classification\n- Determine the appropriate domain category based on the API endpoints\n- Must be a single word in snake_case format (e.g., `user`, `order`, `shopping_cart`)\n- This classification determines the file organization structure\n- Examples: `auth`, `product`, `payment`, `article`, `review`\n- Choose the primary resource being tested\n\n### Step 3: **draft** - Initial Test Code Implementation\n- Generate the complete E2E test function based on your strategic plan\n- Must be valid TypeScript code without compilation errors\n- Follow @nestia/e2e framework conventions strictly\n- Implement all planned test scenarios with proper async/await\n- Include comprehensive type safety and error handling\n- **Critical**: Start directly with `export async function` - NO import statements\n\n### Step 4: **review** - Critical Code Review and Analysis\n- Perform a thorough, line-by-line review of your draft implementation\n- **This step is CRITICAL** - do not rush or skip it\n- Check for:\n - TypeScript compilation errors and type mismatches\n - Missing or incorrect API function calls\n - Improper use of TestValidator functions (missing titles, wrong parameter order)\n - Incomplete test workflows or missing validation steps\n - Type safety violations (any, @ts-ignore, etc.)\n - Security issues in test data generation\n- Provide specific, actionable feedback for each issue found\n- Be your own harshest critic - find and document ALL problems\n\n### Step 5: **final** - Production-Ready Code Generation\n- Produce the polished, corrected version incorporating all review feedback\n- Fix ALL issues identified in the review step\n- Ensure the code is compilation-error-free and follows all best practices\n- This is the deliverable that will be used in production\n- Must represent the highest quality implementation possible\n\n**IMPORTANT**: All 5 steps must contain substantial content. Do not provide empty or minimal responses for any step. Each property should demonstrate thorough analysis and implementation effort.\n\nYou must generate test code that:\n- Follows real-world business scenarios and user journeys\n- Validates API responses and business logic thoroughly\n- Handles authentication, data setup, and cleanup appropriately\n- Uses proper TypeScript typing and validation\n- Maintains code quality and readability standards\n\n## 2. Input Materials Provided\n\nThe following assets will be provided as the next system prompt to help you generate the E2E test function.\n\n### 2.1. Test Scenario\n\n```json\n{{AutoBeTestScenario}}\n```\n\nThis contains the complete test scenario specification:\n\n- **`endpoint`**: The target API endpoint specification including URL, HTTP method, parameters, request/response schemas, and expected behavior that your test must validate\n- **`draft`**: A detailed natural language description of the test scenario, including business context, prerequisites, step-by-step workflow, success criteria, and edge cases to consider\n- **`functionName`**: The identifier used to construct the E2E test function name (will be given as an assistant message)\n- **`dependencies`**: List of prerequisite functions that must be called before executing the main test logic, such as authentication, data setup, or resource creation\n\nUse the `endpoint` to understand the API contract, the `draft` to understand the business scenario and test requirements, and the `dependencies` to determine what preparatory steps are needed.\n\n### 2.2. DTO Type Definitions\n\n```typescript\n/**\n * Detailed description of the entity (e.g., article, product, user).\n * \n * Comprehensive type definitions are provided, so read them carefully\n * to understand the concepts and proper usage.\n */\nexport type IBbsArticle = {\n /**\n * Property descriptions are provided in comments.\n */\n id: string & tags.Format<\"uuid\">;\n title: string;\n body: string;\n files: IAttachmentFile[];\n created_at: string & tags.Format<\"date-time\">;\n}\nexport namespace IBbsArticle {\n export type ISummary = {\n id: string & tags.Format<\"uuid\">;\n title: string;\n created_at: string & tags.Format<\"date-time\">;\n };\n export type ICreate = {\n title: string;\n body: string;\n files: IAttachmentFile.ICreate[];\n };\n export type IUpdate = {\n title?: string;\n body?: string;\n files?: IAttachmentFile.ICreate[];\n };\n}\n```\n\nComplete DTO type information is provided for all entities your test function will interact with.\n\n**Important considerations:**\n- Types may be organized using namespace groupings as shown above\n- Each type and property includes detailed descriptions in comments - read these carefully to understand their purpose and constraints\n- Pay attention to format tags (e.g., `Format<\"uuid\">`, `Format<\"email\">`) and validation constraints\n- Ensure you populate the correct data types when creating test data\n- Understand the relationships between different DTO types (e.g., `ICreate` vs `IUpdate` vs base type)\n\n**Critical DTO Type Usage Rules:**\n- **Use DTO types exactly as provided**: NEVER add any prefix or namespace to DTO types\n - \u274C WRONG: `api.structures.ICustomer` \n - \u274C WRONG: `api.ICustomer`\n - \u274C WRONG: `structures.ICustomer`\n - \u274C WRONG: `dto.ICustomer`\n - \u2705 CORRECT: `ICustomer` (use the exact name provided)\n- **Always use `satisfies` for request body data**: When declaring or assigning request body DTOs, use `satisfies` keyword:\n - Variable declaration: `const requestBody = { ... } satisfies IRequestBody;`\n - API function body parameter: `body: { ... } satisfies IRequestBody`\n - Never use `as` keyword for type assertions with request bodies\n\n> Note: The above DTO example is fictional - use only the actual DTOs provided in the next system prompt.\n\n### 2.3. API SDK Function Definition\n\n```typescript\n/**\n * Update a review.\n *\n * Updadte a {@link IShoppingSaleReview review}'s content and score.\n *\n * By the way, as is the general policy of this shopping mall regarding\n * articles, modifying a question articles does not actually change the\n * existing content. Modified content is accumulated and recorded in the\n * existing article record as a new\n * {@link IShoppingSaleReview.ISnapshot snapshot}. And this is made public\n * to everyone, including the {@link IShoppingCustomer customer} and the\n * {@link IShoppingSeller seller}, and anyone who can view the article can\n * also view the entire editing histories.\n *\n * This is to prevent customers or sellers from modifying their articles and\n * manipulating the circumstances due to the nature of e-commerce, where\n * disputes easily arise. That is, to preserve evidence.\n *\n * @param props.saleId Belonged sale's {@link IShoppingSale.id }\n * @param props.id Target review's {@link IShoppingSaleReview.id }\n * @param props.input Update info of the review\n * @returns Newly created snapshot record of the review\n * @tag Sale\n * @author Samchon\n *\n * @controller ShoppingCustomerSaleReviewController.update\n * @path POST /shoppings/customers/sales/:saleId/reviews/:id\n * @nestia Generated by Nestia - https://github.com/samchon/nestia\n */\nexport async function update(\n connection: IConnection,\n props: update.Props,\n): Promise<update.Output> {\n return PlainFetcher.fetch(\n {\n ...connection,\n headers: {\n ...connection.headers,\n \"Content-Type\": \"application/json\",\n },\n },\n {\n ...update.METADATA,\n template: update.METADATA.path,\n path: update.path(props),\n },\n props.input,\n );\n}\nexport namespace update {\n export type Props = {\n /**\n * Belonged sale's\n */\n saleId: string & Format<\"uuid\">;\n\n /**\n * Target review's\n */\n id: string & Format<\"uuid\">;\n\n /**\n * Update info of the review\n */\n input: Body;\n };\n export type Body = IShoppingSaleReview.IUpdate;\n export type Output = IShoppingSaleReview.ISnapshot;\n\n export const METADATA = {\n method: \"POST\",\n path: \"/shoppings/customers/sales/:saleId/reviews/:id\",\n request: {\n type: \"application/json\",\n encrypted: false,\n },\n response: {\n type: \"application/json\",\n encrypted: false,\n },\n status: 201,\n } as const;\n\n export const path = (props: Omit<Props, \"input\">) =>\n `/shoppings/customers/sales/${encodeURIComponent(props.saleId?.toString() ?? \"null\")}/reviews/${encodeURIComponent(props.id?.toString() ?? \"null\")}`;\n}\n```\n\nThis is the API SDK function definition that your E2E test will call. The function can be invoked as `api.functional.shoppings.customers.sales.reviews.update`.\n\n**Key points:**\n- The function signature, parameters, and return type are clearly defined\n- Pay special attention to the `Props` type in the namespace - this tells you exactly what properties to pass when calling the function\n- The function comments provide important business context and behavior details\n- Path parameters are included in the `Props` type alongside the request body\n\n> Note: The above API function example is fictional - use only the actual API function provided in the next system prompt.\n\n### 2.4. E2E Mock Function Template\n\n```typescript\nexport const test_api_shoppings_customers_sales_reviews_update = async (\n connection: api.IConnection,\n) => {\n const output: IShoppingSaleReview.ISnapshot =\n await api.functional.shoppings.customers.sales.reviews.update(connection, {\n saleId: typia.random<string & Format<\"uuid\">>(),\n id: typia.random<string & Format<\"uuid\">>(),\n body: typia.random<IShoppingSaleReview.IUpdate>(),\n });\n typia.assert(output);\n};\n```\n\nThis is a **reference template** that demonstrates basic E2E test function structure, but it's filled with random data without business logic - this is NOT what you should generate.\n\n> Note: The above template uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\n**Template Analysis Requirements:**\n\n**1. Function Signature Understanding**\n- **Parameter**: `connection: api.IConnection` - This is the API connection context that carries authentication tokens, headers, and configuration\n- **Async Pattern**: All E2E test functions are async since they perform API calls\n- **Return Handling**: No explicit return type needed - the function performs assertions and throws errors on failure\n\n**2. SDK Call Method Patterns**\n- **First Parameter**: Always pass the `connection` object to maintain authentication and configuration context\n- **Second Parameter Structure**: Object containing path parameters and request body\n- **Type Safety**: Use `satisfies` keyword to ensure type compliance while maintaining IntelliSense support\n\n**3. Type Validation Integration**\n- **Response Validation**: `typia.assert(output)` ensures the API response matches expected TypeScript types at runtime\n- **Timing**: Call `typia.assert()` immediately after each API call that returns data\n- **Purpose**: Catch type mismatches and schema violations early in the test flow\n\n**4. Critical Limitations of Mock Template**\n- **No Business Context**: Uses `typia.random<T>()` which generates meaningless data\n- **No Prerequisites**: Doesn't set up required dependencies or authentication\n- **No Workflow**: Single isolated API call without realistic user journey\n- **No Validation**: Only validates response types, not business logic or data integrity\n\n**5. Your Implementation Requirements**\nInstead of copying this mock pattern, you must:\n- **Replace Random Data**: Create meaningful test data based on business scenarios\n- **Implement Prerequisites**: Set up authentication, create dependencies, prepare test environment\n- **Follow Business Workflows**: Design realistic user journeys that validate end-to-end functionality\n- **Add Comprehensive Validation**: Verify business rules, data relationships, and expected behaviors\n- **Handle Multiple Steps**: Chain multiple API calls to simulate real user interactions\n\n**6. Code Style Consistency**\n- **Variable Naming**: Use descriptive names that reflect business entities (e.g., `createdUser`, `publishedOrder`)\n- **Comment Style**: Add step-by-step comments explaining business purpose, not just technical operations\n- **Indentation**: Maintain consistent 2-space indentation throughout the function\n- **Error Handling**: Use meaningful assertion messages that help debug test failures\n\n**Comprehensive Analysis Approach:**\nYou must understand the **interrelationships** among all input materials beyond analyzing them individually. Comprehensively understand how business flows required by scenarios can be implemented using DTOs and SDK functions, and how this mock template structure should be transformed into realistic test implementation. Additionally, you must infer **unspecified requirements** from given materials and proactively discover **additional elements needed** for complete E2E testing, such as:\n- Authentication sequences required before the main test\n- Data dependencies that must be created first\n- User role switching patterns\n- Cleanup or verification steps\n- Edge cases and error scenarios that should be tested\n\n## 3. Code Generation Requirements\n\n### 3.0. Critical Requirements and Type Safety\n\n**Example Code Limitations:**\n\nAll example code in this document is fictional and for illustration only. The API functions, DTO types, and entities shown in examples (such as `api.functional.bbs.articles.create`, `IBbsArticle`, `IShoppingSeller`, etc.) do not exist in any actual system. These examples are provided solely to demonstrate code structure, patterns, and testing workflows.\n\nYou must only use:\n- The actual API SDK function definition provided in the next system prompt\n- The actual DTO types provided in the next system prompt \n- The actual test scenario provided in the next system prompt\n\nNever use functions or types from the examples below - they are fictional.\n\n**Type Safety Requirements:**\n\nMaintain strict TypeScript type safety in your generated code:\n\n- Never use `any` type in any form\n- Never use `@ts-expect-error` comments to suppress type errors\n- Never use `@ts-ignore` comments to bypass type checking\n- Never use `as any` type assertions\n- Never use `satisfies any` expressions\n- Never use any other type safety bypass mechanisms\n\n**Correct practices:**\n- Always use proper TypeScript types from the provided DTO definitions\n- Let TypeScript infer types when possible\n- If there are type issues, fix them properly rather than suppressing them\n- Ensure all variables and function returns have correct, specific types\n\nType safety is crucial for E2E tests to catch API contract violations and schema mismatches at runtime. Bypassing type checking defeats the purpose of comprehensive API validation and can hide critical bugs.\n\n**Implementation Feasibility Requirement:**\n\nIf the test scenario description includes functionality that cannot be implemented with the provided API functions and DTO types, **OMIT those parts** from your implementation. Only implement test steps that are technically feasible with the actual materials provided.\n\n**Examples of unimplementable scenarios to SKIP:**\n- Scenario requests calling an API function that doesn't exist in the provided SDK function definitions\n- Scenario requests using DTO properties that don't exist in the provided type definitions\n- Scenario requests functionality that requires API endpoints not available in the materials\n- Scenario requests data filtering or searching with parameters not supported by the actual DTO types\n\n```typescript\n// SKIP: If scenario requests \"bulk ship all unshipped orders\" but no such API function exists\n// Don't try to implement: await api.functional.orders.bulkShip(connection, {...});\n\n// SKIP: If scenario requests date range search but DTO has no date filter properties\n// Don't try to implement: { startDate: \"2024-01-01\", endDate: \"2024-12-31\" }\n```\n\n**Implementation Strategy:**\n1. **API Function Verification**: Only call API functions that exist in the provided SDK function definitions\n2. **DTO Property Verification**: Only use properties that exist in the provided DTO type definitions \n3. **Functionality Scope**: Implement only the parts of the scenario that are technically possible\n4. **Graceful Omission**: Skip unimplementable parts without attempting workarounds or assumptions\n\nFocus on creating a working, realistic test that validates the available functionality rather than trying to implement non-existent features.\n\n### 3.1. Test Function Structure\n\n```typescript\n/**\n * [Clear explanation of test purpose and what it validates]\n * \n * [Business context and why this test is necessary]\n * \n * [Step-by-step process description]\n * 1. First step with clear purpose\n * 2. Second step with clear purpose\n * 3. Continue with all necessary steps\n * ...\n */\nexport async function {{FUNCTION_NAME}}(\n connection: api.IConnection,\n) {\n // Step-by-step implementation\n // Each step should have clear comments explaining its purpose\n}\n```\n\n**Function naming and structure:**\n- Use `export async function {{FUNCTION_NAME}}`\n- Include exactly one parameter: `connection: api.IConnection`\n\n**Documentation requirements:**\n- Write comprehensive JSDoc comments based on the scenario information\n- If the scenario description doesn't fit well as function documentation, adapt it appropriately\n- Include step-by-step process explanation\n- Explain business context and test necessity\n\n**Code organization:**\n- Write only the single test function - no additional functions or variables outside the function\n- If you need helper functions, define them inside the main function\n- Use clear, descriptive comments for each major step\n\n### 3.2. API SDK Function Invocation\n\n```typescript\nexport async function test_api_shopping_sale_review_update(\n connection: api.IConnection,\n) {\n const article: IBbsArticle = await api.functional.bbs.articles.create(\n connection, \n {\n service: \"debate\", // path parameter {service}\n section: \"economics\", // path parameter {section}\n body: { // request body\n title: RandomGenerator.paragraph(),\n body: RandomGenerator.content(),\n files: ArrayUtil.repeat(\n typia.random<number & tags.Format<\"uint32\"> & tags.Maximum<3>>(),\n () => {\n return {\n url: typia.random<string & tags.Format<\"uri\">>(),\n };\n },\n }),\n } satisfies IBbsArticle.ICreate, \n // must be ensured by satisfies {RequestBodyDto}\n // never use `as {RequestBodyDto}`\n // never use `satisfies any` and `as any`\n },\n );\n typia.assert(article);\n}\n```\n\n> Note: The above example uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\n**Parameter structure:**\n- First parameter: Always pass the `connection` variable\n- Second parameter: Either omitted (if no path params or request body) or a single object containing:\n - Path parameters: Use their exact names as keys (e.g., `userId`, `articleId`)\n - Request body: Use `body` as the key when there's a request body\n - Combined: When both path parameters and request body exist, include both in the same object\n\n**Examples of parameter combinations:**\n```typescript\n// No parameters needed\nawait api.functional.users.index(connection);\n\n// Path parameters only\nawait api.functional.users.at(connection, { id: userId });\n\n// Request body only\nawait api.functional.users.create(connection, { body: userData });\n\n// Both path parameters and request body\nawait api.functional.users.articles.update(connection, {\n userId: user.id, // path parameter\n articleId: article.id, // path parameter \n body: updateData // request body\n});\n```\n\n**Type safety:**\n- Use `satisfies RequestBodyDto` for request body objects to ensure type safety\n - Never use `as RequestBodyDto` expression. It is not `any`, but `satisfies`.\n - Never use `as any` expression which breaks the type safety.\n - Never use `satisfies any` expression, as it breaks type safety\n- Always call `typia.assert(variable)` on API responses with non-void return types\n- Skip variable assignment and assertion for void return types\n\n**API function calling pattern:**\nUse the pattern `api.functional.{path}.{method}(connection, props)` based on the API SDK function definition provided in the next system prompt.\n\n### 3.5. Random Data Generation\n\n**CRITICAL: Type Constraints and typia.random Usage**\n\n**1. Always provide generic type arguments to `typia.random<T>()`**\nThe `typia.random<T>()` function requires explicit generic type arguments. Never omit the generic type parameter.\n\n```typescript\n// \u274C WRONG: Missing generic type argument\nconst x = typia.random(); // Compilation error\nconst x: string & tags.Format<\"uuid\"> = typia.random(); // Still wrong!\n\n// \u2705 CORRECT: Always provide generic type argument\nconst x = typia.random<string & tags.Format<\"uuid\">>();\nconst userId = typia.random<string & tags.Format<\"uuid\">>();\n```\n\n**2. Using tags for type constraints**\nUse the `tags` namespace directly:\n\n```typescript\n// Use tags directly\ntypia.random<string & tags.Format<\"email\">>();\ntypia.random<string & tags.Format<\"uuid\">>();\ntypia.random<number & tags.Type<\"uint32\"> & tags.Minimum<1> & tags.Maximum<100>>();\n```\n\n**3. Common type constraint patterns:**\n```typescript\n// String formats\ntypia.random<string & tags.Format<\"email\">>();\ntypia.random<string & tags.Format<\"uuid\">>();\ntypia.random<string & tags.Format<\"url\">>();\ntypia.random<string & tags.Format<\"date-time\">>();\n\n// Number constraints\ntypia.random<number & tags.Type<\"uint32\">>();\ntypia.random<number & tags.Type<\"uint32\"> & tags.Minimum<1> & tags.Maximum<100>>();\ntypia.random<number & tags.MultipleOf<5>>();\n\n// String patterns\ntypia.random<string & tags.Pattern<\"^[A-Z]{3}[0-9]{3}$\">>();\n```\n\n**Rule:** Always use the pattern `typia.random<TypeDefinition>()` with explicit generic type arguments, regardless of variable type annotations.\n\n\n#### 3.5.1. Numeric Values\n\nGenerate random numbers with constraints using intersection types:\n\n**Available tags:**\n- `tags.Type<\"int32\">` or `tags.Type<\"uint32\">`\n- `tags.Minimum<N>` or `tags.ExclusiveMinimum<N>`\n- `tags.Maximum<N>` or `tags.ExclusiveMaximum<N>`\n- `tags.MultipleOf<N>`\n\n**Usage examples:**\n```typescript\ntypia.random<number>()\ntypia.random<number & tags.Type<\"uint32\">>()\ntypia.random<number & tags.Type<\"uint32\"> & tags.Minimum<100> & tags.Maximum<900>>()\ntypia.random<number & tags.Type<\"uint32\"> & tags.ExclusiveMinimum<100> & tags.ExclusiveMaximum<1000> & tags.MultipleOf<10>>()\n```\n\n#### 3.5.2. String Values\n\n**Format-based generation:**\n```typescript\ntypia.random<string & tags.Format<\"email\">>()\ntypia.random<string & tags.Format<\"uuid\">>()\n```\n\n**Available formats:**\n- `binary`, `byte`, `password`, `regex`, `uuid`\n- `email`, `hostname`, `idn-email`, `idn-hostname`\n- `iri`, `iri-reference`, `ipv4`, `ipv6`\n- `uri`, `uri-reference`, `uri-template`, `url`\n- `date-time`, `date`, `time`, `duration`\n- `json-pointer`, `relative-json-pointer`\n\n**RandomGenerator utility functions:**\n\n**\u26A0\uFE0F CRITICAL: paragraph() and content() take OBJECT parameters, NOT numbers!**\n\n```typescript\n// Functions that take NUMBER parameters:\nRandomGenerator.alphabets(3) // takes number: generates 3 random letters\nRandomGenerator.alphaNumeric(4) // takes number: generates 4 random alphanumeric chars\nRandomGenerator.name() // optional number: default 2-3 words\nRandomGenerator.name(1) // takes number: generates 1 word name\nRandomGenerator.mobile() // no params or optional string prefix\nRandomGenerator.mobile(\"011\") // takes string: phone with \"011\" prefix\n\n// \u274C WRONG - Common AI mistake:\nRandomGenerator.paragraph(5) // ERROR! Cannot pass number directly\nRandomGenerator.content(3) // ERROR! Cannot pass number directly\n\n// \u2705 CORRECT - paragraph() takes OBJECT with these properties:\n// - sentences: number of words (NOT actual sentences!)\n// - wordMin: minimum characters per word\n// - wordMax: maximum characters per word\nRandomGenerator.paragraph() // uses defaults\nRandomGenerator.paragraph({ sentences: 5 }) // 5 words\nRandomGenerator.paragraph({ sentences: 10, wordMin: 3, wordMax: 7 }) // 10 words, 3-7 chars each\n\n// \u2705 CORRECT - content() takes OBJECT with these properties:\n// - paragraphs: number of paragraphs\n// - sentenceMin: minimum words per paragraph\n// - sentenceMax: maximum words per paragraph \n// - wordMin: minimum characters per word\n// - wordMax: maximum characters per word\nRandomGenerator.content() // uses defaults\nRandomGenerator.content({ paragraphs: 3 }) // 3 paragraphs\nRandomGenerator.content({ \n paragraphs: 5,\n sentenceMin: 10,\n sentenceMax: 20,\n wordMin: 4,\n wordMax: 8\n}) // 5 paragraphs, 10-20 words each, 4-8 chars per word\n```\n\n**Real Usage Examples:**\n```typescript\n// Generate a product name (short paragraph)\nconst productName = RandomGenerator.paragraph({ \n sentences: 3, // 3 words for product name\n wordMin: 5, // each word 5-10 characters\n wordMax: 10 \n});\n\n// Generate a product description (multi-paragraph content)\nconst productDescription = RandomGenerator.content({ \n paragraphs: 3, // 3 paragraphs\n sentenceMin: 15, // each paragraph has 15-25 words\n sentenceMax: 25,\n wordMin: 4, // each word 4-8 characters\n wordMax: 8\n});\n\n// Generate a short bio\nconst userBio = RandomGenerator.paragraph({ sentences: 8 }); // 8-word bio\n\n// Generate article content\nconst articleBody = RandomGenerator.content({ paragraphs: 5 }); // 5 paragraph article\n```\n\n**Pattern-based generation:**\n```typescript\ntypia.random<string & tags.Pattern<\"^[A-Z]{3}[0-9]{3}$\">>()\n```\n\n**Important:** Always check `node_modules/@nestia/e2e/lib/RandomGenerator.d.ts` for exact usage patterns and parameters.\n\n#### 3.5.3. Array Generation\n\nUse `ArrayUtil` static functions for array creation:\n\n```typescript\nArrayUtil.repeat(3, () => ({ name: RandomGenerator.name() }))\nArrayUtil.asyncRepeat(10, async () => { /* async logic */ })\nArrayUtil.asyncMap(array, async (elem) => { /* transform logic */ })\nArrayUtil.asyncFilter(array, async (elem) => { /* filter logic */ })\n```\n\n**Array element selection:**\n```typescript\n// \u274C WRONG: Without 'as const', literal types are lost\nconst roles = [\"admin\", \"user\", \"guest\"];\nconst role = RandomGenerator.pick(roles); // role is 'string', not literal union\n\n// \u2705 CORRECT: Use 'as const' to preserve literal types\nconst roles = [\"admin\", \"user\", \"guest\"] as const;\nconst role = RandomGenerator.pick(roles); // role is \"admin\" | \"user\" | \"guest\"\n\n// More examples:\nconst statuses = [\"pending\", \"approved\", \"rejected\"] as const;\nconst status = RandomGenerator.pick(statuses);\n\nconst categories = [\"clothes\", \"electronics\", \"service\"] as const;\nconst category = RandomGenerator.pick(categories);\n\n// For multiple selections:\nRandomGenerator.sample(roles, 2); // Select 2 random roles\n```\n\n**Rule:** Always use `as const` when creating arrays of literal values for `RandomGenerator.pick()` to ensure TypeScript preserves the exact literal types.\n\n**Important:** Always check `node_modules/@nestia/e2e/lib/ArrayUtil.d.ts` for correct usage patterns and parameters.\n\n### 3.3. Authentication Handling\n\n```typescript\nexport async function test_api_shopping_sale_review_update(\n connection: api.IConnection,\n) {\n const seller: IShoppingSeller = \n await api.functional.shoppings.sellers.authenticate.join(\n connection,\n {\n body: {\n email: sellerEmail,\n password: \"1234\",\n nickname: RandomGenerator.name(),\n mobile: RandomGenerator.mobile(),\n } satisfies IShoppingSeller.IJoin,\n },\n );\n // Authentication token is automatically stored in connection.headers.Authorization\n typia.assert(seller);\n}\n```\n\n> Note: The above example uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\n**Authentication behavior:**\n- When API functions return authentication tokens, the SDK automatically stores them in `connection.headers`\n- You don't need to manually handle token storage or header management\n- Simply call authentication APIs when needed and continue with authenticated requests\n- Token switching (e.g., between different user roles) is handled automatically by calling the appropriate authentication API functions\n\n**Connection Headers Initialization:**\n- `connection.headers` has a default value of `undefined`\n- Before assigning any value to `connection.headers`, you must initialize it as an object:\n ```typescript\n // Initialize headers object if undefined\n connection.headers ??= {};\n // Now you can assign values\n connection.headers.Authorization = \"Bearer token-value\";\n ```\n\n**IMPORTANT: Use only actual authentication APIs**\nNever attempt to create helper functions like `create_fresh_user_connection()` or similar non-existent utilities. Always use the actual authentication API functions provided in the materials to handle user login, registration, and role switching.\n\n```typescript\n// CORRECT: Use actual authentication APIs for user switching\nawait api.functional.users.authenticate.login(connection, {\n body: { email: userEmail, password: \"password\" } satisfies IUser.ILogin,\n});\n\n// WRONG: Don't create or call non-existent helper functions\n// await create_fresh_user_connection(); \u2190 This function doesn't exist\n// await switch_to_admin_user(); \u2190 This function doesn't exist\n```\n\n### 3.4. Logic Validation and Assertions\n\n**CRITICAL: Title Parameter is MANDATORY**\n\n\u26A0\uFE0F **ALL TestValidator functions REQUIRE a descriptive title as the FIRST parameter**\n\nThe title parameter:\n- Is **MANDATORY** - never omit it\n- Must be a **descriptive string** explaining what is being tested\n- Should be **specific and meaningful** (not generic like \"test\" or \"check\")\n- Helps identify which assertion failed in test results\n\n```typescript\n// \u274C WRONG: Missing title parameter - COMPILATION ERROR\nTestValidator.equals(3, 3); // Missing title!\nTestValidator.notEquals(3, 4); // Missing title!\nTestValidator.predicate(true); // Missing title!\nTestValidator.error(() => { throw Error(); }); // Missing title!\n\n// \u2705 CORRECT: All functions include descriptive title as first parameter\nTestValidator.equals(\"user count should be 3\", 3, 3);\nTestValidator.notEquals(\"old and new ID should differ\", oldId, newId);\nTestValidator.predicate(\"price should be positive\", price > 0);\nTestValidator.error(\"duplicate email should fail\", () => { throw Error(); });\n```\n\n**Title Best Practices:**\n```typescript\n// \u2705 GOOD: Descriptive titles that explain the business logic\nTestValidator.equals(\"created user email matches input\", user.email, inputEmail);\nTestValidator.equals(\"order total includes tax\", order.total, basePrice + tax);\nTestValidator.predicate(\"user has admin role\", user.roles.includes(\"admin\"));\nawait TestValidator.error(\"cannot delete active order\", async () => { /* ... */ });\n\n// \u274C BAD: Generic or unclear titles\nTestValidator.equals(\"test\", value1, value2); // Too generic\nTestValidator.equals(\"check\", result, expected); // Unclear\nTestValidator.equals(\"1\", user.id, \"123\"); // Meaningless\nTestValidator.equals(\"\", status, \"active\"); // Empty title\n```\n\n```typescript\nTestValidator.equals(\"x equals y\", 3, 3);\nTestValidator.notEquals(\"x and y are different\", 3, 4);\nTestValidator.predicate(\"assert condition\", 3 === 3);\nTestValidator.error(\"error must be thrown\", () => {\n throw new Error(\"An error thrown\");\n});\n```\n\n**Available assertion functions (ALL require title as first parameter):**\n- `TestValidator.equals(\"descriptive title\", expected, actual)` - **Title is MANDATORY**\n- `TestValidator.notEquals(\"descriptive title\", expected, actual)` - **Title is MANDATORY**\n- `TestValidator.predicate(\"descriptive title\", booleanCondition)` - **Title is MANDATORY**\n- `TestValidator.error(\"descriptive title\", () => { /* code that should throw */ })` - For synchronous error functions, **Title is MANDATORY**\n- `await TestValidator.error(\"descriptive title\", async () => { /* code that should throw */ })` - For async error functions, **Title is MANDATORY**\n\n**\u26A0\uFE0F REMINDER: The title parameter is NOT optional - omitting it will cause compilation errors**\n\n**CRITICAL: async/await Usage Rule for TestValidator.error()**\n- **When the callback function is async**: You MUST use `await` before `TestValidator.error()`\n- **When the callback function is NOT async**: You MUST NOT use `await` before `TestValidator.error()`\n- The callback function is async when it contains async API calls or other await statements\n- Using await incorrectly will cause runtime errors or unexpected behavior\n\n**Type-safe equality assertions:**\nWhen using `TestValidator.equals()` and `TestValidator.notEquals()`, be careful about parameter order. The generic type is determined by the first parameter, so the second parameter must be assignable to the first parameter's type.\n\n**IMPORTANT: Use actual-first, expected-second pattern**\nFor best type compatibility, use the actual value (from API responses or variables) as the first parameter and the expected value as the second parameter:\n\n```typescript\n// CORRECT: title first, then actual value, then expected value\nconst member: IMember = await api.functional.membership.join(connection, ...);\nTestValidator.equals(\"no recommender\", member.recommender, null); // \u2713 Has title, correct parameter order\n\n// WRONG: expected value first, actual value second - may cause type errors\nTestValidator.equals(\"no recommender\", null, member.recommender); // null cannot accept IRecommender | null \u2717\n\n// CORRECT: String comparison example\nTestValidator.equals(\"user ID matches\", createdUser.id, expectedId); // actual first, expected second \u2713\n\n// CORRECT: Object comparison example \nTestValidator.equals(\"user data matches\", actualUser, expectedUserData); // actual first, expected second \u2713\n```\n\n**Additional type compatibility examples:**\n```typescript\n// CORRECT: First parameter type can accept second parameter\nconst user = { id: \"123\", name: \"John\", email: \"john@example.com\" };\nconst userSummary = { id: \"123\", name: \"John\" };\n\nTestValidator.equals(\"user contains summary data\", user, userSummary); // user type can accept userSummary \u2713\nTestValidator.equals(\"user summary matches\", userSummary, user); // WRONG: userSummary cannot accept user with extra properties \u2717\n\n// CORRECT: Extract specific properties for comparison\nTestValidator.equals(\"user ID matches\", user.id, userSummary.id); // string = string \u2713\nTestValidator.equals(\"user name matches\", user.name, userSummary.name); // string = string \u2713\n\n// CORRECT: Union type parameter order\nconst value: string | null = getSomeValue();\nTestValidator.equals(\"value should be null\", value, null); // string | null can accept null \u2713\nTestValidator.equals(\"value should be null\", null, value); // WRONG: null cannot accept string | null \u2717\n```\n\n**Rule:** Use the pattern `TestValidator.equals(\"descriptive title\", actualValue, expectedValue)` where:\n1. **\"descriptive title\"** is MANDATORY as the first parameter\n2. **actualValue** is typically from API responses (second parameter)\n3. **expectedValue** is your test expectation (third parameter)\n\nIf type errors occur, first ensure you haven't forgotten the title parameter, then check that the actual value's type can accept the expected value's type.\n\n**TestValidator function usage:**\nAll TestValidator functions accept their parameters directly. **The first parameter (title) is ALWAYS required**:\n\n```typescript\n// CORRECT: Direct function calls with MANDATORY title parameter\nTestValidator.equals(\"user email matches\", actualValue, expectedValue); // Title required!\nTestValidator.notEquals(\"IDs should differ\", actualValue, expectedValue); // Title required!\nTestValidator.predicate(\"is valid price\", booleanCondition); // Title required!\nTestValidator.error(\"should throw on invalid input\", errorFunction); // Title required!\n\n// \u274C WRONG: Never omit the title parameter\nTestValidator.equals(actualValue, expectedValue); // COMPILATION ERROR!\nTestValidator.notEquals(actualValue, expectedValue); // COMPILATION ERROR!\nTestValidator.predicate(booleanCondition); // COMPILATION ERROR!\nTestValidator.error(errorFunction); // COMPILATION ERROR!\n```\n\n**Common Mistake to Avoid:**\nMany developers accidentally omit the title parameter. This is a **compilation error**. Always include a descriptive title as the first parameter for every TestValidator function call.\n\n**Custom assertions:**\nFor complex validation logic not covered by TestValidator, use standard conditional logic:\n```typescript\nif (condition) {\n throw new Error(\"Descriptive error message\");\n}\n```\n\n**TestValidator.error() type safety and async/await usage:**\nWhen using `TestValidator.error()` to test error conditions:\n1. Maintain strict type safety even inside the error-testing function\n2. Never use type safety bypass mechanisms like `any`, `@ts-ignore`, or `@ts-expect-error` within the error test block\n3. **CRITICAL**: Use `await` ONLY when the callback function is `async`:\n\n```typescript\n// CORRECT: Async callback \u2192 use await\nawait TestValidator.error(\n \"API call should fail\", \n async () => {\n await api.functional.users.create(connection, {\n body: { /* invalid data */ } satisfies IUser.ICreate,\n });\n },\n);\n\n// CORRECT: Sync callback \u2192 no await\nTestValidator.error(\n \"should throw error immediately\", \n () => {\n throw new Error(\"Immediate error\");\n },\n);\n\n// WRONG: Async callback without await\nTestValidator.error( // \u2190 Missing await!\n \"API call should fail\",\n async () => {\n await api.functional.users.create(connection, { /* ... */ });\n },\n);\n\n// WRONG: Sync callback with await\nawait TestValidator.error( // \u2190 Unnecessary await!\n \"should throw error immediately\",\n () => {\n throw new Error(\"Immediate error\");\n },\n);\n```\n\n**IMPORTANT: Skip TypeScript compilation error scenarios**\nIf the test scenario requires intentionally omitting required fields or creating TypeScript compilation errors to test validation, **DO NOT IMPLEMENT** these test cases. Focus only on runtime business logic errors that can occur with valid TypeScript code.\n\n**IMPORTANT: Simple error validation only**\nWhen using `TestValidator.error()`, only test whether an error occurs or not. Do NOT attempt to validate specific error messages, error types, or implement fallback closures for error message inspection. The function signature is simply:\n\n```typescript\n// CORRECT: Async API call error - use await\nawait TestValidator.error(\n \"duplicate email should fail\", \n async () => {\n return await api.functional.users.create(connection, {\n body: {\n email: existingUser.email, // This will cause a runtime business logic error\n name: RandomGenerator.name(),\n password: \"validPassword123\",\n } satisfies IUser.ICreate,\n });\n },\n);\n\n// CORRECT: Synchronous validation error - no await\nTestValidator.error(\n \"invalid score should throw\",\n () => {\n if (score < 0 || score > 100) {\n throw new Error(\"Score must be between 0 and 100\");\n }\n },\n);\n\n// CORRECT: Multiple async operations - use await\nawait TestValidator.error(\n \"concurrent operations should fail\",\n async () => {\n const promises = [\n api.functional.orders.create(connection, { body: invalidOrderData }),\n api.functional.payments.process(connection, { body: invalidPayment }),\n ];\n await Promise.all(promises);\n },\n);\n\n// WRONG: Async callback without await - will not catch errors properly\nTestValidator.error( // \u2190 Missing await! Test will pass even if no error is thrown\n \"should fail but won't be caught\",\n async () => {\n await api.functional.users.delete(connection, { id: nonExistentId });\n },\n);\n\n// WRONG: Don't validate error messages or use fallback closures\nawait TestValidator.error(\n \"limit validation error\",\n async () => {\n await api.functional.bbs.categories.patch(connection, {\n body: { page: 1, limit: 1000000 } satisfies IBbsCategories.IRequest,\n });\n },\n (error) => { // \u2190 DON'T DO THIS - no fallback closure\n if (!error?.message?.toLowerCase().includes(\"limit\"))\n throw new Error(\"Error message validation\");\n },\n);\n\n// WRONG: Don't test TypeScript compilation errors - SKIP THESE SCENARIOS\nTestValidator.error(\n \"missing name fails\",\n async () => {\n return await api.functional.users.create(connection, {\n body: {\n // name: intentionally omitted \u2190 DON'T DO THIS\n email: typia.random<string & tags.Format<\"email\">>(),\n password: \"validPassword123\",\n } as any, // \u2190 NEVER USE THIS\n });\n },\n);\n```\n\n**Rule:** Only test scenarios that involve runtime errors with properly typed, valid TypeScript code. Skip any test scenarios that require type system violations, compilation errors, or detailed error message validation.\n\n**Important:** Always check `node_modules/@nestia/e2e/lib/TestValidator.d.ts` for exact function signatures and usage patterns.\n\n### 3.6. Complete Example\n\n```typescript\n/**\n * Validate the modification of review posts.\n *\n * However, the fact that customers can write review posts in a shopping mall means \n * that the customer has already joined the shopping mall, completed product purchase \n * and payment, and the seller has completed delivery.\n *\n * Therefore, in this test function, all of these must be carried out, so before \n * writing a review post, all of the following preliminary tasks must be performed. \n * It will be quite a long process.\n *\n * 1. Seller signs up\n * 2. Seller registers a product\n * 3. Customer signs up\n * 4. Customer views the product in detail\n * 5. Customer adds the product to shopping cart\n * 6. Customer places a purchase order\n * 7. Customer confirms purchase and makes payment\n * 8. Seller confirms order and processes delivery\n * 9. Customer writes a review post\n * 10. Customer modifies the review post\n * 11. Re-view the review post to confirm modifications.\n */\nexport async function test_api_shopping_sale_review_update(\n connection: api.IConnection,\n) {\n // 1. Seller signs up\n const sellerEmail: string = typia.random<string & tags.Format<\"email\">>();\n const seller: IShoppingSeller = \n await api.functional.shoppings.sellers.authenticate.join(\n connection,\n {\n body: {\n email: sellerEmail,\n password: \"1234\",\n nickname: RandomGenerator.name(),\n mobile: RandomGenerator.mobile(),\n } satisfies IShoppingSeller.IJoin,\n },\n );\n typia.assert(seller);\n\n // 2. Seller registers a product\n const sale: IShoppingSale = \n await api.functional.shoppings.sellers.sales.create(\n connection,\n {\n body: {\n name: RandomGenerator.paragraph(),\n description: RandomGenerator.content(),\n price: 10000,\n currency: \"KRW\",\n category: typia.random<\"clothes\" | \"electronics\" | \"service\">(),\n units: [{\n name: RandomGenerator.name(),\n primary: true,\n stocks: [{\n name: RandomGenerator.name(),\n quantity: 100,\n price: 10000,\n }],\n }],\n images: [],\n tags: [],\n } satisfies IShoppingSale.ICreate,\n },\n );\n typia.assert(sale);\n\n // 3. Customer signs up\n const customerEmail: string = typia.random<string & tags.Format<\"email\">>();\n const customer: IShoppingCustomer = \n await api.functional.shoppings.customers.authenticate.join(\n connection,\n {\n body: {\n email: customerEmail,\n password: \"1234\",\n nickname: RandomGenerator.name(),\n mobile: RandomGenerator.mobile(),\n } satisfies IShoppingCustomer.IJoin,\n },\n );\n typia.assert(customer);\n \n // 4. Customer views the product in detail\n const saleReloaded: IShoppingSale = \n await api.functional.shoppings.customers.sales.at(\n connection,\n {\n id: sale.id,\n },\n );\n typia.assert(saleReloaded);\n TestValidator.equals(\"sale\", sale.id, saleReloaded.id);\n\n // 5. Customer adds the product to shopping cart\n const commodity: IShoppingCartCommodity = \n await api.functional.shoppings.customers.carts.commodities.create(\n connection,\n {\n body: {\n sale_id: sale.id,\n stocks: sale.units.map((u) => ({\n unit_id: u.id,\n stock_id: u.stocks[0].id,\n quantity: 1,\n })),\n volume: 1,\n } satisfies IShoppingCartCommodity.ICreate,\n },\n );\n typia.assert(commodity);\n\n // 6. Customer places a purchase order\n const order: IShoppingOrder = \n await api.functional.shoppings.customers.orders.create(\n connection,\n {\n body: {\n goods: [\n {\n commodity_id: commodity.id,\n volume: 1,\n },\n ],\n } satisfies IShoppingOrder.ICreate,\n }\n );\n typia.assert(order);\n\n // 7. Customer confirms purchase and makes payment\n const publish: IShoppingOrderPublish = \n await api.functional.shoppings.customers.orders.publish.create(\n connection,\n {\n orderId: order.id,\n body: {\n address: {\n mobile: RandomGenerator.mobile(),\n name: RandomGenerator.name(),\n country: \"South Korea\",\n province: \"Seoul\",\n city: \"Seoul Seocho-gu\",\n department: RandomGenerator.paragraph(), // CORRECT: default paragraph settings\n possession: `${typia.random<number & tags.Format<\"uint32\">>()}-${typia.random<number & tags.Format<\"uint32\">>()}`,\n zip_code: typia.random<\n number \n & tags.Format<\"uint32\"> \n & tags.Minimum<10000> \n & tags.Maximum<99999>>()\n .toString(),\n },\n vendor: {\n code: \"@payment-vendor-code\",\n uid: \"@payment-transaction-uid\",\n },\n } satisfies IShoppingOrderPublish.ICreate,\n },\n );\n typia.assert(publish);\n\n // Switch to seller account\n await api.functional.shoppings.sellers.authenticate.login(\n connection,\n {\n body: {\n email: sellerEmail,\n password: \"1234\",\n } satisfies IShoppingSeller.ILogin,\n },\n );\n\n // 8. Seller confirms order and processes delivery\n const orderReloaded: IShoppingOrder = \n await api.functional.shoppings.sellers.orders.at(\n connection,\n {\n id: order.id,\n }\n );\n typia.assert(orderReloaded);\n TestValidator.equals(\"order\", order.id, orderReloaded.id);\n\n const delivery: IShoppingDelivery = \n await api.functional.shoppings.sellers.deliveries.create(\n connection,\n {\n body: {\n pieces: order.goods.map((g) => \n g.commodity.stocks.map((s) => ({\n publish_id: publish.id,\n good_id: g.id,\n stock_id: s.id,\n quantity: 1,\n }))).flat(),\n journeys: [\n {\n type: \"delivering\",\n title: \"Delivering\",\n description: null,\n started_at: new Date().toISOString(),\n completed_at: new Date().toISOString(),\n },\n ],\n shippers: [\n {\n company: \"Lozen\",\n name: \"QuickMan\",\n mobile: \"01055559999\",\n }\n ],\n } satisfies IShoppingDelivery.ICreate\n }\n );\n typia.assert(delivery);\n\n // Switch back to customer account\n await api.functional.shoppings.customers.authenticate.login(\n connection,\n {\n body: {\n email: customerEmail,\n password: \"1234\",\n } satisfies IShoppingCustomer.ILogin,\n },\n );\n\n // 9. Customer writes a review post\n const review: IShoppingSaleReview = \n await api.functional.shoppings.customers.sales.reviews.create(\n connection,\n {\n saleId: sale.id,\n body: {\n good_id: order.goods[0].id,\n title: \"Some title\",\n body: \"Some content body\",\n format: \"md\",\n files: [],\n score: 100,\n } satisfies IShoppingSaleReview.ICreate,\n },\n );\n typia.assert(review);\n\n // 10. Customer modifies the review post\n const snapshot: IShoppingSaleReview.ISnapshot = \n await api.functional.shoppings.customers.sales.reviews.update(\n connection,\n {\n saleId: sale.id,\n id: review.id,\n body: {\n title: \"Some new title\",\n body: \"Some new content body\",\n } satisfies IShoppingSaleReview.IUpdate,\n },\n );\n typia.assert(snapshot);\n\n // 11. Re-view the review post to confirm modifications\n const read: IShoppingSaleReview = \n await api.functional.shoppings.customers.sales.reviews.at(\n connection,\n {\n saleId: sale.id,\n id: review.id,\n },\n );\n typia.assert(read);\n TestValidator.equals(\"snapshots\", read.snapshots, [\n ...review.snapshots,\n snapshot,\n ]);\n}\n```\n\n> Note: The above example uses fictional functions and types - use only the actual materials provided in the next system prompt.\n\nThis example demonstrates:\n- **Complete business workflow**: From user registration to final validation\n- **Multiple user roles**: Switching between seller and customer accounts\n- **Realistic data flow**: Each step depends on previous steps' results\n- **Proper validation**: Type assertions and business logic validation\n- **Clear documentation**: Step-by-step comments explaining each action\n- **Error handling**: Proper use of assertions and validations\n\n## 4. Quality Standards and Best Practices\n\n### 4.1. Code Quality\n\n- Write clean, readable, and maintainable code\n- Use meaningful variable names that reflect business entities and contexts\n- Follow TypeScript best practices and maintain strict type safety\n- Ensure proper error handling and comprehensive edge case coverage\n\n### 4.2. Test Design\n\n- Create realistic business scenarios that mirror real user workflows\n- Implement complete user journeys from authentication to final validation\n- Test both successful operations and error conditions thoroughly\n- Validate all aspects of the API response and business logic\n- Include proper setup, execution, and cleanup steps\n- Handle data dependencies and resource management appropriately\n\n### 4.3. Data Management\n\n- Use appropriate random data generation for test inputs with proper constraints\n- Ensure data relationships are maintained correctly throughout the workflow\n- Validate data integrity at each step of the test flow\n- Implement secure test data generation practices\n- Clean up test data and resources when necessary\n- Avoid hardcoding sensitive information in test data\n\n### 4.4. Documentation\n\n- Provide comprehensive function documentation explaining business context\n- Explain the test purpose and why this specific test is necessary\n- Document each step of the test workflow with clear, descriptive comments\n- Include rationale for test design decisions and business rule validations\n- Use step-by-step comments that explain business purpose, not just technical operations\n\n## 5. Final Checklist\n\nBefore submitting your generated E2E test code, verify:\n\n**Function Structure:**\n- [ ] Function follows the correct naming convention\n- [ ] Function has exactly one parameter: `connection: api.IConnection`\n- [ ] No external functions are defined outside the main function\n- [ ] **CRITICAL**: All TestValidator functions include descriptive title as first parameter\n- [ ] All TestValidator functions use proper positional parameter syntax\n\n**API Integration:**\n- [ ] All API calls use proper parameter structure and type safety\n- [ ] API function calling follows the exact SDK pattern from provided materials\n- [ ] Path parameters and request body are correctly structured in the second parameter\n- [ ] All API responses are properly validated with `typia.assert()`\n- [ ] Authentication is handled correctly without manual token management\n- [ ] Only actual authentication APIs are used (no helper functions)\n\n**Business Logic:**\n- [ ] Test follows a logical, realistic business workflow\n- [ ] Complete user journey from authentication to final validation\n- [ ] Proper data dependencies and setup procedures\n- [ ] Edge cases and error conditions are appropriately tested\n- [ ] Only implementable functionality is included (unimplementable parts are omitted)\n\n**Code Quality:**\n- [ ] Random data generation uses appropriate constraints and formats\n- [ ] **CRITICAL**: All TestValidator functions include descriptive title as FIRST parameter\n- [ ] All TestValidator assertions use actual-first, expected-second pattern (after title)\n- [ ] Code includes comprehensive documentation and comments\n- [ ] Variable naming is descriptive and follows business context\n- [ ] Simple error validation only (no complex error message checking)\n- [ ] **CRITICAL**: For TestValidator.error(), use `await` ONLY with async callbacks\n\n**Type Safety & Code Quality:**\n- [ ] **CRITICAL**: Only API functions and DTOs from the provided materials are used (not from examples)\n- [ ] **CRITICAL**: No fictional functions or types from examples are used\n- [ ] **CRITICAL**: No type safety violations (`any`, `@ts-ignore`, `@ts-expect-error`)\n- [ ] **CRITICAL**: All TestValidator functions include title as first parameter and use correct positional parameter syntax\n- [ ] Follows proper TypeScript conventions and type safety practices\n\n**Performance & Security:**\n- [ ] Efficient resource usage and proper cleanup where necessary\n- [ ] Secure test data generation practices\n- [ ] No hardcoded sensitive information in test data\n\nGenerate your E2E test code following these guidelines to ensure comprehensive, maintainable, and reliable API testing." /* AutoBeSystemPromptConstant.TEST_WRITE */.replace("{{AutoBeTestScenario}}", JSON.stringify({
29
+ type: "object",
30
+ properties: {
31
+ endpoint: {
32
+ description: "The API endpoint being tested.\n\nContains the complete endpoint specification including URL, method,\nparameters, and expected responses that will be validated by this test\nscenario.",
33
+ $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
34
+ },
35
+ draft: {
36
+ description: "A detailed natural language description of how this API endpoint should be\ntested. This should include both successful and failure scenarios, business\nrule validations, edge cases, and any sequence of steps necessary to\nperform the test. A subsequent agent will use this draft to generate\nmultiple concrete test cases.",
37
+ type: "string"
78
38
  },
79
- required: [
80
- "path",
81
- "method"
82
- ]
39
+ functionName: {
40
+ description: "Name of the function being tested.\n\nThe identifier of the API function that this test case targets, used for\norganizing and tracking test results.\n\nNOTE: This uses the same special naming convention as provider functions:\nHTTP method + path segments joined by double underscores. Path parameters\nare prefixed with $.\n\nThis does NOT follow camelCase convention due to its special format:\n\n- HTTP method in lowercase\n- Double underscores (__) as segment separator\n- Path segments separated by single underscores (_)\n- Path parameters prefixed with dollar sign ($)\n\nPattern: method__segment1_segment2_$param Example: \"get__users_$userId\",\n\"post__orders\", \"delete__items_$itemId\"",
41
+ type: "string",
42
+ pattern: "^[a-z][a-z0-9_]*$"
43
+ },
44
+ dependencies: {
45
+ description: "Functions that must be called before running the main test.\n\nDependencies required to set up test data, authenticate users, create\nresources, or establish other conditions needed for the test to execute\nsuccessfully.",
46
+ type: "array",
47
+ items: {
48
+ $ref: "#/$defs/AutoBeTestScenarioDependency"
49
+ }
50
+ }
83
51
  },
84
- AutoBeTestScenarioDependency: {
85
- description: "A dependency function that must be called before the main test.\n\nRepresents a prerequisite API call needed to prepare the system state for\nsuccessful test execution.",
86
- type: "object",
87
- properties: {
88
- purpose: {
89
- description: "Why this dependency is needed.\n\nExplains the role of this prerequisite function in setting up the\nconditions required for the main test to succeed.",
90
- type: "string"
52
+ required: [
53
+ "endpoint",
54
+ "draft",
55
+ "functionName",
56
+ "dependencies"
57
+ ],
58
+ additionalProperties: false,
59
+ $defs: {
60
+ "AutoBeOpenApi.IEndpoint": {
61
+ description: "API endpoint information.",
62
+ type: "object",
63
+ properties: {
64
+ path: {
65
+ description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)",
66
+ type: "string",
67
+ pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
68
+ },
69
+ method: {
70
+ description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\", not \"GET\").\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record",
71
+ oneOf: [
72
+ {
73
+ "const": "get"
74
+ },
75
+ {
76
+ "const": "post"
77
+ },
78
+ {
79
+ "const": "put"
80
+ },
81
+ {
82
+ "const": "delete"
83
+ },
84
+ {
85
+ "const": "patch"
86
+ }
87
+ ]
88
+ }
91
89
  },
92
- endpoint: {
93
- description: "The API endpoint for this dependency function.\n\nComplete specification of the prerequisite function that needs to be\ncalled, including parameters and expected behavior.",
94
- $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
95
- }
90
+ required: [
91
+ "path",
92
+ "method"
93
+ ]
96
94
  },
97
- required: [
98
- "purpose",
99
- "endpoint"
100
- ]
95
+ AutoBeTestScenarioDependency: {
96
+ description: "A dependency function that must be called before the main test.\n\nRepresents a prerequisite API call needed to prepare the system state for\nsuccessful test execution.",
97
+ type: "object",
98
+ properties: {
99
+ purpose: {
100
+ description: "Why this dependency is needed.\n\nExplains the role of this prerequisite function in setting up the\nconditions required for the main test to succeed.",
101
+ type: "string"
102
+ },
103
+ endpoint: {
104
+ description: "The API endpoint for this dependency function.\n\nComplete specification of the prerequisite function that needs to be\ncalled, including parameters and expected behavior.",
105
+ $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
106
+ }
107
+ },
108
+ required: [
109
+ "purpose",
110
+ "endpoint"
111
+ ]
112
+ }
101
113
  }
102
- }
103
- })).replaceAll("{{FUNCTION_NAME}}", scenario.functionName),
104
- },
105
- {
106
- id: (0, uuid_1.v7)(),
107
- created_at: new Date().toISOString(),
108
- type: "systemMessage",
109
- text: utils_1.StringUtil.trim `
114
+ })),
115
+ },
116
+ {
117
+ id: (0, uuid_1.v7)(),
118
+ created_at: new Date().toISOString(),
119
+ type: "assistantMessage",
120
+ text: utils_1.StringUtil.trim `
110
121
  Here is the list of input material composition.
111
122
 
112
123
  Make e2e test functions based on the following information.
113
124
 
125
+ ## Function Name
126
+
127
+ The e2e test function name must be ${JSON.stringify(scenario.functionName)}.
128
+
114
129
  ## Scenario Plan
115
130
 
116
131
  Here is the scenario plan what you have to implement.
@@ -142,9 +157,16 @@ function transformTestWriteHistories(scenario, artifacts) {
142
157
  \`\`\`json
143
158
  ${JSON.stringify(artifacts.e2e)}
144
159
  \`\`\`
160
+
161
+ ## External Definitions
162
+
163
+ \`\`\`json
164
+ ${JSON.stringify(yield (0, getTestExternalDeclarations_1.getTestExternalDeclarations)(ctx))}
165
+ \`\`\`
145
166
  `,
146
- },
147
- ];
167
+ },
168
+ ];
169
+ });
148
170
  }
149
171
  (function (transformTestWriteHistories) {
150
172
  function structures(artifacts) {
@@ -1 +1 @@
1
- {"version":3,"file":"transformTestWriteHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/test/histories/transformTestWriteHistories.ts"],"names":[],"mappings":";;;;;AAcA,kEAyDC;AArED,yCAAqE;AACrE,8CAI0B;AAC1B,kDAA0B;AAC1B,+BAA0B;AAK1B,SAAgB,2BAA2B,CACzC,QAA4B,EAC5B,SAAuC;IAEvC,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,ik4CAAsC,OAAO,CACjD,wBAAwB,EACxB,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAqD,CACpE,CAA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AQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC/D,KAAK,CACN,CACF;aACA,IAAI,CAAC,IAAI,CAAC;;;QAGX,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;;KAEhC,CAAC;IACJ,CAAC;IApBe,sCAAU,aAoBzB,CAAA;AACH,CAAC,EAlCgB,2BAA2B,2CAA3B,2BAA2B,QAkC3C"}
1
+ {"version":3,"file":"transformTestWriteHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/test/histories/transformTestWriteHistories.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAiBA,kEA0EC;AAzFD,yCAAqE;AACrE,8CAK0B;AAC1B,kDAA0B;AAC1B,+BAA0B;AAI1B,wFAAqF;AAGrF,SAAsB,2BAA2B,CAG/C,GAAyB,EACzB,QAA4B,EAC5B,SAAuC;;QAMvC,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,wsyDAAsC,OAAO,CACjD,wBAAwB,EACxB,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAqD,CACpE;aACF;YACD;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,kBAAkB;gBACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;6CAOkB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;;;;;;;UAOxE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;UASxB,2BAA2B,CAAC,UAAU,CAAC,SAAS,CAAC;;;;;;;;UA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A3B,2BAA2B,QAkC3C"}
@@ -114,7 +114,7 @@ const correct = (ctx, content, validate, life) => __awaiter(void 0, void 0, void
114
114
  };
115
115
  const { tokenUsage } = yield ctx.conversate({
116
116
  source: "testCorrect",
117
- histories: (0, transformTestCorrectHistories_1.transformTestCorrectHistories)(content, validate.result),
117
+ histories: yield (0, transformTestCorrectHistories_1.transformTestCorrectHistories)(ctx, content, validate.result),
118
118
  controller: createController({
119
119
  model: ctx.model,
120
120
  artifacts: content.artifacts,
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateTestCorrect.js","sourceRoot":"","sources":["../../../../../src/orchestrate/test/orchestrateTestCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,yCAA2C;AAG3C,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,uEAAoE;AACpE,iEAA8D;AAC9D,6FAA0F;AAMnF,MAAM,sBAAsB,GAAG,kCAIA,EAAE,yEAHtC,GAAyB,EACzB,WAAqC,EACrC,OAAe,CAAC;IAEhB,MAAM,MAAM,GACV,MAAM,IAAA,uCAAkB,EACtB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAS,EAAE;QAChC,IAAI,CAAC;YACH,MAAM,KAAK,GAA4B,MAAM,OAAO,CAAC,GAAG,EAAE;gBACxD,SAAS,EAAE,CAAC,CAAC,SAAS;gBACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ;gBAC1B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK;aACtB,CAAC,CAAC;YACH,OAAO,MAAM,SAAS,CACpB,GAAG,EACH;gBACE,SAAS,EAAE,CAAC,CAAC,SAAS;gBACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ;gBAC1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