'use strict';

var zod = require('zod');

// src/qa/testing.zod.ts
var TestContextSchema = zod.z.record(zod.z.string(), zod.z.unknown()).describe("Initial context or variables for the test");
var TestActionTypeSchema = zod.z.enum([
  "create_record",
  "update_record",
  "delete_record",
  "read_record",
  "query_records",
  "api_call",
  "run_script",
  "wait"
  // Testing async processes
]).describe("Type of test action to perform");
var TestActionSchema = zod.z.object({
  type: TestActionTypeSchema.describe("The action type to execute"),
  target: zod.z.string().describe("Target Object, API Endpoint, or Function Name"),
  payload: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Data to send or use"),
  user: zod.z.string().optional().describe("Run as specific user/role for impersonation testing")
}).describe("A single test action to execute against the system");
var TestAssertionTypeSchema = zod.z.enum([
  "equals",
  "not_equals",
  "contains",
  "not_contains",
  "is_null",
  "not_null",
  "gt",
  "gte",
  "lt",
  "lte",
  "error"
  // Expecting an error
]).describe("Comparison operator for test assertions");
var TestAssertionSchema = zod.z.object({
  field: zod.z.string().describe('Field path in the result to check (e.g. "body.data.0.status")'),
  operator: TestAssertionTypeSchema.describe("Comparison operator to use"),
  expectedValue: zod.z.unknown().describe("Expected value to compare against")
}).describe("A test assertion that validates the result of a test action");
var TestStepSchema = zod.z.object({
  name: zod.z.string().describe("Step name for identification in test reports"),
  description: zod.z.string().optional().describe("Human-readable description of what this step tests"),
  action: TestActionSchema.describe("The action to execute in this step"),
  assertions: zod.z.array(TestAssertionSchema).optional().describe("Assertions to validate after the action completes"),
  // Capture outputs to variables for subsequent steps
  capture: zod.z.record(zod.z.string(), zod.z.string()).optional().describe('Map result fields to context variables: { "newId": "body.id" }')
}).describe("A single step in a test scenario, consisting of an action and optional assertions");
var TestScenarioSchema = zod.z.object({
  id: zod.z.string().describe("Unique scenario identifier"),
  name: zod.z.string().describe("Scenario name for test reports"),
  description: zod.z.string().optional().describe("Detailed description of the test scenario"),
  tags: zod.z.array(zod.z.string()).optional().describe('Tags for filtering and categorization (e.g. "critical", "regression", "crm")'),
  setup: zod.z.array(TestStepSchema).optional().describe("Steps to run before main test (preconditions)"),
  steps: zod.z.array(TestStepSchema).describe("Main test sequence to execute"),
  teardown: zod.z.array(TestStepSchema).optional().describe("Steps to cleanup after test execution"),
  // Environment requirements
  requires: zod.z.object({
    params: zod.z.array(zod.z.string()).optional().describe("Required environment variables or parameters"),
    plugins: zod.z.array(zod.z.string()).optional().describe("Required plugins that must be loaded")
  }).optional().describe("Environment requirements for this scenario")
}).describe("A complete test scenario with setup, execution steps, and teardown");
var TestSuiteSchema = zod.z.object({
  name: zod.z.string().describe("Test suite name"),
  scenarios: zod.z.array(TestScenarioSchema).describe("List of test scenarios in this suite")
}).describe("A collection of test scenarios grouped into a test suite");

exports.TestActionSchema = TestActionSchema;
exports.TestActionTypeSchema = TestActionTypeSchema;
exports.TestAssertionSchema = TestAssertionSchema;
exports.TestAssertionTypeSchema = TestAssertionTypeSchema;
exports.TestContextSchema = TestContextSchema;
exports.TestScenarioSchema = TestScenarioSchema;
exports.TestStepSchema = TestStepSchema;
exports.TestSuiteSchema = TestSuiteSchema;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map